summaryrefslogtreecommitdiffstats
path: root/PolicyEngineUtils/src
diff options
context:
space:
mode:
authorRavindra Bakkamanthala <rb7147@att.com>2017-05-23 14:56:12 -0400
committerRavindra Bakkamanthala <rb7147@att.com>2017-05-23 16:49:56 -0400
commit87c95be02a8a4d77e165dede90777e811b59dcae (patch)
tree4712199fc3520b530dda0c4d3b074c327df547f2 /PolicyEngineUtils/src
parent7e547eaa55920dfbc9691eab33bb728395b50cf2 (diff)
Commit includes ControlLoopPolicy API and bugfixes
Change-Id: I3e18bb8b4c31a0d908bb0cff4c85e2a3fb450a63 Signed-off-by: Ravindra Bakkamanthala <rb7147@att.com>
Diffstat (limited to 'PolicyEngineUtils/src')
-rw-r--r--PolicyEngineUtils/src/main/java/org/openecomp/policy/std/NotificationStore.java12
-rw-r--r--PolicyEngineUtils/src/main/java/org/openecomp/policy/utils/BackUpMonitor.java4
-rw-r--r--PolicyEngineUtils/src/main/java/org/openecomp/policy/utils/BusPublisher.java2
-rw-r--r--PolicyEngineUtils/src/test/java/org/openecomp/policy/test/PolicyUtilsTest.java6
4 files changed, 12 insertions, 12 deletions
diff --git a/PolicyEngineUtils/src/main/java/org/openecomp/policy/std/NotificationStore.java b/PolicyEngineUtils/src/main/java/org/openecomp/policy/std/NotificationStore.java
index 1c5950c5d..2f3a72946 100644
--- a/PolicyEngineUtils/src/main/java/org/openecomp/policy/std/NotificationStore.java
+++ b/PolicyEngineUtils/src/main/java/org/openecomp/policy/std/NotificationStore.java
@@ -42,10 +42,10 @@ public class NotificationStore {
public static StdPDPNotification getDeltaNotification(StdPDPNotification newNotification){
StdPDPNotification notificationDelta = new StdPDPNotification();
- ArrayList<StdRemovedPolicy> removedDelta = new ArrayList<StdRemovedPolicy>();
- ArrayList<StdLoadedPolicy> updatedDelta = new ArrayList<StdLoadedPolicy>();
- Collection<StdLoadedPolicy> newUpdatedPolicies = new ArrayList<StdLoadedPolicy>();
- Collection<StdRemovedPolicy> newRemovedPolicies = new ArrayList<StdRemovedPolicy>();
+ ArrayList<StdRemovedPolicy> removedDelta = new ArrayList<>();
+ ArrayList<StdLoadedPolicy> updatedDelta = new ArrayList<>();
+ Collection<StdLoadedPolicy> newUpdatedPolicies = new ArrayList<>();
+ Collection<StdRemovedPolicy> newRemovedPolicies = new ArrayList<>();
Collection<LoadedPolicy> oldUpdatedLostPolicies = notificationRecord.getLoadedPolicies();
Collection<RemovedPolicy> oldRemovedPolicies = notificationRecord.getRemovedPolicies();
Collection<LoadedPolicy> oldUpdatedPolicies = notificationRecord.getLoadedPolicies();
@@ -168,14 +168,14 @@ public class NotificationStore {
}else{
// Check if there is anything new and update the record.
if(notificationRecord.getLoadedPolicies()!=null || notificationRecord.getRemovedPolicies()!=null){
- HashSet<StdRemovedPolicy> removedPolicies = new HashSet<StdRemovedPolicy>();
+ HashSet<StdRemovedPolicy> removedPolicies = new HashSet<>();
for(RemovedPolicy rPolicy: notificationRecord.getRemovedPolicies()){
StdRemovedPolicy sRPolicy = new StdRemovedPolicy();
sRPolicy.setPolicyName(rPolicy.getPolicyName());
sRPolicy.setVersionNo(rPolicy.getVersionNo());
removedPolicies.add(sRPolicy);
}
- HashSet<StdLoadedPolicy> updatedPolicies = new HashSet<StdLoadedPolicy>();
+ HashSet<StdLoadedPolicy> updatedPolicies = new HashSet<>();
for(LoadedPolicy uPolicy: notificationRecord.getLoadedPolicies()){
StdLoadedPolicy sUPolicy = new StdLoadedPolicy();
sUPolicy.setMatches(uPolicy.getMatches());
diff --git a/PolicyEngineUtils/src/main/java/org/openecomp/policy/utils/BackUpMonitor.java b/PolicyEngineUtils/src/main/java/org/openecomp/policy/utils/BackUpMonitor.java
index f041d105c..6f9082bc9 100644
--- a/PolicyEngineUtils/src/main/java/org/openecomp/policy/utils/BackUpMonitor.java
+++ b/PolicyEngineUtils/src/main/java/org/openecomp/policy/utils/BackUpMonitor.java
@@ -226,7 +226,7 @@ public class BackUpMonitor {
em.flush();
}else{
// Check for other Master(s)
- ArrayList<BackUpMonitorEntity> masterEntities = new ArrayList<BackUpMonitorEntity>();
+ ArrayList<BackUpMonitorEntity> masterEntities = new ArrayList<>();
// Check for self.
BackUpMonitorEntity selfEntity = null;
// Check backup monitor entities.
@@ -310,7 +310,7 @@ public class BackUpMonitor {
}
}
}
- masterEntities = new ArrayList<BackUpMonitorEntity>();
+ masterEntities = new ArrayList<>();
masterEntities.add(masterEntity);
}
if(masterEntities.size()==1){
diff --git a/PolicyEngineUtils/src/main/java/org/openecomp/policy/utils/BusPublisher.java b/PolicyEngineUtils/src/main/java/org/openecomp/policy/utils/BusPublisher.java
index 9c9e54b47..fe3e4f6eb 100644
--- a/PolicyEngineUtils/src/main/java/org/openecomp/policy/utils/BusPublisher.java
+++ b/PolicyEngineUtils/src/main/java/org/openecomp/policy/utils/BusPublisher.java
@@ -40,7 +40,7 @@ public interface BusPublisher {
String aafLogin,
String aafPassword) {
- ArrayList<String> dmaapServers = new ArrayList<String>();
+ ArrayList<String> dmaapServers = new ArrayList<>();
for (String server: servers) {
dmaapServers.add(server + ":3904");
}
diff --git a/PolicyEngineUtils/src/test/java/org/openecomp/policy/test/PolicyUtilsTest.java b/PolicyEngineUtils/src/test/java/org/openecomp/policy/test/PolicyUtilsTest.java
index c3f8bedb0..7dac55596 100644
--- a/PolicyEngineUtils/src/test/java/org/openecomp/policy/test/PolicyUtilsTest.java
+++ b/PolicyEngineUtils/src/test/java/org/openecomp/policy/test/PolicyUtilsTest.java
@@ -44,8 +44,8 @@ public class PolicyUtilsTest {
PolicyUtils policyUtils = new PolicyUtils();
StdPDPNotification notification = new StdPDPNotification();
notification.setNotificationType(NotificationType.BOTH);
- Collection<StdRemovedPolicy> removedPolicies = new ArrayList<StdRemovedPolicy>();
- Collection<StdLoadedPolicy> loadedPolicies = new ArrayList<StdLoadedPolicy>();
+ Collection<StdRemovedPolicy> removedPolicies = new ArrayList<>();
+ Collection<StdLoadedPolicy> loadedPolicies = new ArrayList<>();
StdRemovedPolicy removedPolicy = new StdRemovedPolicy();
StdLoadedPolicy updatedPolicy = new StdLoadedPolicy();
removedPolicy.setPolicyName("Test");
@@ -54,7 +54,7 @@ public class PolicyUtilsTest {
updatedPolicy.setPolicyName("Testing");
updatedPolicy.setVersionNo("1");
updatedPolicy.setUpdateType(UpdateType.NEW);
- Map<String, String> matches = new HashMap<String, String>();
+ Map<String, String> matches = new HashMap<>();
matches.put("key", "value");
updatedPolicy.setMatches(matches);
loadedPolicies.add(updatedPolicy);