aboutsummaryrefslogtreecommitdiffstats
path: root/PolicyEngineAPI/src/main/java/org/openecomp/policy/api
diff options
context:
space:
mode:
Diffstat (limited to 'PolicyEngineAPI/src/main/java/org/openecomp/policy/api')
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/AttributeType.java66
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/ConfigRequestParameters.java148
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DecisionRequestParameters.java104
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DecisionResponse.java43
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DeletePolicyCondition.java53
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DeletePolicyParameters.java101
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DictionaryParameters.java83
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DictionaryType.java73
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/EventRequestParameters.java89
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/ImportParameters.java194
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/NotificationScheme.java61
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyChangeResponse.java44
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyClass.java56
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfig.java123
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigException.java49
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigStatus.java68
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigType.java73
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyDecision.java57
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyDecisionException.java50
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEngine.java575
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEngineException.java49
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEventException.java49
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyParameters.java497
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyResponse.java77
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyResponseStatus.java73
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyType.java61
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PushPolicyParameters.java131
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/RuleProvider.java53
-rw-r--r--PolicyEngineAPI/src/main/java/org/openecomp/policy/api/package-info.java36
29 files changed, 3136 insertions, 0 deletions
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/AttributeType.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/AttributeType.java
new file mode 100644
index 000000000..2a887919b
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/AttributeType.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Enumeration of the Attribute Types that is used as a part of
+ * {@link org.openecomp.policy.api.PolicyParameters}.
+ *
+ * @version 0.1
+ */
+public enum AttributeType {
+ /**
+ * Indicates Attributes required to Match the Policy.
+ */
+ MATCHING("matching"),
+ /**
+ * Indicates Attributes required to create DRL based Rules.
+ */
+ RULE("rule"),
+ /**
+ * Indicates Attributes required to create MicroService policy.
+ */
+ MICROSERVICE("microService"),
+ /**
+ * Indicates Attributes required to create settings for Decision Policy.
+ */
+ SETTINGS("settings"),
+ /**
+ * Indicates Attributes required to create dictionary fields for creating Dictionary Items
+ */
+ DICTIONARY("dictionary")
+ ;
+
+
+ private String name;
+
+ private AttributeType(String typeName){
+ this.name = typeName;
+ }
+
+ /**
+ * Returns the <code>String</code> format of Type for this <code>AttributeType</code>
+ * @return the <code>String</code> of the Type for this <code>AttributeType</code>
+ */
+ public String toString() {
+ return this.name;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/ConfigRequestParameters.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/ConfigRequestParameters.java
new file mode 100644
index 000000000..1830679e0
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/ConfigRequestParameters.java
@@ -0,0 +1,148 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * <code>ConfigRequestParameters</code> defines the Config Policy Request Parameters
+ * which retrieve(s) the policy from PDP if the request parameters match with any Config Policy.
+ *
+ * @version 0.1
+ */
+public class ConfigRequestParameters {
+ private String policyName;
+ private String eCOMPComponentName;
+ private String configName;
+ private Map<String,String> configAttributes;
+ private UUID requestID;
+ private Boolean unique = false;
+
+ /**
+ * Sets the PolicyName of the Config policy which needs to be retrieved.
+ *
+ * @param policyName the <code>String</code> format of the PolicyFile Name whose configuration is required.
+ */
+ public void setPolicyName(String policyName){
+ this.policyName = policyName;
+ }
+
+ /**
+ * Sets the ECOMP Component Name of the Config policy which needs to be retrieved.
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
+ */
+ public void setEcompName(String eCOMPComponentName){
+ this.eCOMPComponentName = eCOMPComponentName;
+ }
+
+ /**
+ * Sets the Config Name of the Config policy which needs to be retrieved.
+ *
+ * @param configName the <code>String</code> format of the configurationName whose configuration is required.
+ */
+ public void setConfigName(String configName){
+ this.configName = configName;
+ }
+
+ /**
+ * Sets the ConfigAttributes of the Config policy which needs to be retrieved.
+ *
+ * @param configAttributes the <code>Map</code> of <code>String,String</code> format of the configuration attributes which are required.
+ */
+ public void setConfigAttributes(Map<String, String> configAttributes){
+ this.configAttributes = configAttributes;
+ }
+
+ /**
+ * Sets the Request ID of the ECOMP request.
+ *
+ * @param requestID unique <code>UUID</code> requestID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public void setRequestID(UUID requestID){
+ this.requestID = requestID;
+ }
+
+ /**
+ * Gets the policyName of the Request Parameters.
+ *
+ * @return <code>String</code> format of the policyName.
+ */
+ public String getPolicyName(){
+ return policyName;
+ }
+
+ /**
+ * Gets the ECOMP Component Name of the Request Parameters.
+ *
+ * @return <code>String</code> format of the ECOMP Component Name.
+ */
+ public String getEcompName(){
+ return eCOMPComponentName;
+ }
+
+ /**
+ * Gets the Config name of the Request Parameters.
+ *
+ * @return <code>String</code> format of the Config Name.
+ */
+ public String getConfigName(){
+ return configName;
+ }
+
+ /**
+ * Gets the Config Attributes of the Request Parameters.
+ *
+ * @return <code>Map</code> of <code>String</code>,<code>String</code> format of the config Attributes.
+ */
+ public Map<String,String> getConfigAttributes(){
+ return configAttributes;
+ }
+
+ /**
+ * Gets the Request ID of the Request Paramters.
+ *
+ * @return <code>UUID</code> format of requestID.
+ */
+ public UUID getRequestID(){
+ return requestID;
+ }
+
+ /**
+ * Makes the results Unique, priority based. If set to True. Default Value is set to False.
+ *
+ * @param unique flag which is either true or false.
+ */
+ public void makeUnique(Boolean unique){
+ this.unique = unique;
+ }
+
+ /**
+ * Gets the Unique flag value from the Config Request Parameters.
+ *
+ * @return unique flag which is either true or false.
+ */
+ public Boolean getUnique(){
+ return this.unique;
+ }
+
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DecisionRequestParameters.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DecisionRequestParameters.java
new file mode 100644
index 000000000..dc485f7b3
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DecisionRequestParameters.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * <code>DecisionRequestParameters</code> defines the Decision Policy Request Parameters
+ * which retrieve(s) the response from PDP if the request parameters match with any Decision Policy.
+ *
+ * @version 0.1
+ */
+public class DecisionRequestParameters {
+ private String eCOMPComponentName;
+ private Map<String,String> decisionAttributes;
+ private UUID requestID;
+
+ /**
+ * Constructor with no Parameters
+ */
+ public DecisionRequestParameters(){
+ }
+
+ /**
+ * Constructor with Parameters
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose Decision is required.
+ * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that contain the ID and values.
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public DecisionRequestParameters(String eCOMPComponentName, Map<String,String> decisionAttributes, UUID requestID){
+ this.eCOMPComponentName = eCOMPComponentName;
+ this.decisionAttributes = decisionAttributes;
+ this.requestID = requestID;
+ }
+
+ /**
+ * Gets the ECOMPComponentName of the Decision Request Parameters.
+ *
+ * @return ECOMPComponentName the <code>String</code> format of the eCOMPComponentName of the Decision Request Parameters.
+ */
+ public String getECOMPComponentName() {
+ return eCOMPComponentName;
+ }
+ /**
+ * Sets the ECOMPComponentName of the Decision Request parameters.
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose Decision is required.
+ */
+ public void setECOMPComponentName(String eCOMPComponentName) {
+ this.eCOMPComponentName = eCOMPComponentName;
+ }
+ /**
+ * Gets the Decision Attributes from Decision Request Parameters.
+ *
+ * @return decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that contain the ID and values.
+ */
+ public Map<String,String> getDecisionAttributes() {
+ return decisionAttributes;
+ }
+ /**
+ * Sets the Decision Attributes which contain ID and values for obtaining Decision from PDP.
+ *
+ * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that must contain the ID and values.
+ */
+ public void setDecisionAttributes(Map<String,String> decisionAttributes) {
+ this.decisionAttributes = decisionAttributes;
+ }
+ /**
+ * Gets the request ID of Decision Request Parameters.
+ *
+ * @return the requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+ /**
+ * Sets the ReqestID of Decision Request Parameters which will be passed around ECOMP requests.
+ *
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DecisionResponse.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DecisionResponse.java
new file mode 100644
index 000000000..caa9fda74
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DecisionResponse.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Defines the Object that represents the Policy Decision Response elements.
+ * DecisionResponse communicates the decision and details
+ *
+ * @version 0.1
+ */
+public interface DecisionResponse {
+ /**
+ * Gets the Decision of the Policy, Either a Permit or Deny.
+ *
+ * @return {@link org.openecomp.policy.api.PolicyDecision} Enumeration.
+ */
+ public PolicyDecision getDecision();
+
+ /**
+ * Gets the details of the result. Would be required in case of Deny.
+ *
+ * @return <code>String</code> format of the details of Deny cause.
+ */
+ public String getDetails();
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DeletePolicyCondition.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DeletePolicyCondition.java
new file mode 100644
index 000000000..3440c99aa
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DeletePolicyCondition.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Enumeration of the Policy Delete Condition that is used as a part of
+ * {@link org.openecomp.policy.api.DeletePolicyParameters}.
+ *
+ * @version 0.1
+ */
+public enum DeletePolicyCondition {
+
+ /**
+ * Indicates a condition to only delete the current version of the policy.
+ */
+ ONE("Current Version"),
+
+ /**
+ * Indicates a condition to delete all versions of the policy.
+ */
+ ALL("All Versions");
+ private String name;
+
+ private DeletePolicyCondition(String name){
+ this.name = name;
+ }
+
+ /**
+ * Returns the <code>String</code> format of delete condition for this Policy
+ * @return the <code>String</code> of the delete condition for this Policy
+ */
+ public String toString(){
+ return this.name;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DeletePolicyParameters.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DeletePolicyParameters.java
new file mode 100644
index 000000000..3999c5e22
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DeletePolicyParameters.java
@@ -0,0 +1,101 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.UUID;
+
+/**
+ * <code>PushPolicyParameters</code> defines the Policy Parameters
+ * which are required to Push a Policy to PDPGroup.
+ *
+ * @version 0.1
+ */
+public class DeletePolicyParameters {
+
+ private String policyName;
+ private String policyComponent;
+ private DeletePolicyCondition deleteCondition;
+ private String pdpGroup;
+ private UUID requestID;
+
+
+ /**
+ * @return the policyName
+ */
+ public String getPolicyName() {
+ return policyName;
+ }
+ /**
+ * @param policyName the policyName to set
+ */
+ public void setPolicyName(String policyName) {
+ this.policyName = policyName;
+ }
+ /**
+ * @return the policyComponent
+ */
+ public String getPolicyComponent() {
+ return policyComponent;
+ }
+ /**
+ * @param policyComponent the policyComponent to set
+ */
+ public void setPolicyComponent(String policyComponent) {
+ this.policyComponent = policyComponent;
+ }
+ /**
+ * @return the deleteCondition
+ */
+ public DeletePolicyCondition getDeleteCondition() {
+ return deleteCondition;
+ }
+ /**
+ * @param deleteCondition the deleteCondition to set
+ */
+ public void setDeleteCondition(DeletePolicyCondition deleteCondition) {
+ this.deleteCondition = deleteCondition;
+ }
+ /**
+ * @return the requestID
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+ /**
+ * @param requestID the requestID to set
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+ /**
+ * @return the pdpGroup
+ */
+ public String getPdpGroup() {
+ return pdpGroup;
+ }
+ /**
+ * @param pdpGroup the pdpGroup to set
+ */
+ public void setPdpGroup(String pdpGroup) {
+ this.pdpGroup = pdpGroup;
+ }
+
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DictionaryParameters.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DictionaryParameters.java
new file mode 100644
index 000000000..1506effd7
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DictionaryParameters.java
@@ -0,0 +1,83 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.Map;
+import java.util.UUID;
+
+public class DictionaryParameters {
+
+ private DictionaryType dictionaryType;
+ private String dictionary;
+ private Map<AttributeType, Map<String,String>> dictionaryFields;
+ private UUID requestID;
+
+
+ /**
+ * @return the dictionaryType
+ */
+ public DictionaryType getDictionaryType() {
+ return dictionaryType;
+ }
+ /**
+ * @param dictionaryType the dictionaryType to set
+ */
+ public void setDictionaryType(DictionaryType dictionaryType) {
+ this.dictionaryType = dictionaryType;
+ }
+ /**
+ * @return the dictionary
+ */
+ public String getDictionary() {
+ return dictionary;
+ }
+ /**
+ * @param dictionary the dictionary to set
+ */
+ public void setDictionary(String dictionary) {
+ this.dictionary = dictionary;
+ }
+ /**
+ * @return the dictionaryFields
+ */
+ public Map<AttributeType, Map<String,String>> getDictionaryFields() {
+ return dictionaryFields;
+ }
+ /**
+ * @param dictionaryFields the dictionaryFields to set
+ */
+ public void setDictionaryFields(Map<AttributeType, Map<String,String>> dictionaryFields) {
+ this.dictionaryFields = dictionaryFields;
+ }
+ /**
+ * @return the requestID
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+ /**
+ * @param requestID the requestID to set
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DictionaryType.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DictionaryType.java
new file mode 100644
index 000000000..0935f64b9
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/DictionaryType.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+public enum DictionaryType {
+ /**
+ * Indicates Common Dictionaries.
+ */
+ Common("Common"),
+ /**
+ * Indicates ClosedLoop Policy Dictionaries.
+ */
+ ClosedLoop("ClosedLoop"),
+ /**
+ * Indicates Firewall Config Policy Dictionaries.
+ */
+ Firewall("FW"),
+ /**
+ * Indicates Decision Policy Dictionaries.
+ */
+ Decision("Decision"),
+ /**
+ * Indicates BRMS Policy Dictionaries.
+ */
+ BRMS("BRMS"),
+ /**
+ * Indicates DCAE Micro Service Policy Dictionaries.
+ */
+ MicroService("MS"),
+ /**
+ * Indicates Descriptive Scope Dictionaries
+ */
+ DescriptiveScope("DescriptiveScope"),
+ /**
+ * Indicates Policy Scope Dictionaries
+ */
+ PolicyScope("PolicyScope"),
+ ;
+
+ private String name;
+
+ private DictionaryType(String typeName){
+ this.name = typeName;
+ }
+
+ /**
+ * Returns the <code>String</code> format of Type for this <code>PolicyClass</code>
+ * @return the <code>String</code> of the Type for this <code>PolicyClass</code>
+ */
+ public String toString() {
+ return this.name;
+ }
+
+
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/EventRequestParameters.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/EventRequestParameters.java
new file mode 100644
index 000000000..155d9c6a5
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/EventRequestParameters.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * <code>EventRequestParameters</code> defines the Event Policy Request Parameters
+ * which retrieve(s) the response from PDP if the request parameters match with any Action Policy.
+ *
+ * @version 0.1
+ */
+public class EventRequestParameters {
+ private Map<String,String> eventAttributes;
+ private UUID requestID;
+
+ /**
+ * Constructor with no Parameters
+ */
+ public EventRequestParameters(){
+ }
+
+ /**
+ * Constructor with Parameters
+ *
+ * @param eventAttributes the <code>Map</code> of <code>String,String</code> format of the eventAttributes that contains the event ID and values.
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public EventRequestParameters(Map<String,String> eventAttributes, UUID requestID){
+ this.eventAttributes = eventAttributes;
+ this.requestID = requestID;
+ }
+
+ /**
+ * Gets the eventAttributes of Event Request Parameters.
+ *
+ * @return eventAttributes the <code>Map</code> of <code>String,String</code> format of the eventAttributes that contains the event ID and values.
+ */
+ public Map<String,String> getEventAttributes() {
+ return eventAttributes;
+ }
+
+ /**
+ * Sets the eventAttributes that contain the eventID and values to the Event Request Parameters.
+ *
+ * @param eventAttributes the <code>Map</code> of <code>String,String</code> format of the eventAttributes that must contain the event ID and values.
+ */
+ public void setEventAttributes(Map<String,String> eventAttributes) {
+ this.eventAttributes = eventAttributes;
+ }
+
+ /**
+ * Gets the ReqestID of Event Request Parameters which will be passed around ECOMP requests.
+ *
+ * @return requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+
+ /**
+ * Sets the ReqestID of Event Request Parameters which will be passed around ECOMP requests.
+ *
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/ImportParameters.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/ImportParameters.java
new file mode 100644
index 000000000..299f29a93
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/ImportParameters.java
@@ -0,0 +1,194 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.List;
+import java.util.UUID;
+
+
+/**
+ * <code>ImportParameters</code> defines the Policy Engine Import Parameters
+ * which are required to import a new Policy Service or Value.
+ *
+ * @version 0.1
+ */
+public class ImportParameters {
+ private String serviceName;
+ private String description;
+ private UUID requestID;
+ private String filePath;
+ private String importBody;
+ private String version;
+ private IMPORT_TYPE importType;
+
+ public enum IMPORT_TYPE {
+ MICROSERVICE
+ }
+
+ /**
+ * Sets Import Policy Parameters.
+ *
+ * @param serviceName the <code>String</code> format of the Service Name
+ * @param description the <code>String</code> format of the i Description
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * @param filePath the <code>List</code> format of the file paths for the service files
+ * @param importType the {@link IMPORT_TYPE} format of the Policy Service List
+ * @param version the <code>String</code> format of the Policy Import Version
+ * A different request ID should be passed for each request.
+ */
+ public void setImportParameters(String serviceName, String description, UUID requestID, String filePath, IMPORT_TYPE importType, String version){
+
+ this.setServiceName(serviceName);
+ this.setDescription(description);
+ this.setRequestID(requestID);
+ this.setFilePath(filePath);
+ this.setServiceType(importType);
+ this.setVersion(version);
+
+ }
+
+ /**
+ * Gets the Policy Service of the Policy Service Import Parameters.
+ *
+ * @return serviceName the <code>String</code> format of the Policy Service Name
+ */
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ /**
+ * Sets the serviceName of the Policy Service Parameters.
+ *
+ * @param serviceName the <code>String</code> format of the Policy Service Name
+ */
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
+ /**
+ * Gets the Policy Import Description.
+ *
+ * @return description the <code>String</code> format of the Policy Import Description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the Description of the new Policy Import Description.
+ *
+ * @param description the <code>String</code> format of the Policy Import Description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Gets the requestID of the Policy Parameters.
+ *
+ * @return unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+
+ /**
+ * Sets the requestID of the Policy Parameters.
+ *
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+
+ /**
+ * Gets the importBody of the new policy import.
+ *
+ * @return importBody the <code>String</code> format of the Policy Import Body
+ */
+ public String getImportBody() {
+ return importBody;
+ }
+
+ /**
+ * Sets the importBody of the Policy Import Body.
+ *
+ * @param importBody the <code>String</code> format of the Policy Import Body
+ */
+ public void setImportBody(String importBody) {
+ this.importBody = importBody;
+ }
+
+ /**
+ * Gets the List of File Paths of the new import.
+ *
+ * @return filePath the <code>List</code> format of the Policy Import File
+ */
+ public String getFilePath() {
+ return filePath;
+ }
+
+ /**
+ * Sets the policy Import File List of the new Policy Import.
+ *
+ * @param filePath the <code>List</code> format of the Policy Import File
+ */
+ public void setFilePath(String filePath) {
+ this.filePath = filePath;
+ }
+
+ /**
+ * Gets the Service Type of the new policy import.
+ *
+ * @return ImportType {@link IMPORT_TYPE} format of the Policy Service List
+ */
+ public IMPORT_TYPE getServiceType() {
+ return importType;
+ }
+
+ /**
+ * Sets the policy Service Type of the new Policy Service.
+ *
+ * @param enumImportType the <code>enumServiceType</code> format of the Policy Service List
+ */
+ public void setServiceType(IMPORT_TYPE enumImportType) {
+ this.importType = enumImportType;
+ }
+
+ /**
+ *
+ * Gets the Import Version of the new policy import.
+ *
+ * @return version the <code>String</code> format of the Policy Import Version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Sets the policy Import Version of the new Policy Import.
+ *
+ * @param version the <code>String</code> format of the Policy Import Version
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/NotificationScheme.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/NotificationScheme.java
new file mode 100644
index 000000000..2e88d9c38
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/NotificationScheme.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Enumeration of <code>NotificationScheme</code> describes the Notification Scheme that will be used by the PolicyEngine.
+ *
+ * @version 0.1
+ */
+public enum NotificationScheme {
+ /**
+ * Notifications for policyUpdates on policy Configs already retrieved
+ */
+ AUTO_NOTIFICATIONS("auto_notifications"),
+ /**
+ * Subscribing to all notifications from the PDP
+ */
+ AUTO_ALL_NOTIFICATIONS("auto_all_notifications"),
+ /**
+ * Client can poll for updates that receive policyUpdates on policy Configs that have already been retrieved
+ */
+ MANUAL_NOTIFICATIONS("manual_notifications"),
+ /**
+ * Client can poll for updates that receive all notifications from the PDP
+ */
+ MANUAL_ALL_NOTIFICATIONS("manual_all_notifications")
+ ;
+
+ private String name;
+ private NotificationScheme(String name){
+ this.name = name;
+ }
+
+ /**
+ * Returns the <code>String</code> name for this <code>NotificationScheme</code>
+ *
+ * @return the <code>String</code> name for this <code>NotificationScheme</code>
+ */
+ @Override
+ public String toString(){
+ return this.name;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyChangeResponse.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyChangeResponse.java
new file mode 100644
index 000000000..98bfdc2e3
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyChangeResponse.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * <code>PolicyChangeResponse</code> defines the Policy Response
+ * which is Contains responseCode corresponding to HTTP response Codes with response Message.
+ *
+ * @version 0.1
+ */
+public interface PolicyChangeResponse {
+
+ /**
+ * Policy Change Response Message in <code>String</code> format from the Policy Engine.
+ *
+ * @return the responseMessage in <code>String</code> format related to Response from Policy Engine.
+ */
+ public String getResponseMessage();
+
+ /**
+ * Response code of type <code>Integer</code> which corresponds to the HTTP Response code explaining the response from Policy Engine.
+ *
+ * @return the responseCode in <code>Integer</code> format corresponding to the HTTP response code from Policy Engine.
+ */
+ public int getResponseCode();
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyClass.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyClass.java
new file mode 100644
index 000000000..caf3c11f1
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyClass.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Enumeration of the Policy Types that is used as a part of
+ * {@link org.openecomp.policy.api.PolicyParameters}.
+ *
+ * @version 0.1
+ */
+public enum PolicyClass {
+ /**
+ * Indicates Config based Policy.
+ */
+ Config("Config"),
+ /**
+ * Indicates Action based Policy.
+ */
+ Action("Action"),
+ /**
+ * Indicates Decision based Policy.
+ */
+ Decision("Decision")
+ ;
+ private String name;
+
+ private PolicyClass(String typeName){
+ this.name = typeName;
+ }
+
+ /**
+ * Returns the <code>String</code> format of Type for this <code>PolicyClass</code>
+ * @return the <code>String</code> of the Type for this <code>PolicyClass</code>
+ */
+ public String toString() {
+ return this.name;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfig.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfig.java
new file mode 100644
index 000000000..5cb7d8176
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfig.java
@@ -0,0 +1,123 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.Map;
+import java.util.Properties;
+
+import javax.json.JsonObject;
+
+import org.w3c.dom.Document;
+/**
+ * Defines the objects that represent PolicyEngine config elements. PolicyConfig communicates the PolicyConfigStatus,
+ * PolicyConfigMessage, PolicyType, Properties, JsonObject, String and Document.
+ *
+ * @version 0.7
+ */
+
+public interface PolicyConfig {
+ /**
+ * Gets the {@link org.openecomp.policy.api.PolicyType} associated with <code>PolicyConfig</code>
+ *
+ * @return the <code>PolicyType</code> associated with this <code>PolicyConfig</code>
+ */
+ public PolicyType getType();
+
+ /**
+ * Gives the <code>Properties</code> response associated with the <code>PolicyConfig</code>
+ *
+ * @return the <code>Properties</code> associated with this <code>PolicyConfig</code>
+ */
+ public Properties toProperties();
+
+ /**
+ * Gives the <code>JsonObject</code> response associated with the <code>PolicyConfig</code>
+ *
+ * @return the <code>JsonObject</code> result associated with <code>PolicyConfig</code>
+ */
+ public JsonObject toJSON();
+
+ /**
+ * Gives the XML <code>Document</code> result associated with <code>PolicyConfig</code>
+ *
+ * @return the <code>Document</code> result associated with <code>PolicyConfig</code>
+ */
+ public Document toXML();
+
+ /**
+ * Gives the Other <code>String</code> response associated with <code>PolicyConfig</code>
+ *
+ * @return the <code>String</code> result associated with <code>PolicyConfig</code>
+ */
+ public String toOther();
+
+ /**
+ * Gets the {@link org.openecomp.policy.api.PolicyConfigStatus} associated with this <code>PolicyConfig</code>.
+ *
+ * @return the <code>PolicyConfigStatus</code> associated with this <code>PolicyConfig</code>
+ */
+ public PolicyConfigStatus getPolicyConfigStatus();
+
+ /**
+ * Gets the <code>String</code> of the PolicyConfigMessage from <code>PolicyConfig</code>.
+ *
+ * @return the <code>String</code> which consists of PolicyConfigMessage from <code>PolicyConfig</code>
+ */
+ public String getPolicyConfigMessage();
+
+ /**
+ * Gets the <code>String</code> of the PolicyName retrieved.
+ *
+ * @return the <code>String</code> which consists of Policy Name which has been retrieved.
+ */
+ public String getPolicyName();
+
+
+ /**
+ * Gets the <code>String</code> of the PolicyVersion retrieved.
+ *
+ * @return the <code>String</code> which consists of the Policy Version number which has been retrieved.
+ */
+ public String getPolicyVersion();
+
+ /**
+ * Gets the Matching Conditions of the policy retrieved which can be used in the getConfig call.
+ *
+ * @return <code>Map</code> of <code>String, String</code> which consists of the Matching conditions of the Policy retrieved.
+ */
+ public Map<String,String> getMatchingConditions();
+
+ /**
+ * Gets the Response Attributes of the policy retrieved. Which can hold additional information about the policy retrieved.
+ *
+ * @return <code>Map</code> of <code>String, String</code> which consists of the Response Attributes of the Policy retrieved.
+ */
+ public Map<String,String> getResponseAttributes();
+
+ /**
+ * Returns the <code>String</code> version of the <code>PolicyConfig</code> object.
+ *
+ * @return <code>String</code> of the <code>PolicyConfig</code> Object.
+ */
+ @Override
+ public String toString();
+
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigException.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigException.java
new file mode 100644
index 000000000..ad6948e77
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigException.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * PolicyConfigException extends <code>Exception</code> to implement exceptions thrown by {@link org.openecomp.policy.api.PolicyEngine}
+ *
+ * @version 0.1
+ */
+public class PolicyConfigException extends Exception{
+ private static final long serialVersionUID = -188355220060684215L;
+
+ public PolicyConfigException() {
+ }
+
+ public PolicyConfigException(String message) {
+ super(message);
+ }
+
+ public PolicyConfigException(Throwable cause){
+ super(cause);
+ }
+
+ public PolicyConfigException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public PolicyConfigException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigStatus.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigStatus.java
new file mode 100644
index 000000000..9f45b652b
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigStatus.java
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Enumeration of PolicyConfigStatus that can be returned as a part of
+ * {@link org.openecomp.policy.api.PolicyConfig}.
+ *
+ * @version 0.1
+ */
+public enum PolicyConfigStatus {
+ /**
+ * Indicates that the Configuration has been successfully retrieved.
+ */
+ CONFIG_RETRIEVED("retrieved"),
+ /**
+ * Indicates that there is no Configuration Retrieved from PolicyConfig.
+ */
+ CONFIG_NOT_FOUND("not_found"),
+ ;
+
+ private String name;
+ private PolicyConfigStatus(String name){
+ this.name = name;
+ }
+
+ /**
+ * Get the <code>PolicyConfigStatus</code> based on <code>String</code> representation of <code>PolicyConfig</code>
+ *
+ * @param configStatus the <code>String</code> Configuration Status
+ * @return the <code>PolicyConfigResponse</code> with the name matching <code>CONFIG_RETRIEVED</code> or <code>CONFIG_NOT_FOUND</code>
+ * if no match is found
+ */
+ public static PolicyConfigStatus getStatus(String configStatus) {
+ if(configStatus.equalsIgnoreCase("retrieved")) {
+ return CONFIG_RETRIEVED;
+ }else {
+ return CONFIG_NOT_FOUND;
+ }
+ }
+
+ /**
+ * Returns the <code>String</code> name for this <code>PolicyConfigStatus</code>
+ *
+ * @return the <code>String</code> name for this <code>PolicyConfigStatus</code>
+ */
+ public String toString(){
+ return this.name;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigType.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigType.java
new file mode 100644
index 000000000..111c85623
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyConfigType.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Enumeration of the Policy Config Types that is used as a part of
+ * {@link org.openecomp.policy.api.PolicyParameters}.
+ *
+ * @version 0.1
+ */
+public enum PolicyConfigType {
+ /**
+ * Indicates Base Config Policy.
+ */
+ Base("Base"),
+ /**
+ * Indicates ClosedLoop Fault Policy.
+ */
+ ClosedLoop_Fault("Fault"),
+ /**
+ * Indicates ClosedLoop Performance Metrics Policy.
+ */
+ ClosedLoop_PM("PM"),
+ /**
+ * Indicates Firewall Config Policy.
+ */
+ Firewall("FW"),
+ /**
+ * Indicates BRMS based raw DRL Rule Policy.
+ */
+ BRMS_RAW("BRMS_Raw"),
+ /**
+ * Indicates BRMS based Param DRL policy.
+ */
+ BRMS_PARAM("BRMS_Param"),
+ /**
+ * Indicates DCAE Micro Service based Policy.
+ */
+ MicroService("MS")
+ ;
+
+ private String name;
+
+ private PolicyConfigType(String typeName){
+ this.name = typeName;
+ }
+
+ /**
+ * Returns the <code>String</code> format of Type for this <code>PolicyClass</code>
+ * @return the <code>String</code> of the Type for this <code>PolicyClass</code>
+ */
+ public String toString() {
+ return this.name;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyDecision.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyDecision.java
new file mode 100644
index 000000000..18d066905
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyDecision.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Enumeration of PolicyDecision that can be returned as a part of
+ * {@link org.openecomp.policy.api.DecisionResponse} getDecision().
+ *
+ * @version 0.1
+ */
+public enum PolicyDecision {
+ /**
+ * Indicates that the Decision is to Permit.
+ */
+ PERMIT("permit"),
+ /**
+ * Indicates that the Decision is to Deny.
+ */
+ DENY("deny"),
+ /**
+ * Indicates that the Decision process has some issues.
+ */
+ ERROR("error")
+ ;
+
+ private String name;
+ private PolicyDecision(String name){
+ this.name = name;
+ }
+
+ /**
+ * Returns the <code>String</code> name for this <code>PolicyDecision</code>
+ *
+ * @return the <code>String</code> name for this <code>PolicyDecision</code>
+ */
+ public String toString(){
+ return this.name;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyDecisionException.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyDecisionException.java
new file mode 100644
index 000000000..7f08fcb36
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyDecisionException.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * PolicyDecisionException extends <code>Exception</code> to implement exceptions thrown by {@link org.openecomp.policy.api.PolicyEngine}
+ *
+ * @version 0.1
+ */
+public class PolicyDecisionException extends Exception {
+
+ private static final long serialVersionUID = -2080072039363261175L;
+
+ public PolicyDecisionException() {
+ }
+
+ public PolicyDecisionException(String message) {
+ super(message);
+ }
+
+ public PolicyDecisionException(Throwable cause){
+ super(cause);
+ }
+
+ public PolicyDecisionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public PolicyDecisionException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEngine.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEngine.java
new file mode 100644
index 000000000..0b46c57cf
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEngine.java
@@ -0,0 +1,575 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.json.JsonObject;
+
+import org.openecomp.policy.api.NotificationHandler;
+import org.openecomp.policy.api.PDPNotification;
+import org.openecomp.policy.std.StdPolicyEngine;
+
+/**
+ * PolicyEngine is the Interface that applications use to make policy queries against a PEPEngine
+ *
+ * @version 1.0
+ */
+public class PolicyEngine{
+ private String propertyFilePath = null;
+ private StdPolicyEngine stdPolicyEngine;
+ private NotificationScheme scheme = null;
+ private NotificationHandler handler = null;
+
+ /**
+ * Gets the configuration from the PolicyDecisionPoint(PDP) for the <code>String</code> which represents the Policy File Name
+ *
+ * @param policyName the <code>String</code> format of the PolicyFile Name whose configuration is required.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
+ * @throws PolicyConfigException
+ * @deprecated use {@link #getConfigByPolicyName(String policyName, UUID requestID)} Instead.
+ */
+ @Deprecated
+ public Collection<PolicyConfig> getConfigByPolicyName(String policyName) throws PolicyConfigException {
+ Collection<PolicyConfig> policyConfig = stdPolicyEngine.policyName(policyName,(UUID)null);
+ return policyConfig;
+ }
+
+ /**
+ * Gets the configuration from the PolicyDecisionPoint(PDP) for the <code>String</code> which represents the Policy File Name
+ *
+ * @param policyName the <code>String</code> format of the PolicyFile Name whose configuration is required.
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
+ * @throws PolicyConfigException
+ * @deprecated use {@link #getConfigByPolicyName(String policyName, UUID requestID)} Instead.
+ */
+ @Deprecated
+ public Collection<PolicyConfig> getConfigByPolicyName(String policyName, UUID requestID) throws PolicyConfigException {
+ Collection<PolicyConfig> policyConfig = stdPolicyEngine.policyName(policyName,requestID);
+ return policyConfig;
+ }
+
+ /**
+ * Gets the configuration from the PolicyDecisionPoint(PDP) for the <code>String</code> which represents the eCOMPComponentName
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
+ * @throws PolicyConfigException
+ * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
+ */
+ @Deprecated
+ public Collection<PolicyConfig> getConfig(String eCOMPComponentName) throws PolicyConfigException {
+ Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,(UUID)null);
+ return policyConfig;
+ }
+
+ /**
+ * Gets the configuration from the PolicyDecisionPoint(PDP) for the <code>String</code> which represents the eCOMPComponentName
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ * @throws PolicyConfigException
+ * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
+ */
+ @Deprecated
+ public Collection<PolicyConfig> getConfig(String eCOMPComponentName, UUID requestID) throws PolicyConfigException {
+ Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,requestID);
+ return policyConfig;
+ }
+
+ /**
+ * Requests the configuration of the <code>String</code> which represents the eCOMPComponentName and <code>String</code>
+ * which represents the configName and returns the configuration if different Configurations exist for the
+ * particular eCOMPComponentName.
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
+ * @param configName the <code>String</code> format of the configurationName whose configuration is required.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
+ * @throws PolicyConfigException
+ * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
+ */
+ @Deprecated
+ public Collection<PolicyConfig> getConfig(String eCOMPComponentName, String configName) throws PolicyConfigException {
+ Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,configName,(UUID)null);
+ return policyConfig;
+ }
+
+ /**
+ * Requests the configuration of the <code>String</code> which represents the eCOMPComponentName and <code>String</code>
+ * which represents the configName and returns the configuration if different Configurations exist for the
+ * particular eCOMPComponentName.
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
+ * @param configName the <code>String</code> format of the configurationName whose configuration is required.
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
+ * @throws PolicyConfigException
+ * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
+ */
+ @Deprecated
+ public Collection<PolicyConfig> getConfig(String eCOMPComponentName, String configName, UUID requestID) throws PolicyConfigException {
+ Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,configName,requestID);
+ return policyConfig;
+ }
+
+ /**
+ * Requests the configuration of the <code>String</code> which represents the eCOMPComponentName, <code>String</code>
+ * which represents the configName and <code>Map</code> of <code>String,String</code> which has the configAttribute and returns the specific
+ * configuration related to the configAttributes mentioned.
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
+ * @param configName the <code>String</code> format of the configurationName whose configuration is required.
+ * @param configAttributes the <code>Map</code> of <code>String,String</code> format of the configuration attributes which are required.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
+ * @throws PolicyConfigException
+ * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
+ */
+ @Deprecated
+ public Collection<PolicyConfig> getConfig(String eCOMPComponentName, String configName, Map<String, String> configAttributes) throws PolicyConfigException{
+ Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,configName,configAttributes,(UUID)null);
+ return policyConfig;
+ }
+
+ /**
+ * Requests the configuration of the <code>String</code> which represents the eCOMPComponentName, <code>String</code>
+ * which represents the configName and <code>Map</code> of <code>String,String</code> which has the configAttribute and returns the specific
+ * configuration related to the configAttributes mentioned.
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
+ * @param configName the <code>String</code> format of the configurationName whose configuration is required.
+ * @param configAttributes the <code>Map</code> of <code>String,String</code> format of the configuration attributes which are required.
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
+ * @throws PolicyConfigException
+ * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
+ */
+ @Deprecated
+ public Collection<PolicyConfig> getConfig(String eCOMPComponentName, String configName, Map<String, String> configAttributes, UUID requestID) throws PolicyConfigException{
+ Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,configName,configAttributes,requestID);
+ return policyConfig;
+ }
+
+ /**
+ * Requests the configuration of the <code>ConfigRequestParameters</code> which represents the Config policy request parameters
+ * and returns the specific configuration related to the matching parameters.
+ *
+ * @param configRequestParameters {@link org.openecomp.policy.api.ConfigRequestParameters} which represents the Config policy request parameters.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
+ * @throws PolicyConfigException
+ */
+ public Collection<PolicyConfig> getConfig(ConfigRequestParameters configRequestParameters) throws PolicyConfigException{
+ Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(configRequestParameters);
+ return policyConfig;
+ }
+
+ /**
+ * Requests the list of policies based on the <code>ConfigRequestParameters</code> which represents the policy request parameters
+ * and returns the list of policies filtered by the parameters.
+ *
+ * @param configRequestParameters {@link org.openecomp.policy.api.ConfigRequestParameters} which represents the List Policy request parameters.
+ * @return <code>Collection</code> of <code>String</code> which returns the list of policies.
+ * @throws PolicyConfigException
+ */
+ public Collection<String> listConfig(ConfigRequestParameters listPolicyRequestParameters) throws PolicyConfigException{
+ Collection<String> policyList = stdPolicyEngine.listConfig(listPolicyRequestParameters);
+ return policyList;
+ }
+
+
+ /**
+ * Sends the Events specified to the PEP and returns back the PolicyResponse.
+ *
+ * @param eventAttributes the <code>Map</code> of <code>String,String</code> format of the eventAttributes that must contain the event ID and values.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyResponse} which has the Response.
+ * @throws PolicyEventException
+ * @deprecated use {@link #sendEvent(EventRequestParameters)} Instead.
+ */
+ @Deprecated
+ public Collection<PolicyResponse> sendEvent(Map<String, String> eventAttributes) throws PolicyEventException {
+ Collection<PolicyResponse> policyResponse = stdPolicyEngine.event(eventAttributes, (UUID) null);
+ return policyResponse;
+ }
+
+ /**
+ * Sends the Events specified to the PEP and returns back the PolicyResponse.
+ *
+ * @param eventAttributes the <code>Map</code> of <code>String,String</code> format of the eventAttributes that must contain the event ID and values.
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyResponse} which has the Response.
+ * @throws PolicyEventException
+ * @deprecated use {@link #sendEvent(EventRequestParameters)} Instead.
+ */
+ @Deprecated
+ public Collection<PolicyResponse> sendEvent(Map<String, String> eventAttributes, UUID requestID) throws PolicyEventException {
+ Collection<PolicyResponse> policyResponse = stdPolicyEngine.event(eventAttributes, requestID);
+ return policyResponse;
+ }
+
+ /**
+ * Sends the Events specified to the PEP and returns back the PolicyResponse.
+ *
+ * @param eventRequestParameters {@link org.openecomp.policy.api.EventRequestParameters} which represents the Event Request Parameters.
+ * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyResponse} which has the Response.
+ * @throws PolicyEventException
+ */
+ public Collection<PolicyResponse> sendEvent(EventRequestParameters eventRequestParameters) throws PolicyEventException {
+ Collection<PolicyResponse> policyResponse = stdPolicyEngine.event(eventRequestParameters);
+ return policyResponse;
+ }
+
+ /**
+ * Sends the decision Attributes specified to the PEP and returns back the PolicyDecision.
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose Decision is required.
+ * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that must contain the ID and values.
+ * @return {@link org.openecomp.policy.api.DecisionResponse} which has the Decision.
+ * @throws PolicyDecisionException
+ * @deprecated use {@link #getDecision(DecisionRequestParameters)} Instead.
+ */
+ @Deprecated
+ public DecisionResponse getDecision(String eCOMPComponentName, Map<String,String> decisionAttributes) throws PolicyDecisionException {
+ DecisionResponse policyDecision = stdPolicyEngine.decide(eCOMPComponentName, decisionAttributes, null);
+ return policyDecision;
+ }
+
+ /**
+ * Sends the decision Attributes specified to the PEP and returns back the PolicyDecision.
+ *
+ * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose Decision is required.
+ * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that must contain the ID and values.
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ * @return {@link org.openecomp.policy.api.DecisionResponse} which has the Decision.
+ * @throws PolicyDecisionException
+ * @deprecated use {@link #getDecision(DecisionRequestParameters)} Instead.
+ */
+ @Deprecated
+ public DecisionResponse getDecision(String eCOMPComponentName, Map<String,String> decisionAttributes, UUID requestID) throws PolicyDecisionException {
+ DecisionResponse policyDecision = stdPolicyEngine.decide(eCOMPComponentName, decisionAttributes, requestID);
+ return policyDecision;
+ }
+
+ /**
+ * Sends the decision Attributes specified to the PEP and returns back the PolicyDecision.
+ *
+ * @param decisionRequestParameters {@link org.openecomp.policy.api.DecisionRequestParameters} which represents the Decision Request Parameters.
+ * @return {@link org.openecomp.policy.api.DecisionResponse} which has the Decision.
+ * @throws PolicyDecisionException
+ */
+ public DecisionResponse getDecision(DecisionRequestParameters decisionRequestParameters) throws PolicyDecisionException {
+ DecisionResponse policyDecision = stdPolicyEngine.decide(decisionRequestParameters);
+ return policyDecision;
+ }
+
+ /**
+ * <code>setNotification</code> allows changes to the Notification Scheme and Notification Handler
+ *
+ * @param scheme the <code>NotificationScheme</code> of {@link org.openecomp.policy.api.NotificationScheme} which defines the Notification Scheme
+ * @param handler the <code>NotificationHandler</code> of {@link org.openecomp.policy.api.NotificationHandler} which defines what should happen when a notification is received.
+ */
+ public void setNotification(NotificationScheme scheme, NotificationHandler handler) {
+ this.scheme = scheme;
+ this.handler = handler;
+ stdPolicyEngine.notification(this.scheme,this.handler);
+ }
+
+ /**
+ * <code>clearNotification</code> shutsDown the Notification Service if the Auto Scehme Notification service is running.
+ */
+ public void clearNotification(){
+ stdPolicyEngine.stopNotification();
+ }
+
+ /**
+ * <code>setNotification</code> allows changes to the Notification Scheme
+ *
+ * @param scheme the <code>NotificationScheme</code> of {@link org.openecomp.policy.api.NotificationScheme} which defines the Notification Scheme
+ */
+ public void setScheme(NotificationScheme scheme){
+ this.scheme = scheme;
+ stdPolicyEngine.setScheme(this.scheme);
+ }
+ /**
+ * Gets the <code>PDPNotification</code> if there is one exists. This is used for Polling Patterns.
+ *
+ * @return <code>PDPNotification</code> of {@link org.openecomp.policy.api.PDPNotification} which has the Notification.
+ */
+ public PDPNotification getNotification() {
+ return stdPolicyEngine.getNotification();
+ }
+
+ /**
+ * Creates a Config Policy based on given arguments
+ * @param policyName the <code>String</code> format of the Policy Name
+ * @param policyDescription the <code>String</code> format of the Policy Description
+ * @param ecompName the <code>String</code> format of the ECOMP Name
+ * @param configName the <code>String</code> format of the Config Name
+ * @param configAttributes the <code>List</code> the <code>Map</code> Attributes that must contain the key and value.
+ * @param configType the <code>String</code> format of the Config Type
+ * @param body the <code>String</code> format of the Policy Body
+ * @param policyScope the <code>String</code> value of the sub scope directory where the policy will be created and stored
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ * @throws Exception
+ * @return <code>String</code> format of response
+ * @deprecated use {@link #createPolicy(PolicyParameters)} Instead.
+ */
+ @Deprecated
+ public String createConfigPolicy(String policyName, String policyDescription, String ecompName, String configName,
+ Map<String, String> configAttributes, String configType, String body, String policyScope, UUID requestID,
+ String riskLevel, String riskType, String guard, String ttlDate) throws Exception {
+
+ String response = stdPolicyEngine.createConfigPolicy(policyName, policyDescription, ecompName, configName,
+ configAttributes, configType, body, policyScope, requestID,
+ riskLevel, riskType, guard, ttlDate);
+
+ return response;
+
+ }
+
+ /**
+ * Creates a Config Policy based on given arguments
+ * @param policyName the <code>String</code> format of the Policy Name
+ * @param policyDescription the <code>String</code> format of the Policy Description
+ * @param ecompName the <code>String</code> format of the ECOMP Name
+ * @param configName the <code>String</code> format of the Config Name
+ * @param configAttributes the <code>List</code> the <code>Map</code> Attributes that must contain the key and value.
+ * @param configType the <code>String</code> format of the Config Type
+ * @param body the <code>String</code> format of the Policy Body
+ * @param policyScope the <code>String</code> value of the sub scope directory where the policy will be created and stored
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ * @throws Exception
+ * @return <code>String</code> format of response
+ * @deprecated use {@link #updatePolicy(PolicyParameters)} Instead.
+ */
+ @Deprecated
+ public String updateConfigPolicy(String policyName, String policyDescription, String ecompName, String configName,
+ Map<String, String> configAttributes, String configType, String body, String policyScope, UUID requestID,
+ String riskLevel, String riskType, String guard, String ttlDate) throws Exception {
+
+ String response = stdPolicyEngine.updateConfigPolicy(policyName, policyDescription, ecompName, configName,
+ configAttributes, configType, body, policyScope, requestID,riskLevel, riskType, guard, ttlDate);
+
+ return response;
+
+ }
+
+ /**
+ * Creates a Config Firewall Policy based on given arguments
+ * @param policyName the <code>String</code> format of the Policy Name
+ * @param firewallJson the <code>JsonObject</code> representation of the Firewall Rules List
+ * @param policyScope the <code>String</code> value of the sub scope directory where the policy will be created and stored
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ * @throws Exception
+ * @return <code>String</code> format of response.
+ * @deprecated use {@link #createPolicy(PolicyParameters)} Instead.
+ */
+ @Deprecated
+ public String createConfigFirewallPolicy(String policyName, JsonObject firewallJson, String policyScope, UUID requestID,
+ String riskLevel, String riskType, String guard, String ttlDate) throws Exception {
+
+ String response = stdPolicyEngine.createConfigFirewallPolicy(policyName, firewallJson, policyScope, requestID,riskLevel,
+ riskType, guard, ttlDate);
+
+ return response;
+
+ }
+
+ /**
+ * Updates a Config Firewall Policy based on given arguments
+ * @param policyName the <code>String</code> format of the Policy Name
+ * @param firewallJson the <code>JsonObject</code> representation of the Firewall Rules List
+ * @param policyScope the <code>String</code> value of the sub scope directory where the policy will be created and stored
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ * @throws Exception
+ * @return <code>String</code> format of response.
+ * @deprecated use {@link #updatePolicy(PolicyParameters)} Instead.
+ */
+ @Deprecated
+ public String updateConfigFirewallPolicy(String policyName, JsonObject firewallJson, String policyScope, UUID requestID,
+ String riskLevel, String riskType, String guard, String ttlDate) throws Exception {
+
+ String response = stdPolicyEngine.updateConfigFirewallPolicy(policyName, firewallJson, policyScope, requestID,riskLevel, riskType, guard, ttlDate);
+
+ return response;
+
+ }
+
+ /**
+ * Creates a Dictionary Item based on given Dictionary Parameters
+ *
+ * @param policyParameters {@link org.openecomp.policy.api.DictionaryParameters} which represents the Dictionary Parameters required to create a Dictionary Item.
+ * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to create dictionary item Request.
+ * @throws Exception
+ */
+ public PolicyChangeResponse createDictionaryItem(DictionaryParameters parameters) throws Exception {
+ PolicyChangeResponse response = stdPolicyEngine.createDictionaryItem(parameters);
+ return response;
+ }
+
+ /**
+ * Creates a Policy based on given Policy Parameters.
+ *
+ * @param policyParameters {@link org.openecomp.policy.api.PolicyParameters} which represents the Policy Parameters required to create a Policy.
+ * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to create policy Request.
+ * @throws Exception
+ */
+ public PolicyChangeResponse createPolicy(PolicyParameters policyParameters) throws Exception {
+ PolicyChangeResponse response = stdPolicyEngine.createPolicy(policyParameters);
+ return response;
+ }
+
+ /**
+ * Update Policy based on given Policy Parameters.
+ *
+ * @param policyParameters {@link org.openecomp.policy.api.PolicyParameters} which represents the Policy Parameters required to update a Policy.
+ * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to create policy Request.
+ * @throws Exception
+ */
+ public PolicyChangeResponse updatePolicy(PolicyParameters policyParameters) throws Exception {
+ PolicyChangeResponse response = stdPolicyEngine.updatePolicy(policyParameters);
+ return response;
+ }
+
+ /**
+ * Pushes the specified policy to the PDP Group. If no PDP group is selected default is used.
+ *
+ * @param policyScope the <code>String</code> value of the sub scope directory where the policy is located
+ * @param policyName the <code>String</code> format of the Policy Name being pushed.
+ * @param policyType the <code>String</code> format of the Policy Type which is being pushed.
+ * @param pdpGroup the <code>String</code> format of the PDP Group name to which the policy needs to be pushed to.
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * @return <code>String</code> format of the response related to the push Policy Request.
+ * @throws Exception
+ * @deprecated use {@link #pushPolicy(PushPolicyParameters)} instead.
+ */
+ @Deprecated
+ public String pushPolicy(String policyScope, String policyName, String policyType, String pdpGroup, UUID requestID) throws Exception {
+
+ String response = stdPolicyEngine.pushPolicy(policyScope, policyName, policyType, pdpGroup, requestID);
+
+ return response;
+ }
+
+ /**
+ * Pushes the specified policy to the PDP Group. If no PDP group is selected default is used.
+ *
+ * @param pushPolicyParameters {@link org.openecomp.policy.api.PushPolicyParameters} which represents the Push Policy parameters required to push a policy.
+ * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to the push Policy Request.
+ * @throws Exception
+ */
+ public PolicyChangeResponse pushPolicy(PushPolicyParameters pushPolicyParameters) throws Exception {
+ PolicyChangeResponse response = stdPolicyEngine.pushPolicy(pushPolicyParameters);
+ return response;
+ }
+
+ /**
+ * Deletes the specified policy from the PAP or PDP.
+ *
+ * @param deletePolicyParameters {@link org.openecomp.policy.api.DeletePolicyParameters} which represents the Delete Policy parameters to delete a policy.
+ * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to the Delete Policy Request.
+ * @throws Exception
+ */
+ public PolicyChangeResponse deletePolicy(DeletePolicyParameters deletePolicyParameters) throws Exception {
+ PolicyChangeResponse response = stdPolicyEngine.deletePolicy(deletePolicyParameters);
+ return response;
+ }
+
+ /**
+ * PolicyEngine Constructor with <code>String</code> format of propertiesFilePathname
+ *
+ * @param propertiesFilePathname the <code>String</code> format of the propertiesFilePathname
+ * @throws PolicyEngineException
+ */
+ public PolicyEngine(String propertiesFilePathname) throws PolicyEngineException {
+ this.propertyFilePath = propertiesFilePathname ;
+ this.stdPolicyEngine= new StdPolicyEngine(this.propertyFilePath);
+ }
+
+ /**
+ * PolicyEngine Constructor with <code>String</code> format of PropertiesFilePathname, <code>NotificationScheme</code> and <code>NotificationHandler</code>
+ *
+ * @param propertiesFilePathname the <code>String</code> format of the propertiesFilePathname
+ * @param scheme the <code>NotificationScheme</code> of {@link org.openecomp.policy.api.NotificationScheme} which defines the Notification Scheme
+ * @param handler the <code>NotificationHandler</code> of {@link org.openecomp.policy.api.NotificationHandler} which defines what should happen when a notification is received.
+ * @throws PolicyEngineException
+ */
+ public PolicyEngine(String propertiesFilePathname, NotificationScheme scheme, NotificationHandler handler) throws PolicyEngineException {
+ this.propertyFilePath = propertiesFilePathname ;
+ this.scheme = scheme;
+ this.handler = handler;
+ this.stdPolicyEngine= new StdPolicyEngine(this.propertyFilePath,this.scheme,this.handler);
+ }
+
+ /**
+ * Creates a new Policy Service based on given Service Parameters.
+ *
+ * @param importParameters {@link org.openecomp.policy.api.ImportParameters} which represents the Service Parameters required to create a Policy Service.
+ * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to create import Service.
+ * @throws Exception
+ */
+ public PolicyChangeResponse policyEngineImport(ImportParameters importParameters) throws Exception {
+ PolicyChangeResponse response = stdPolicyEngine.policyEngineImport(importParameters);
+ return response;
+ }
+
+ /**
+ * PolicyEngine Constructor with <code>String</code> format of PropertiesFilePathname and <code>NotificationScheme</code>
+ *
+ * @param propertiesFilePathname the <code>String</code> format of the propertiesFilePathname
+ * @param scheme the <code>NotificationScheme</code> of {@link org.openecomp.policy.api.NotificationScheme} which defines the Notification Scheme
+ * @throws PolicyEngineException
+ */
+ public PolicyEngine(String propertiesFilePathname, NotificationScheme scheme) throws PolicyEngineException{
+ this.propertyFilePath = propertiesFilePathname;
+ this.scheme = scheme;
+ this.stdPolicyEngine = new StdPolicyEngine(this.propertyFilePath, this.scheme);
+ }
+ /**
+ * PolicyEngine Constructor with no parameters.
+ *//*
+ public PolicyEngine(){
+
+ }
+ public void createFirewallPolicy(String filterName, String termName, String preIPSource, String preIPDest,
+ String sourcePort, String destPort, String Port, String protocol, String direction, String action ) throws PolicyDecisionException {
+ stdPolicyEngine.createFirewallPolicy(filterName, termName, preIPSource, preIPDest, sourcePort, destPort, Port,
+ protocol, direction, action);
+ }
+
+ public void updateFirewallPolicy(String filterName, String termName, String preIPSource, String preIPDest,
+ String sourcePort, String destPort, String Port, String protocol, String direction, String action ) throws PolicyDecisionException {
+ stdPolicyEngine.updateFirewallPolicy(filterName, termName, preIPSource, preIPDest, sourcePort, destPort, Port,
+ protocol, direction, action);
+ }*/
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEngineException.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEngineException.java
new file mode 100644
index 000000000..e80513ad8
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEngineException.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * PolicyEngineException extends <code>Exception</code> to implement exceptions thrown by {@link org.openecomp.policy.api.PolicyEngine}
+ *
+ * @version 0.1
+ */
+public class PolicyEngineException extends Exception{
+ private static final long serialVersionUID = 4945973094200118969L;
+
+ public PolicyEngineException() {
+ }
+
+ public PolicyEngineException(String message) {
+ super(message);
+ }
+
+ public PolicyEngineException(Throwable cause){
+ super(cause);
+ }
+
+ public PolicyEngineException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public PolicyEngineException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEventException.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEventException.java
new file mode 100644
index 000000000..8e4c81990
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyEventException.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * PolicyEventException extends <code>Exception</code> to implement exceptions thrown by {@link org.openecomp.policy.api.PolicyEngine}
+ *
+ * @version 0.1
+ */
+public class PolicyEventException extends Exception {
+ private static final long serialVersionUID = -1477625011320634608L;
+
+ public PolicyEventException() {
+ }
+
+ public PolicyEventException(String message) {
+ super(message);
+ }
+
+ public PolicyEventException(Throwable cause){
+ super(cause);
+ }
+
+ public PolicyEventException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public PolicyEventException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyParameters.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyParameters.java
new file mode 100644
index 000000000..32cd75b5f
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyParameters.java
@@ -0,0 +1,497 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * <code>PolicyParameters</code> defines the Policy Parameters
+ * which are required to Create/Update a Policy.
+ *
+ * @version 0.1
+ */
+public class PolicyParameters {
+ private PolicyClass policyClass;
+ private PolicyConfigType policyConfigType;
+ private String policyName;
+ private String policyDescription;
+ private String ecompName;
+ private String configName;
+ private Map<AttributeType, Map<String,String>> attributes;
+ private String configBody;
+ private PolicyType configBodyType;
+ private String actionPerformer;
+ private String actionAttribute;
+ private UUID requestID;
+ private List<String> dynamicRuleAlgorithmLabels;
+ private List<String> dynamicRuleAlgorithmFunctions;
+ private List<String> dynamicRuleAlgorithmField1;
+ private List<String> dynamicRuleAlgorithmField2;
+ private String priority;
+ private RuleProvider ruleProvider;
+ private Date TTLDate;
+ private boolean guard = false;
+ private String riskLevel = "5";
+ private String riskType = "defualt";
+
+ /**
+ * Sets Config Policy Parameters.
+ *
+ * @param policyConfigType the {@link org.openecomp.policy.api.PolicyConfigType} Enum format of the Config Type
+ * @param policyName the <code>String</code> format of the Policy Name
+ * @param policyDescription the <code>String</code> format of the Policy Description
+ * @param ecompName the <code>String</code> format of the ECOMP Name
+ * @param configName the <code>String</code> format of the Config Name
+ * @param attributes the <code>Map</code> Attributes that must contain the AttributeType and Map of key,value pairs corresponding to it.
+ * @param configBodyType the {@link org.openecomp.policy.api.PolicyType} Enum format of the config Body Type.
+ * @param configBody the <code>String</code> format of the Policy Body
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ */
+ public void setConfigPolicyParameters(PolicyConfigType policyConfigType, String policyName, String policyDescription, String ecompName, String configName,
+ Map<AttributeType, Map<String, String>> attributes, PolicyType configBodyType, String configBody, UUID requestID){
+ this.setPolicyConfigType(policyConfigType);
+ this.setPolicyName(policyName);
+ this.setPolicyDescription(policyDescription);
+ this.setEcompName(ecompName);
+ this.setConfigName(configName);
+ this.setAttributes(attributes);
+ this.setConfigBody(configBody);
+ this.setConfigBodyType(configBodyType);
+ this.setRequestID(requestID);
+ }
+
+ /**
+ * Sets config Firewall Policy Parameters.
+ *
+ * @param policyName the <code>String</code> format of the Policy Name
+ * @param firewallJson the <code>String</code> representation of the Firewall Rules List
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ * A different request ID should be passed for each request.
+ */
+ public void setConfigFirewallPolicyParameters(String policyName, String firewallJson, UUID requestID){
+ this.setPolicyConfigType(PolicyConfigType.Firewall);
+ this.setPolicyName(policyName);
+ this.setConfigBody(firewallJson);
+ this.setConfigBodyType(PolicyType.JSON);
+ this.setRequestID(requestID);
+ }
+
+ /**
+ * Gets the PolicyName of the Policy Parameters.
+ *
+ * @return policyName the <code>String</code> format of the Policy Name
+ */
+ public String getPolicyName() {
+ return policyName;
+ }
+
+ /**
+ * Sets the policyName of the Policy Parameters.
+ *
+ * @param policyName the <code>String</code> format of the Policy Name
+ */
+ public void setPolicyName(String policyName) {
+ this.policyName = policyName;
+ }
+
+ /**
+ * Gets the policy Description.
+ *
+ * @return the <code>String</code> format of the Policy Description
+ */
+ public String getPolicyDescription() {
+ return policyDescription;
+ }
+
+ /**
+ * Sets the policy Description of the Policy Description.
+ *
+ * @param policyDescription the <code>String</code> format of the Policy Description
+ */
+ public void setPolicyDescription(String policyDescription) {
+ this.policyDescription = policyDescription;
+ }
+
+ /**
+ * Gets the ECOMP Name value of the Policy Paramters.
+ *
+ * @return <code>String</code> format of the ECOMP Name
+ */
+ public String getEcompName() {
+ return ecompName;
+ }
+
+ /**
+ * Sets the ECOMP Name field of the Policy Parameters.
+ *
+ * @param ecompName the <code>String</code> format of the ECOMP Name
+ */
+ public void setEcompName(String ecompName) {
+ this.ecompName = ecompName;
+ }
+
+ /**
+ * Gets the Config Name value of the Policy Parameters.
+ *
+ * @return <code>String</code> format of the Config Name
+ */
+ public String getConfigName() {
+ return configName;
+ }
+
+ /**
+ * Sets the Config Name field of the Policy Parameters.
+ *
+ * @param configName the <code>String</code> format of the Config Name
+ */
+ public void setConfigName(String configName) {
+ this.configName = configName;
+ }
+
+ /**
+ * Gets the Attributes of the policy Parameters.
+ *
+ * @return <code>List</code> the <code>Map</code> Attributes that must contain the AttributeType and Map of key,value pairs corresponding to it.
+ */
+ public Map<AttributeType, Map<String, String>> getAttributes() {
+ return attributes;
+ }
+
+ /**
+ * Sets the Attributes of the Policy Parameters.
+ *
+ * @param attributes the <code>Map</code> Attributes that must contain the AttributeType and Map of key,value pairs corresponding to it.
+ */
+ public void setAttributes(Map<AttributeType, Map<String, String>> attributes) {
+ this.attributes = attributes;
+ }
+
+ /**
+ * Gets the Policy Config Type value the Policy parameters.
+ *
+ * @return {@link org.openecomp.policy.api.PolicyConfigType} Enum of the Config Type
+ */
+ public PolicyConfigType getPolicyConfigType() {
+ return policyConfigType;
+ }
+
+ /**
+ * Sets the Policy Config Type field of the policy Parameters.
+ *
+ * @param policyConfigType the {@link org.openecomp.policy.api.PolicyConfigType} Enum format of the Config Type
+ */
+ public void setPolicyConfigType(PolicyConfigType policyConfigType) {
+ setPolicyClass(PolicyClass.Config);
+ this.policyConfigType = policyConfigType;
+ }
+
+ /**
+ * Gets the configBody value of the Policy Parameters.
+ *
+ * @return the <code>String</code> format of the Policy Body
+ */
+ public String getConfigBody() {
+ return configBody;
+ }
+
+ /**
+ * Sets the configBody field of the Policy Parameters.
+ *
+ * @param configBody the <code>String</code> format of the Policy Body
+ */
+ public void setConfigBody(String configBody) {
+ this.configBody = configBody;
+ }
+
+ /**
+ * Gets the config Body Type value of the Policy Parameters.
+ *
+ * @return the <code>PolicyType</code> representation of the configBodyType
+ */
+ public PolicyType getConfigBodyType() {
+ return configBodyType;
+ }
+
+ /**
+ * Sets the configBodyType field of the Policy Parameters.
+ *
+ * @param configBodyType the <code>PolicyType</code> representation of the config BodyType
+ */
+ public void setConfigBodyType(PolicyType configBodyType) {
+ this.configBodyType = configBodyType;
+ }
+
+ /**
+ * Gets the requestID of the Policy Parameters.
+ *
+ * @return unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+
+ /**
+ * Sets the requestID of the Policy Parameters.
+ *
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+
+ /**
+ * Gets the Policy Class of the Policy Parameters.
+ *
+ * @return {@link org.openecomp.policy.api.PolicyClass} of the Policy Parameters.
+ */
+ public PolicyClass getPolicyClass() {
+ return policyClass;
+ }
+
+ /**
+ * Sets the Policy Class of the Policy Parameters.
+ *
+ * @param policyClass the Enum {@link org.openecomp.policy.api.PolicyClass} to set Policy Class Type of Policy parameters.
+ */
+ public void setPolicyClass(PolicyClass policyClass) {
+ this.policyClass = policyClass;
+ }
+
+ /**
+ * Gets the Action Performer value of the Policy Parameters for Action Policies.
+ *
+ * @return the <code>String</code> value of the Action Performer for Action Policies
+ */
+ public String getActionPerformer() {
+ return actionPerformer;
+ }
+
+ /**
+ * Sets the Action Performer value of the Policy Parameters for Action Policies.
+ *
+ * @param actionPerformer the <code>String</code> format of the Action Performer
+ */
+ public void setActionPerformer(String actionPerformer) {
+ this.actionPerformer = actionPerformer;
+ }
+
+ /**
+ * Gets the Action Attribute value of the Policy Parameters for Action Policies.
+ *
+ * @return the <code>String</code> value of the Action Attribute for Action Policies
+ */
+ public String getActionAttribute() {
+ return actionAttribute;
+ }
+
+ /**
+ * Sets the Action Attribute value of the Policy Parameters for Action Policies.
+ *
+ * @param actionAttribute the <code>String</code> format of the Action Attribute
+ */
+ public void setActionAttribute(String actionAttribute) {
+ this.actionAttribute = actionAttribute;
+ }
+
+ /**
+ * Gets the Dynamic Rule Algorithm Label of the policy Parameters. Used in conjunction with the Label, Field1,
+ * Function, and Field2 to complete the complex and simple Rule Algorithms
+ *
+ * @return <code>List</code> the Dynamic Rule Algorithm Label that must contain the Labels in order
+ */
+ public List<String> getDynamicRuleAlgorithmLabels() {
+ return dynamicRuleAlgorithmLabels;
+ }
+
+ /**
+ * Sets the Dynamic Rule Algorithm Labels used in conjunction with the Label, Field1,
+ * Function, and Field2 to complete the complex and simple Rule Algorithms
+ *
+ * @param dynamicRuleAlgorithmLabels the <code>List</code> dynamicRuleAlgoritmLabels in order
+ */
+ public void setDynamicRuleAlgorithmLabels(
+ List<String> dynamicRuleAlgorithmLabels) {
+ this.dynamicRuleAlgorithmLabels = dynamicRuleAlgorithmLabels;
+ }
+
+ /**
+ * Gets the Dynamic Rule Algorithm Function of the policy Parameters. Used in conjunction with the Label, Field1,
+ * FunctionDef, and Field2 to complete the complex and simple Rule Algorithms
+ *
+ * @return <code>List</code> the Dynamic Rule Algorithm Functions that must contain the values in order
+ */
+ public List<String> getDynamicRuleAlgorithmFunctions() {
+ return dynamicRuleAlgorithmFunctions;
+ }
+
+ /**
+ * Sets the Dynamic Rule Algorithm Functions used in conjunction with the Label, Field1,
+ * Function, and Field2 to complete the complex and simple Rule Algorithms
+ *
+ * @param dynamicRuleAlgorithmFunctions the <code>List</code> dynamicRuleAlgorithmFunctions in order
+ */
+ public void setDynamicRuleAlgorithmFunctions(List<String> dynamicRuleAlgorithmFunctions) {
+ this.dynamicRuleAlgorithmFunctions = dynamicRuleAlgorithmFunctions;
+ }
+
+ /**
+ * Gets the Dynamic Rule Algorithm Field1 of the policy Parameters. Used in conjunction with the Label, Field1,
+ * Function, and Field2 to complete the complex and simple Rule Algorithms
+ *
+ * @return <code>List</code> the Dynamic Rule Algorithm Field1 that must contain the Field1 values in order
+ */
+ public List<String> getDynamicRuleAlgorithmField1() {
+ return dynamicRuleAlgorithmField1;
+ }
+
+ /**
+ * Sets the Dynamic Rule Algorithm Field1 used in conjunction with the Label, Field1,
+ * Function, and Field2 to complete the complex and simple Rule Algorithms
+ *
+ * @param dynamicRuleAlgorithmField1 the <code>List</code> dynamicRuleAlgorithmField1 in order
+ */
+ public void setDynamicRuleAlgorithmField1(
+ List<String> dynamicRuleAlgorithmField1) {
+ this.dynamicRuleAlgorithmField1 = dynamicRuleAlgorithmField1;
+ }
+
+ /**
+ * Gets the Dynamic Rule Algorithm Field2 of the policy Parameters. Used in conjunction with the Label, Field1,
+ * Operator, and Field2 to complete the complex and simple Rule Algorithms
+ *
+ * @return <code>List</code> the Dynamic Rule Algorithm Field2 that must contain the Field2 values in order
+ */
+ public List<String> getDynamicRuleAlgorithmField2() {
+ return dynamicRuleAlgorithmField2;
+ }
+
+ /**
+ * Sets the Dynamic Rule Algorithm Field2 used in conjunction with the Label, Field1,
+ * Function, and Field2 to complete the complex and simple Rule Algorithms
+ *
+ * @param dynamicRuleAlgorithmField2 the <code>List</code> dynamicRuleAlgorithmField2 in order
+ */
+ public void setDynamicRuleAlgorithmField2(
+ List<String> dynamicRuleAlgorithmField2) {
+ this.dynamicRuleAlgorithmField2 = dynamicRuleAlgorithmField2;
+ }
+
+ /**
+ * Gets the Priority of the Policy Parameters.
+ *
+ * @return priority the <code>String</code> format of the Micro Services priority
+ */
+ public String getPriority() {
+ return priority;
+ }
+
+ /**
+ * Sets the Priority of the Policy Parameters.
+ *
+ * @param priority the <code>String</code> format of the Micro Services priority
+ */
+ public void setPriority(String priority) {
+ this.priority = priority;
+ }
+
+ public RuleProvider getRuleProvider() {
+ return ruleProvider;
+ }
+
+ public void setRuleProvider(RuleProvider ruleProvider) {
+ this.ruleProvider = ruleProvider;
+ }
+ /**
+ * Sets the Guard field of the Policy Parameters.
+ *
+ * @param guard the <code>Boolean</code> format of the guard value
+ */
+ public void setGuard(boolean guard){
+ this.guard = guard;
+ }
+
+ /**
+ * Gets the guard value of the Policy Parameters for Action Policies.
+ *
+ * @return the <code>boolean</code> value of the Guard for Config Policies
+ */
+ public boolean getGuard(){
+ return guard;
+ }
+
+ /**
+ * Sets the riskType field of the Policy Parameters.
+ *
+ * @param guard the <code>String</code> format of the riskType value
+ */
+ public void setRiskType(String riskType){
+ this.riskType = riskType;
+ }
+
+ /**
+ * Gets the riskType value of the Policy Parameters for Config Policies.
+ *
+ * @return the <code>String</code> value of the riskType for Config Policies
+ */
+ public String getRiskType(){
+ return riskType;
+ }
+
+ /**
+ * Sets the riskLevel field of the Policy Parameters.
+ *
+ * @param riskLevel the <code>String</code> format of the riskType value
+ */
+ public void setRiskLevel(String riskLevel){
+ this.riskLevel = riskLevel;
+ }
+
+ /**
+ * Gets the riskLevel value of the Policy Parameters for Config Policies.
+ *
+ * @return the <code>String</code> value of the riskLevel for Config Policies
+ */
+ public String getRiskLevel(){
+ return riskLevel;
+ }
+
+ /**
+ * Sets the TTLDate field of the Policy Parameters.
+ *
+ * @param TTLDate the <code>Date</code> format of the TTLDate value
+ */
+ public void setTtlDate(Date TTLDate){
+ this.TTLDate = TTLDate;
+ }
+
+ /**
+ * Gets the TTLDate value of the Policy Parameters for Config Policies.
+ *
+ * @return the <code>Date</code> value of the TTLDate for Config Policies
+ */
+ public Date getTtlDate(){
+ return TTLDate;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyResponse.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyResponse.java
new file mode 100644
index 000000000..316f7dd83
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyResponse.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.Map;
+
+/**
+ * Defines the objects that represent PolicyEngine Response elements. PolicyResponse communicates the PolicyResponseStatus,
+ * PolicyResponseMessage, ActionAdvised, ActionTaken and RequestAttributes.
+ *
+ * @version 0.3
+ */
+public interface PolicyResponse {
+ /**
+ * Gets the {@link org.openecomp.policy.api.PolicyResponseStatus} associated with this <code>PolicyResponse</code>.
+ *
+ * @return the <code>PolicyResponseStatus</code> associated with this <code>PolicyResponse</code>
+ */
+ public PolicyResponseStatus getPolicyResponseStatus();
+
+ /**
+ * Gets the <code>Map</code> of <code>String,String</code> which consists of ActionAdvised in this <code>PolicyResponse</code>.
+ * If there is no ActionAdvised this method must return an empty <code>Map</code>.
+ *
+ * @return the <code>Map</code> of <code>String,String</code> which consists of AdviceAttributes in <code>PolicyResponse</code>
+ */
+ public Map<String,String> getActionAdvised();
+
+ /**
+ * Gets the <code>Map</code> of <code>String,String</code> which consists of ActionTaken in this <code>PolicyResponse</code>.
+ * If there are no ActionTaken this method must return an empty <code>Map</code>.
+ *
+ * @return the <code>Map</code> of <code>String,String</code> which consists of ActionTaken in <code>PolicyResponse</code>
+ */
+ public Map<String,String> getActionTaken();
+
+ /**
+ * Gets the <code>Map</code> of <code>String,String</code> which consists of RequestAttributes in this <code>PolicyResponse</code>.
+ *
+ * @return the <code>Map</code> of <code>String,String</code> which consists of RequestAttributes from <code>PolicyResponse</code>
+ */
+ public Map<String,String> getRequestAttributes();
+
+ /**
+ * Gets the <code>String</code> of the PolicyResponseMessage from <code>PolicyResponse</code>
+ *
+ * @return the <code>String</code> which consists of PolicyResponseMessage from <code>PolicyResponse</code>
+ */
+ public String getPolicyResponseMessage();
+
+ /**
+ * Returns the <code>String</code> version of the <code>PolicyResponse</code> object.
+ *
+ * @return <code>String</code> of the <code>PolicyResponse</code> Object.
+ */
+ @Override
+ public String toString();
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyResponseStatus.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyResponseStatus.java
new file mode 100644
index 000000000..a9c329621
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyResponseStatus.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Enumeration of PolicyResponseStatus that can be returned as a part of
+ * {@link org.openecomp.policy.api.PolicyResponse}.
+ *
+ * @version 0.2
+ */
+public enum PolicyResponseStatus {
+ /**
+ * Indicates there is no action required.
+ */
+ NO_ACTION_REQUIRED("no_action"),
+ /**
+ * Indicates that an action has been advised.
+ */
+ ACTION_ADVISED("action_advised"),
+ /**
+ * Indicates that an action has been taken.
+ */
+ ACTION_TAKEN("action_taken")
+ ;
+
+ private String name;
+ private PolicyResponseStatus(String name){
+ this.name = name;
+ }
+
+ /**
+ * Get the <code>PolicyResponseStatus</code> based on <code>String</code> representation of <code>PolicyResponse</code>
+ *
+ * @param responseStatus the <code>String</code> Response Status
+ * @return the <code>PolicyResponseStatus</code> with the name matching <code>ACTION_ADVISED</code> or <code>ACTION_TAKEN</code> or <code>NO_ACTION_REQUIRED</code>
+ */
+ public static PolicyResponseStatus getStatus(String responseStatus) {
+ if(responseStatus.equalsIgnoreCase("action_advised")) {
+ return ACTION_ADVISED;
+ }else if(responseStatus.equalsIgnoreCase("action_taken")) {
+ return ACTION_TAKEN;
+ }else {
+ return NO_ACTION_REQUIRED;
+ }
+ }
+
+ /**
+ * Returns the <code>String</code> name for this <code>PolicyResponseStatus</code>
+ *
+ * @return the <code>String</code> name for this <code>PolicyResponseStatus</code>
+ */
+ public String toString(){
+ return this.name;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyType.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyType.java
new file mode 100644
index 000000000..b86f9521f
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyType.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Enumeration of the Policy Return Types that can be returned as part of a
+ * {@link org.openecomp.policy.api.PolicyConfig}.
+ *
+ * @version 0.2
+ */
+public enum PolicyType {
+ /**
+ * Indicates the response is Properties type
+ */
+ PROPERTIES("Properties"),
+ /**
+ * Indicates the response is JSON type
+ */
+ JSON("json"),
+ /**
+ * Indicates the response is XML type
+ */
+ XML("xml"),
+ /**
+ * Indicates the response is Other type
+ */
+ OTHER("other")
+ ;
+
+ private String name;
+
+ private PolicyType(String typeName) {
+ this.name = typeName;
+ }
+
+ /**
+ * Returns the <code>String</code> format of Type for this <code>PolicyType</code>
+ * @return the <code>String</code> of the Type for this <code>PolicyType</code>
+ */
+ public String toString() {
+ return this.name;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PushPolicyParameters.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PushPolicyParameters.java
new file mode 100644
index 000000000..8a822065b
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PushPolicyParameters.java
@@ -0,0 +1,131 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+import java.util.UUID;
+
+/**
+ * <code>PushPolicyParameters</code> defines the Policy Parameters
+ * which are required to Push a Policy to PDPGroup.
+ *
+ * @version 0.1
+ */
+public class PushPolicyParameters {
+ private String policyName;
+ private String policyType;
+ private String pdpGroup;
+ private UUID requestID;
+
+ /**
+ * Constructor with no Parameters.
+ */
+ public PushPolicyParameters(){
+ }
+
+ /**
+ * Constructor with Parameters.
+ *
+ * @param policyName the <code>String</code> format of the Policy Name
+ * @param policyType the <code>String</code> format of the Policy Type
+ * @param pdpGroup the <code>String</code> format of the PDPGroup
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public PushPolicyParameters(String policyName, String policyType, String pdpGroup, UUID requestID){
+ this.policyName = policyName;
+ this.policyType = policyType;
+ this.pdpGroup = pdpGroup;
+ this.requestID = requestID;
+ }
+
+ /**
+ * Gets the PolicyName of the Push Policy Parameters.
+ *
+ * @return policyName the <code>String</code> format of the Policy Name
+ */
+ public String getPolicyName() {
+ return policyName;
+ }
+
+ /**
+ * Sets the policyName of the Push Policy Parameters.
+ *
+ * @param policyName the <code>String</code> format of the Policy Name
+ */
+ public void setPolicyName(String policyName) {
+ this.policyName = policyName;
+ }
+
+ /**
+ * Gets the PolicyType of the Push Policy Parameters.
+ *
+ * @return policyType the <code>String</code> format of the Policy Type
+ */
+ public String getPolicyType() {
+ return policyType;
+ }
+
+ /**
+ * Sets the policyType of the Push Policy Parameters.
+ *
+ * @param policyType the <code>String</code> format of the Policy Type
+ */
+ public void setPolicyType(String policyType) {
+ this.policyType = policyType;
+ }
+
+ /**
+ * Gets the PDPGroup of the Push Policy Parameters.
+ *
+ * @return pdpGroup the <code>String</code> format of the PDPGroup
+ */
+ public String getPdpGroup() {
+ return pdpGroup;
+ }
+
+ /**
+ * Sets the PDPGroup of the Push Policy Parameters.
+ *
+ * @param pdpGroup the <code>String</code> format of the PDPGroup
+ */
+ public void setPdpGroup(String pdpGroup) {
+ this.pdpGroup = pdpGroup;
+ }
+
+ /**
+ * Gets the requestID of the Push Policy Parameters.
+ *
+ * @return unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public UUID getRequestID() {
+ return requestID;
+ }
+
+ /**
+ * Sets the requestID of the Push Policy Parameters.
+ *
+ * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
+ */
+ public void setRequestID(UUID requestID) {
+ this.requestID = requestID;
+ }
+
+
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/RuleProvider.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/RuleProvider.java
new file mode 100644
index 000000000..8e9218124
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/RuleProvider.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * Enumeration of the Attribute Types that is used as a part of
+ * {@link org.openecomp.policy.api.PolicyParameters}.
+ *
+ * @version 0.1
+ */
+public enum RuleProvider {
+ /**
+ * Indicates User will be defining the Rule information.
+ */
+ CUSTOM("Custom"),
+ /**
+ * Indicates AAF will be providing the Rule information.
+ */
+ AAF("AAF")
+ ;
+
+ private String name;
+
+ private RuleProvider(String typeName){
+ this.name = typeName;
+ }
+
+ /**
+ * Returns the <code>String</code> format of Type for this <code>AttributeType</code>
+ * @return the <code>String</code> of the Type for this <code>AttributeType</code>
+ */
+ public String toString() {
+ return this.name;
+ }
+}
diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/package-info.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/package-info.java
new file mode 100644
index 000000000..982dbb47c
--- /dev/null
+++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/package-info.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * PolicyEngineAPI
+ * ================================================================================
+ * 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.api;
+
+/**
+ * org.openecomp.policy.api contains the API for the PolicyEngine ProtoType
+ *
+ * @version 0.9
+ *
+ * Changes:
+ * Addition of Notifications methods to the Client API.
+ * Combining Multiple results. and Minor changes to retrieve all policies.
+ * Retrieve config policy using policyFile Name and the matching conditions of the policy in the results.
+ * Addition of Decision policy call
+ *
+ *
+ */