diff options
Diffstat (limited to 'ANR-App/src/main/java/org/onap/ranapp/kafka')
21 files changed, 361 insertions, 214 deletions
diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/client/KafkaClientRanappTopic.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/client/KafkaClientRanappTopic.java index e80b8e1..090fbfd 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/client/KafkaClientRanappTopic.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/client/KafkaClientRanappTopic.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.client; import java.util.Arrays; import java.util.Properties; @@ -22,31 +37,22 @@ import lombok.Getter; import reactor.core.Disposable; @Component public class KafkaClientRanappTopic { - private static final Logger logger = LoggerFactory.getLogger(KafkaClientRanappTopic.class); - @Value("${kafkadispatcher.url}") private String kafkaclient_url; @Value("${ranapp.policytype}") private String policytype_name; - @Value(value = "${kafka.bootstrapAddress}") private String bootstrapAddress; @Value(value = "${ranapp.testing.topic.id}") private String groupId; - public static String requestTopicName = ""; - public static String responseTopicName = ""; - @Getter(AccessLevel.PROTECTED) private Disposable refreshTask = null; - @Autowired RanAppEventConsumer ranappeventconsumer; - private RestTemplate restTemplate = new RestTemplate(); - @Bean public RetryTemplate retryTemplate() { int maxAttempt = Integer.parseInt("10"); @@ -60,22 +66,18 @@ public class KafkaClientRanappTopic { template.setBackOffPolicy(backOffPolicy); return template; } - public void getRanApp_KafkaTopicnames() { logger.info("Requesting for KafkaTopics"); stop(); refreshTask=retryTemplate().execute(context -> { String url = kafkaclient_url + policytype_name ; System.out.println("retrying Connection: "+url); - - ResponseEntity<PolicytypetoTopicMapping> requestData = restTemplate.getForEntity(url, PolicytypetoTopicMapping.class); PolicytypetoTopicMapping policytoTopicMapping=requestData.getBody(); requestTopicName=policytoTopicMapping.getRequest_topic(); responseTopicName=policytoTopicMapping.getResponse_topic(); logger.info("Request Topic for Policy "+ policytype_name +" "+ requestTopicName); logger.info("Response Topic for Policy "+ policytype_name +" "+ responseTopicName); - Properties properties=new Properties(); properties.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,bootstrapAddress); properties.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); @@ -91,7 +93,6 @@ public class KafkaClientRanappTopic { throw new IllegalStateException("Something went wrong"); }); } - public void stop() { if (refreshTask != null) { refreshTask.dispose(); diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/listener/RanAppEventConsumer.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/listener/RanAppEventConsumer.java index 037dd54..b251f0f 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/listener/RanAppEventConsumer.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/listener/RanAppEventConsumer.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.listener; import java.time.Duration; import java.util.LinkedList; @@ -34,25 +49,17 @@ public class RanAppEventConsumer { private final Logger logger = LoggerFactory.getLogger(RanAppEventConsumer.class); public RanAppEventConsumer() { } - - @Value("${ranapp.hokpi1_threshold}") private int hokpiThreshold; - @Value(value = "${kafka.bootstrapAddress}") private String bootstrapAddress; ObjectMapper objectMapper = new ObjectMapper(); - @Autowired KafkaTemplate<String, Object> Kafkatemplate; - @Autowired WebsocketClient websocketclient; - ResponsetoA1 response=new ResponsetoA1(); - - public static String requestTopicName,responseTopicName; - + public static String requestTopicName,responseTopicName,kafkakeyName; //@KafkaListener(topics = "#{topicUtil.suffixTopics()}", groupId = "${ranapp.testing.topic.id}", containerFactory = "kafkaListenerFactory") public void consume(KafkaConsumer<String,String> consumer, String requesttopicName, String responsetopicName) { try { @@ -60,15 +67,17 @@ public class RanAppEventConsumer { responseTopicName=responsetopicName; WebsocketClient.requestTopicName=requesttopicName; WebsocketClient.responseTopicName=responsetopicName; - while(true){ - ConsumerRecords<String,String> records=consumer.poll(Duration.ofMillis(1000)); + ConsumerRecords<String,String> records=consumer.poll(Duration.ofMillis(5000)); for(ConsumerRecord<String,String> record: records){ - logger.info("Key: "+ record.key() + ", Value:" +record.value()); + String msg=record.value().translateEscapes().strip().stripIndent().trim().replaceAll("(?m)^[ \t]*\r?\n", ""); + msg=msg.substring( 1, msg.length() - 1 ); + logger.info("Key: "+ record.key() + ", Value:" +msg); logger.info("Partition:" + record.partition()+",Offset:"+record.offset()); - JSONObject obj_name = new JSONObject(record.value()); + JSONObject obj_name = new JSONObject(msg); logger.info(String.format("ranapp message recieved \n-> %s \n", obj_name)); - + kafkakeyName=record.key(); + WebsocketClient.kafkakeyName=record.key(); ANRInputMessage ANRInputMessage=null; try { logger.info(String.format("Parsing the incoming json object to ANRInputMessage class")); @@ -77,7 +86,6 @@ public class RanAppEventConsumer { logger.info(String.format( "Invalid Message received . Exception while parsing JSON object -> %s", ex.getLocalizedMessage())); - ex.printStackTrace(); return; } @@ -86,14 +94,12 @@ public class RanAppEventConsumer { ANROutputMessage ANROutputMessage= convertInputMessagetoANROutput(ANRInputMessage); logger.info(String.format("ANROutputMessage")); logger.info(String.format(objectMapper.writeValueAsString(ANROutputMessage))); - // Output Payload is sent as Websocket message to RC DeviceData devicedata=new DeviceData(); devicedata.setMessage(objectMapper.writeValueAsString(ANROutputMessage.getPayload())); devicedata.setType(MessageType.KAFKA_MSG); logger.info(String.format("Sending Output Payload to RC WS Server")); websocketclient.sendMessage(devicedata); - } catch (Exception e) { e.getLocalizedMessage(); e.printStackTrace(); @@ -108,9 +114,6 @@ public class RanAppEventConsumer { // TODO Auto-generated method stub logger.info(String.format("Creating OutputMessage from ANRInput Function")); ANROutputMessage ANROutputMessage=new ANROutputMessage(); - - - logger.info(String.format("initializing output parameters")); //initializing Output Params PayloadOutput payloadOutput=new PayloadOutput(); @@ -124,21 +127,18 @@ public class RanAppEventConsumer { Common common=new Common(); NeighborListInUse neighbourlistinuse=new NeighborListInUse(); List<LTECell> listltecell=new LinkedList<LTECell>(); - - - logger.info(String.format("Iterating Neighbour cells to validate KPI")); // Parsing the payload.policydata into output message payload - common.setCellIdentity(ANRInputMessage.getPayload().getPolicyData().getCellID()); - int length=ANRInputMessage.getPayload().getPolicyData().getNeighbours().size(); + common.setCellIdentity(ANRInputMessage.getPayload().getCellID()); + int length=ANRInputMessage.getPayload().getNeighbours().size(); for(int i=0;i<length;i++) { LTECell ltecell=new LTECell(); - ltecell.setIdGNBCUCPFunction(ANRInputMessage.getPayload().getPolicyData().getNeighbours().get(i).getPNFName()); - ltecell.setPlmnid(ANRInputMessage.getPayload().getPolicyData().getNeighbours().get(i).getPlmnid()); + ltecell.setIdGNBCUCPFunction(ANRInputMessage.getPayload().getNeighbours().get(i).getPNFName()); + ltecell.setPlmnid(ANRInputMessage.getPayload().getNeighbours().get(i).getPlmnid()); ltecell.setnRTCI(0); - ltecell.setIdNRCellRelation(ANRInputMessage.getPayload().getPolicyData().getNeighbours().get(i).getCellID()); + ltecell.setIdNRCellRelation(ANRInputMessage.getPayload().getNeighbours().get(i).getCellID()); //Identify KPI Measurement - if(ANRInputMessage.getPayload().getPolicyData().getNeighbours().get(i).getHoKpi1() < hokpiThreshold) + if(ANRInputMessage.getPayload().getNeighbours().get(i).getHoKpi1() < hokpiThreshold) ltecell.setIsHOAllowed("true"); else ltecell.setIsHOAllowed("false"); @@ -150,20 +150,15 @@ public class RanAppEventConsumer { ran.setNeighborListInUse(neighbourlistinuse); lte.setRan(ran); cellconfig.setLte(lte); - fapservice.setIdNRCellCU(ANRInputMessage.getPayload().getPolicyData().getPNFName()); + fapservice.setIdNRCellCU(ANRInputMessage.getPayload().getPNFName()); fapservice.setCellConfig(cellconfig); - data.setRicId(ANRInputMessage.getPayload().getRicId()); data.setFAPService(fapservice); configuration.setData(data); //how do we iterate in a standard way, currently working in a static way listconfiguration.add(configuration); payloadOutput.setConfigurations(listconfiguration); - - ANROutputMessage.setPayload(payloadOutput); - logger.info(String.format("returning back output msg")); return ANROutputMessage; } - } diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ANRInputMessage.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ANRInputMessage.java index 6fc85ba..8752d0e 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ANRInputMessage.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ANRInputMessage.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ANROutputMessage.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ANROutputMessage.java index 64c71bb..c1567de 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ANROutputMessage.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ANROutputMessage.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Aai.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Aai.java index c1c92c3..aed3ded 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Aai.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Aai.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/AppDescriptorKafkaTemplate.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/AppDescriptorKafkaTemplate.java index 38cc396..9819273 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/AppDescriptorKafkaTemplate.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/AppDescriptorKafkaTemplate.java @@ -1,8 +1,21 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; public class AppDescriptorKafkaTemplate { private String requestType; - - @Override public String toString() { return "AppDescriptorKafkaTemplate [requestType=" + requestType + ", plainText=" + plainText diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/CellConfig.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/CellConfig.java index e861f4c..26f65ae 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/CellConfig.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/CellConfig.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Common.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Common.java index dbd6bc8..c068334 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Common.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Common.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Configuration.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Configuration.java index acfdbc5..4fb199f 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Configuration.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Configuration.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Data.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Data.java index 7b403bb..6bf5b7c 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Data.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Data.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; @@ -14,19 +29,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; }) @Generated("jsonschema2pojo") public class Data { -@JsonProperty("ric_id") -private String ricId; - @JsonProperty("FAPService") private FAPService fAPService; -@JsonProperty("ric_id") -public String getRicId() { - return ricId; -} -@JsonProperty("ric_id") -public void setRicId(String ricId) { - this.ricId = ricId; -} @JsonProperty("FAPService") public FAPService getFAPService() { return fAPService; @@ -37,6 +41,6 @@ this.fAPService = fAPService; } @Override public String toString() { - return "Data [ricId=" + ricId + ", fAPService=" + fAPService + "]"; + return "Data [fAPService=" + fAPService + "]"; } }
\ No newline at end of file diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/FAPService.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/FAPService.java index e53d50c..78c595d 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/FAPService.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/FAPService.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/LTE.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/LTE.java index 2d0d3d0..97a36f3 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/LTE.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/LTE.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/LTECell.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/LTECell.java index 2bc02bc..2af6b4f 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/LTECell.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/LTECell.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/NeighborListInUse.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/NeighborListInUse.java index bb1c33e..9feae88 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/NeighborListInUse.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/NeighborListInUse.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.List; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Neighbour.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Neighbour.java index e4bf0f6..b1c1cb3 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Neighbour.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Neighbour.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Payload.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Payload.java index c3c7f90..6388617 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Payload.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/Payload.java @@ -1,5 +1,21 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -10,77 +26,66 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ -"action", -"policy_id", -"policy_type_id", -"ric_id", -"policy_data" +"PNFName", +"PLMNID", +"CellID", +"neighbours" }) @Generated("jsonschema2pojo") public class Payload { -@JsonProperty("action") -private String action; -@JsonProperty("policy_id") -private Integer policyId; -@JsonProperty("policy_type_id") -private Integer policyTypeId; -@JsonProperty("ric_id") -private String ricId; -@JsonProperty("policy_data") -private PolicyData policyData; -@JsonIgnore -private Map<String, Object> additionalProperties = new HashMap<String, Object>(); -@JsonProperty("action") -public String getAction() { -return action; -} -@JsonProperty("action") -public void setAction(String action) { -this.action = action; -} -@JsonProperty("policy_id") -public Integer getPolicyId() { -return policyId; -} -@JsonProperty("policy_id") -public void setPolicyId(Integer policyId) { -this.policyId = policyId; -} -@JsonProperty("policy_type_id") -public Integer getPolicyTypeId() { -return policyTypeId; -} -@JsonProperty("policy_type_id") -public void setPolicyTypeId(Integer policyTypeId) { -this.policyTypeId = policyTypeId; -} -@JsonProperty("ric_id") -public String getRicId() { -return ricId; -} -@JsonProperty("ric_id") -public void setRicId(String ricId) { -this.ricId = ricId; -} -@JsonProperty("policy_data") -public PolicyData getPolicyData() { -return policyData; -} -@JsonProperty("policy_data") -public void setPolicyData(PolicyData policyData) { -this.policyData = policyData; -} -@JsonAnyGetter -public Map<String, Object> getAdditionalProperties() { -return this.additionalProperties; -} -@JsonAnySetter -public void setAdditionalProperty(String name, Object value) { -this.additionalProperties.put(name, value); -} -@Override -public String toString() { - return "Payload [action=" + action + ", policyId=" + policyId + ", policyTypeId=" + policyTypeId + ", ricId=" - + ricId + ", policyData=" + policyData + "]"; -} + @JsonProperty("PNFName") + private String pNFName; + @JsonProperty("PLMNID") + private String plmnid; + @JsonProperty("CellID") + private String cellID; + @JsonProperty("neighbours") + private List<Neighbour> neighbours = null; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + @JsonProperty("PNFName") + public String getPNFName() { + return pNFName; + } + @JsonProperty("PNFName") + public void setPNFName(String pNFName) { + this.pNFName = pNFName; + } + @JsonProperty("PLMNID") + public String getPlmnid() { + return plmnid; + } + @JsonProperty("PLMNID") + public void setPlmnid(String plmnid) { + this.plmnid = plmnid; + } + @JsonProperty("CellID") + public String getCellID() { + return cellID; + } + @JsonProperty("CellID") + public void setCellID(String cellID) { + this.cellID = cellID; + } + @JsonProperty("neighbours") + public List<Neighbour> getNeighbours() { + return neighbours; + } + @JsonProperty("neighbours") + public void setNeighbours(List<Neighbour> neighbours) { + this.neighbours = neighbours; + } + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + @Override + public String toString() { + return "Payload [pNFName=" + pNFName + ", plmnid=" + plmnid + ", cellID=" + cellID + ", neighbours=" + neighbours + + "]"; + } }
\ No newline at end of file diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PayloadOutput.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PayloadOutput.java index 0f3d42c..cdd308c 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PayloadOutput.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PayloadOutput.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.List; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PolicyData.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PolicyData.java deleted file mode 100644 index 6f53145..0000000 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PolicyData.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.onap.ranapp.kafka.model.appmodels; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ -"PNFName", -"PLMNID", -"CellID", -"neighbours" -}) -@Generated("jsonschema2pojo") -public class PolicyData { -@JsonProperty("PNFName") -private String pNFName; -@JsonProperty("PLMNID") -private String plmnid; -@JsonProperty("CellID") -private String cellID; -@JsonProperty("neighbours") -private List<Neighbour> neighbours = null; -@JsonIgnore -private Map<String, Object> additionalProperties = new HashMap<String, Object>(); -@JsonProperty("PNFName") -public String getPNFName() { -return pNFName; -} -@JsonProperty("PNFName") -public void setPNFName(String pNFName) { -this.pNFName = pNFName; -} -@JsonProperty("PLMNID") -public String getPlmnid() { -return plmnid; -} -@JsonProperty("PLMNID") -public void setPlmnid(String plmnid) { -this.plmnid = plmnid; -} -@JsonProperty("CellID") -public String getCellID() { -return cellID; -} -@JsonProperty("CellID") -public void setCellID(String cellID) { -this.cellID = cellID; -} -@JsonProperty("neighbours") -public List<Neighbour> getNeighbours() { -return neighbours; -} -@JsonProperty("neighbours") -public void setNeighbours(List<Neighbour> neighbours) { -this.neighbours = neighbours; -} -@JsonAnyGetter -public Map<String, Object> getAdditionalProperties() { -return this.additionalProperties; -} -@JsonAnySetter -public void setAdditionalProperty(String name, Object value) { -this.additionalProperties.put(name, value); -} -@Override -public String toString() { - return "PolicyData [pNFName=" + pNFName + ", plmnid=" + plmnid + ", cellID=" + cellID + ", neighbours=" + neighbours - + "]"; -} -}
\ No newline at end of file diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PolicytypetoTopicMapping.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PolicytypetoTopicMapping.java index c6198d2..5b0ac5a 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PolicytypetoTopicMapping.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/PolicytypetoTopicMapping.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import com.fasterxml.jackson.annotation.JsonProperty; public class PolicytypetoTopicMapping { @@ -25,7 +40,4 @@ public class PolicytypetoTopicMapping { public String toString() { return "PolicytypetoTopicMapping [request_topic=" + request_topic + ", response_topic=" + response_topic + "]"; } - - - } diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/RAN.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/RAN.java index e6d7287..d4af8e8 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/RAN.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/RAN.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 CAPGEMINI ENGINEERING. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onap.ranapp.kafka.model.appmodels; import java.util.HashMap; import java.util.Map; diff --git a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ResponsetoA1.java b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ResponsetoA1.java index 91fa7fe..a9b9203 100644 --- a/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ResponsetoA1.java +++ b/ANR-App/src/main/java/org/onap/ranapp/kafka/model/appmodels/ResponsetoA1.java @@ -7,8 +7,6 @@ public class ResponsetoA1 { } @JsonProperty("response-code") private int response_code; - - @JsonProperty("error-info") private String error_info; @JsonProperty("response-code") |