summaryrefslogtreecommitdiffstats
path: root/BRMSGateway
diff options
context:
space:
mode:
authorTarun Tej Velaga <tt3868@att.com>2017-07-24 17:13:43 +0000
committerTarun Tej Velaga <tt3868@att.com>2017-07-25 14:23:59 +0000
commite92ff832cf993db876f22b2d27562fedf59f5043 (patch)
tree47429eeaaf4241905d7ea1f71dbdb5c2d0504618 /BRMSGateway
parent570290dc6ba8198e653022c2f6f8e5d01cfa8d1b (diff)
[Policy-52, Policy-92, Policy-93] Policy Enhancements and bugfixes
Change-Id: I5675cf4527e17963b3142cf7184c0df31a766197 Signed-off-by: Tarun Tej Velaga <tt3868@att.com>
Diffstat (limited to 'BRMSGateway')
-rw-r--r--BRMSGateway/dependency.json2
-rw-r--r--BRMSGateway/src/main/java/org/openecomp/policy/brmsInterface/BRMSPush.java15
2 files changed, 12 insertions, 5 deletions
diff --git a/BRMSGateway/dependency.json b/BRMSGateway/dependency.json
index adf56b7a2..a883cc9da 100644
--- a/BRMSGateway/dependency.json
+++ b/BRMSGateway/dependency.json
@@ -6,7 +6,7 @@
"version": "1.1.0-SNAPSHOT"
}, {
"groupId": "org.onap.policy.drools-applications",
- "artifactId": "controlloop",
+ "artifactId": "events",
"version": "1.1.0-SNAPSHOT"
}, {
"groupId": "org.onap.policy.drools-applications",
diff --git a/BRMSGateway/src/main/java/org/openecomp/policy/brmsInterface/BRMSPush.java b/BRMSGateway/src/main/java/org/openecomp/policy/brmsInterface/BRMSPush.java
index 3254eac7a..def57e2bc 100644
--- a/BRMSGateway/src/main/java/org/openecomp/policy/brmsInterface/BRMSPush.java
+++ b/BRMSGateway/src/main/java/org/openecomp/policy/brmsInterface/BRMSPush.java
@@ -99,7 +99,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
* BRMSPush: Application responsible to push policies to the BRMS PDP Policy Repository (PR).
* Mavenize and push policy to PR
*
- * @version 0.9
+ * @version 1.0
*/
@SuppressWarnings("deprecation")
@@ -589,7 +589,14 @@ public class BRMSPush {
result = artifact;
}
}
- return result;
+ return additionalNexusLatestCheck(selectedName, result);
+ }
+
+ // Additional Check due to Limitations from Nexus API to check if the artifact is the latest.
+ private NexusArtifact additionalNexusLatestCheck(String selectedName, NexusArtifact result) {
+ String nextVersion = incrementVersion(result.getVersion());
+ List<NexusArtifact> artifact = getArtifactFromNexus(selectedName, nextVersion);
+ return artifact.isEmpty()? result: additionalNexusLatestCheck(selectedName, artifact.get(0));
}
private boolean checkRemoteSync(String selectedName, String version) {
@@ -630,7 +637,7 @@ public class BRMSPush {
}
}
}
- return new ArrayList<NexusArtifact>();
+ return new ArrayList<>();
}
private void setVersion(String selectedName) {
@@ -908,7 +915,7 @@ public class BRMSPush {
Dependency controlloopDependency = new Dependency();
controlloopDependency.setGroupId("org.onap.policy.drools-applications");
- controlloopDependency.setArtifactId("controlloop");
+ controlloopDependency.setArtifactId("events");
controlloopDependency.setVersion(version);
dependencyList.add(controlloopDependency);