aboutsummaryrefslogtreecommitdiffstats
path: root/ECOMP-REST/src
diff options
context:
space:
mode:
authorITSERVICES\rb7147 <rb7147@att.com>2017-05-08 22:20:44 -0400
committerITSERVICES\rb7147 <rb7147@att.com>2017-05-09 13:58:03 -0400
commitdda032f8bb161d54eb1f59de2b4a3efb774fc4d1 (patch)
tree9a11825d59434d97bb0c7dcbf00a0b84e7e5f526 /ECOMP-REST/src
parenta330af579866dacbe595e2e4ad1dd29cd3c96945 (diff)
Policy 1707 Second commit
Change-Id: I18f5b142238733d17280cf17c3d1dd28204d34e9 Signed-off-by: ITSERVICES\rb7147 <rb7147@att.com>
Diffstat (limited to 'ECOMP-REST/src')
-rw-r--r--ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyRestAdapter.java15
-rw-r--r--ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Tags.java7
-rw-r--r--ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/YAMLParams.java67
-rw-r--r--ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTagPicker.java11
-rw-r--r--ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyGroupEntity.java60
-rw-r--r--ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSAttributeObject.java8
-rw-r--r--ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtils.java10
7 files changed, 169 insertions, 9 deletions
diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyRestAdapter.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyRestAdapter.java
index c823ec6ab..2cfacab85 100644
--- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyRestAdapter.java
+++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/PolicyRestAdapter.java
@@ -31,6 +31,14 @@ import org.openecomp.policy.rest.jpa.EcompName;
public class PolicyRestAdapter {
+ /*
+ *
+ * Note : Make Sure if any variables are added in PolicyRestAdapter.java, add them to PolicyElasticData.java file
+ *
+ *
+ * */
+
+
//Common
private Object data;
private String policyName = null;
@@ -117,6 +125,7 @@ public class PolicyRestAdapter {
private String actionDictType = null;
private String actionDictUrl = null;
private String actionDictMethod = null;
+ private YAMLParams yamlparams;
//MicroSerice
private String serviceType = null;
@@ -824,4 +833,10 @@ public class PolicyRestAdapter {
public void setExistingCLName(String existingCLName) {
this.existingCLName = existingCLName;
}
+ public YAMLParams getYamlparams() {
+ return yamlparams;
+ }
+ public void setYamlparams(YAMLParams yamlparams) {
+ this.yamlparams = yamlparams;
+ }
}
diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Tags.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Tags.java
index 8fec46482..43bff884c 100644
--- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Tags.java
+++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/Tags.java
@@ -28,6 +28,7 @@ public class Tags {
String ruleName;
List<TagDefines> tags;
String tagPickerName;
+ String networkRole;
public String getRuleName() {
return ruleName;
@@ -48,5 +49,11 @@ public class Tags {
public void setTagPickerName(String tagPickerName) {
this.tagPickerName = tagPickerName;
}
+ public String getNetworkRole() {
+ return networkRole;
+ }
+ public void setNetworkRole(String networkRole) {
+ this.networkRole = networkRole;
+ }
}
diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/YAMLParams.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/YAMLParams.java
new file mode 100644
index 000000000..adcce2633
--- /dev/null
+++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/YAMLParams.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.policy.rest.adapter;
+
+public class YAMLParams {
+ private String actor;
+ private String recipe;
+ private String limit;
+ private String timeWindow;
+ private String guardActiveStart;
+ private String guardActiveEnd;
+
+ public String getActor() {
+ return actor;
+ }
+ public void setActor(String actor) {
+ this.actor = actor;
+ }
+ public String getRecipe() {
+ return recipe;
+ }
+ public void setRecipe(String recipe) {
+ this.recipe = recipe;
+ }
+ public String getLimit() {
+ return limit;
+ }
+ public void setLimit(String limit) {
+ this.limit = limit;
+ }
+ public String getTimeWindow() {
+ return timeWindow;
+ }
+ public void setTimeWindow(String timeWindow) {
+ this.timeWindow = timeWindow;
+ }
+ public String getGuardActiveStart() {
+ return guardActiveStart;
+ }
+ public void setGuardActiveStart(String guardActiveStart) {
+ this.guardActiveStart = guardActiveStart;
+ }
+ public String getGuardActiveEnd() {
+ return guardActiveEnd;
+ }
+ public void setGuardActiveEnd(String guardActiveEnd) {
+ this.guardActiveEnd = guardActiveEnd;
+ }
+}
diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTagPicker.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTagPicker.java
index 129ad37df..032f77f3c 100644
--- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTagPicker.java
+++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/FWTagPicker.java
@@ -59,6 +59,9 @@ public class FWTagPicker implements Serializable {
@Column(name="description", nullable=true, length=2048)
private String description;
+
+ @Column(name="networkRole", nullable=true)
+ private String networkRole;
@Column(name="tags", nullable=true)
@OrderBy("asc")
@@ -135,6 +138,14 @@ public class FWTagPicker implements Serializable {
this.description = description;
}
+ public String getNetworkRole() {
+ return networkRole;
+ }
+
+ public void setNetworkRole(String networkRole) {
+ this.networkRole = networkRole;
+ }
+
public String getTagValues() {
return tagValues;
}
diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyGroupEntity.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyGroupEntity.java
new file mode 100644
index 000000000..85c42ee48
--- /dev/null
+++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/jpa/PolicyGroupEntity.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP-REST
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.policy.rest.jpa;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="PolicyGroupEntity")
+@NamedQuery(name="PolicyGroupEntity.findAll", query="SELECT p FROM PolicyGroupEntity p ")
+public class PolicyGroupEntity implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name="groupKey")
+ private int groupKey;
+
+ @Id
+ @Column(name="policyid")
+ private int policyid;
+
+ public int getGroupKey() {
+ return groupKey;
+ }
+
+ public void setGroupKey(int groupKey) {
+ this.groupKey = groupKey;
+ }
+
+ public int getPolicyid() {
+ return policyid;
+ }
+
+ public void setPolicyid(int policyid) {
+ this.policyid = policyid;
+ }
+}
diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSAttributeObject.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSAttributeObject.java
index c912374ef..a04f77e7e 100644
--- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSAttributeObject.java
+++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSAttributeObject.java
@@ -28,7 +28,7 @@ public class MSAttributeObject {
private String className;
private HashMap<String, String> attribute = new HashMap<String, String>();
private HashMap<String, String> refAttribute = new HashMap<String, String>();
- private HashMap<String, String> subClass = new HashMap<String, String>();
+ private HashMap<String, Object> subClass = new HashMap<String, Object>();
private String dependency;
private HashMap<String, String> enumType = new HashMap<String, String>();
private HashMap<String, String> matchingSet = new HashMap<String, String>();
@@ -70,13 +70,13 @@ public class MSAttributeObject {
public void addAllRefAttribute(Map<String, String> map){
this.refAttribute.putAll(map);
}
- public HashMap<String, String> getSubClass() {
+ public HashMap<String, Object> getSubClass() {
return subClass;
}
- public void setSubClass(HashMap<String, String> subClass) {
+ public void setSubClass(HashMap<String, Object> subClass) {
this.subClass = subClass;
}
- public void addAllSubClass(HashMap<String, String> subClass){
+ public void addAllSubClass(HashMap<String, Object> subClass){
this.subClass.putAll(subClass);
}
public String getDependency() {
diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtils.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtils.java
index 7276a19f8..057d8544e 100644
--- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtils.java
+++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/MSModelUtils.java
@@ -217,7 +217,7 @@ public class MSModelUtils {
String extendClass = getSubTypes(root, className);
HashMap<String, String> returnRefList = getRefAttributeList(root, className, extendClass);
HashMap<String, String> returnAttributeList = getAttributeList(root, className, extendClass);
- HashMap<String, String> returnSubList = getSubAttributeList(root, className, extendClass);
+ HashMap<String, Object> returnSubList = getSubAttributeList(root, className, extendClass);
HashMap<String, String> returnAnnotation = getAnnotation(root, className, extendClass);
msAttributeObject.setAttribute(returnAttributeList);
msAttributeObject.setRefAttribute(returnRefList);
@@ -285,10 +285,10 @@ public class MSModelUtils {
return annotationSet;
}
- private HashMap<String, String> getSubAttributeList(EPackage root, String className , String superClass) {
+ private HashMap<String, Object> getSubAttributeList(EPackage root, String className , String superClass) {
TreeIterator<EObject> treeItr = root.eAllContents();
boolean requiredAttribute = false;
- HashMap<String, String> subAttribute = new HashMap<String, String>();
+ HashMap<String, Object> subAttribute = new HashMap<String, Object>();
int rollingCount = 0;
int processClass = 0;
boolean annotation = false;
@@ -622,7 +622,7 @@ public class MSModelUtils {
}
- public String createJson(HashMap<String, String> subClassAttributes, HashMap<String, MSAttributeObject> classMap, String className) {
+ public String createJson(HashMap<String, Object> subClassAttributes, HashMap<String, MSAttributeObject> classMap, String className) {
boolean enumType;
Map<String, HashMap<String, String>> myObject = new HashMap<String, HashMap<String, String>>();
for ( Entry<String, String> map : classMap.get(className).getRefAttribute().entrySet()){
@@ -660,7 +660,7 @@ public class MSModelUtils {
public String createSubAttributes(ArrayList<String> dependency, HashMap<String, MSAttributeObject> classMap, String modelName) {
- HashMap <String, String> workingMap = new HashMap<String,String>();
+ HashMap <String, Object> workingMap = new HashMap<String,Object>();
MSAttributeObject tempObject = new MSAttributeObject();
if (dependency!=null){
if (dependency.size()==0){