summaryrefslogtreecommitdiffstats
path: root/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java
diff options
context:
space:
mode:
Diffstat (limited to 'components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java')
-rw-r--r--components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java40
1 files changed, 1 insertions, 39 deletions
diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java
index 67cda89a..c5e3151a 100644
--- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java
+++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java
@@ -51,16 +51,9 @@ public class BandwidthEvaluator {
private Configuration configuration;
@Autowired
- AaiService aaiService;
-
- @Autowired
- CCVPNPmDatastore ccvpnPmDatastore;
-
- @Autowired
StrategyFactory strategyFactory;
private Loop evaluationEventLoop;
- private Loop aaiEventLoop;
private static final Event KILL_PILL = new SimpleEvent(null, 0);
private static final int DEFAULT_EVAL_INTERVAL = 5;
@@ -98,34 +91,6 @@ public class BandwidthEvaluator {
}
};
- /**
- * AAI data consumer loop
- */
- aaiEventLoop = new Loop("AAIEventLoop"){
- @Override
- public void process(Event event) {
- if (event.type() == SimpleEvent.Type.AAI_BW_REQ){
- log.debug("=== Processing new AAI network policy query at: {} ===", event.time());
- String serviceId = (String) event.subject();
- Map<String, Integer> maxBandwidthData = aaiService.fetchMaxBandwidthOfService(serviceId);
- if (maxBandwidthData.get("maxBandwidth") != null){
- log.debug("Successfully retrieved bandwidth info from AAI; service: {}, bandwidth: {}",
- serviceId, maxBandwidthData.get("maxBandwidth"));
- int bwValue = maxBandwidthData.get("maxBandwidth").intValue();
- if (ccvpnPmDatastore.getProvBwOfSvc(serviceId) == 0){
- ccvpnPmDatastore.updateProvBw(serviceId, bwValue, true);
- log.debug("Provision bw of cll {} updated from 0 to {}, max bw is {}", serviceId, ccvpnPmDatastore.getProvBwOfSvc(serviceId), bwValue);
- } else if (ccvpnPmDatastore.getProvBwOfSvc(serviceId) != bwValue) {
- log.debug("Service modification complete; serviceId: {} update prov bw from {} to {}", serviceId, ccvpnPmDatastore.getProvBwOfSvc(serviceId), bwValue);
- ccvpnPmDatastore.updateProvBw(serviceId, bwValue, true);
- ccvpnPmDatastore.updateSvcState(serviceId, ServiceState.RUNNING);
- log.debug("Service state of {} is changed to running, {}", serviceId, ccvpnPmDatastore.getStatusOfSvc(serviceId));
- }
- }
- log.debug("=== Processing AAI network policy query complete ===");
- }
- }
- };
scheduleEvaluation();
}
@@ -135,7 +100,6 @@ public class BandwidthEvaluator {
@PreDestroy
public void stop(){
stopScheduleEvaluation();
- aaiEventLoop.stop();
evaluationEventLoop.stop();
}
@@ -165,9 +129,7 @@ public class BandwidthEvaluator {
public void post(@NonNull Event event){
log.info("A new event triggered, type: {}, subject: {}, at time: {}",
event.type(), event.subject(), event.time());
- if (event.type() == SimpleEvent.Type.AAI_BW_REQ) {
- aaiEventLoop.add(event);
- } else if (event.type() == SimpleEvent.Type.PERIODIC_CHECK) {
+ if (event.type() == SimpleEvent.Type.PERIODIC_CHECK) {
evaluationEventLoop.add(event);
} else if (event.type() == SimpleEvent.Type.ONDEMAND_CHECK) {
evaluationEventLoop.add(event);