aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-XACML/src/main/java/org/onap/policy/xacml/api
diff options
context:
space:
mode:
Diffstat (limited to 'ONAP-XACML/src/main/java/org/onap/policy/xacml/api')
-rw-r--r--ONAP-XACML/src/main/java/org/onap/policy/xacml/api/XACMLErrorConstants.java68
-rw-r--r--ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/ONAPPapEngineFactory.java65
-rw-r--r--ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPAPPolicy.java154
-rw-r--r--ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPDP.java27
-rw-r--r--ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPDPGroup.java20
-rw-r--r--ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/PAPPolicyEngine.java1
6 files changed, 189 insertions, 146 deletions
diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/XACMLErrorConstants.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/XACMLErrorConstants.java
index 0cbba2f19..b8a68d10a 100644
--- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/XACMLErrorConstants.java
+++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/XACMLErrorConstants.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* ONAP-XACML
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2019 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.
@@ -17,44 +17,46 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.policy.xacml.api;
/**
* List of Error Classifications
- * PE100 - Permissions
- * PE200 - System Error (such as availability, timeout, configuration, etc...)
- * PE300 - Data Issue( such as request for REST/JSON )
- * PE400 - Schema validation
- * PE500 - Process Flow issues
- * PE900 - Default/Unknown Errors
- *
+ * PE100 - Permissions
+ * PE200 - System Error (such as availability, timeout, configuration, etc...)
+ * PE300 - Data Issue( such as request for REST/JSON )
+ * PE400 - Schema validation
+ * PE500 - Process Flow issues
+ * PE900 - Default/Unknown Errors
+ *
*
*/
public class XACMLErrorConstants {
- //Captures all the errors related to Authentication, Authorizations and Permissions in the PolicyEngine Process
- public static final String ERROR_PERMISSIONS = "PE100 - Permissions Error: ";
-
- //Captures all the errors related to availability, timeout configuration variables, etc... in the PolicyEngine
- public static final String ERROR_SYSTEM_ERROR = "PE200 - System Error: ";
-
- /*
- * Captures all the errors related to configuration values from properties files and data from the interfacing System
- * like REST/JSON values
- */
- public static final String ERROR_DATA_ISSUE = "PE300 - Data Issue: ";
-
- //Captures all the errors related to the XML schemas and/or REST/JSON structures
- public static final String ERROR_SCHEMA_INVALID = "PE400 - Schema validation Error: ";
-
- //Captures all the errors related to the Process, when data from one Process to another Process does not flow
- public static final String ERROR_PROCESS_FLOW = "PE500 - Process Flow Issue: ";
-
- //Captures all the errors that not related to the list of above error codes
- public static final String ERROR_UNKNOWN = "PE900 - Unknown Error: ";
-
- // Static class, hide constructor
+ // Captures all the errors related to Authentication, Authorizations and Permissions in the PolicyEngine Process
+ public static final String ERROR_PERMISSIONS = "PE100 - Permissions Error: ";
+
+ // Captures all the errors related to availability, timeout configuration variables, etc... in the PolicyEngine
+ public static final String ERROR_SYSTEM_ERROR = "PE200 - System Error: ";
+
+ /*
+ * Captures all the errors related to configuration values from properties files and data from the interfacing
+ * System
+ * like REST/JSON values
+ */
+ public static final String ERROR_DATA_ISSUE = "PE300 - Data Issue: ";
+
+ // Captures all the errors related to the XML schemas and/or REST/JSON structures
+ public static final String ERROR_SCHEMA_INVALID = "PE400 - Schema validation Error: ";
+
+ // Captures all the errors related to the Process, when data from one Process to another Process does not flow
+ public static final String ERROR_PROCESS_FLOW = "PE500 - Process Flow Issue: ";
+
+ // Captures all the errors that not related to the list of above error codes
+ public static final String ERROR_UNKNOWN = "PE900 - Unknown Error: ";
+
+ // Static class, hide constructor
private XACMLErrorConstants() {
- super();
+ super();
}
}
diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/ONAPPapEngineFactory.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/ONAPPapEngineFactory.java
index eacbeb216..a78dc3250 100644
--- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/ONAPPapEngineFactory.java
+++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/ONAPPapEngineFactory.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* ONAP-XACML
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017,2019 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.
@@ -20,39 +20,40 @@
package org.onap.policy.xacml.api.pap;
-import java.util.Properties;
-
import com.att.research.xacml.api.pap.PAPException;
import com.att.research.xacml.util.FactoryException;
import com.att.research.xacml.util.FactoryFinder;
-public abstract class ONAPPapEngineFactory{
-
- /**
- * Creates a new <code>PAPEngineFactory</code> instance using the given class name and the default thread class loader.
- *
- * @param factoryClassName the <code>String</code> name of the factory class to instantiate
- * @return an instance of an object that extends <code>ONAPPapEngineFactory</code> to use in creating <code>PAPPolicyEngine</code> objects.
- */
- public static ONAPPapEngineFactory newInstance(String factoryClassName) throws FactoryException {
- return FactoryFinder.newInstance(factoryClassName, ONAPPapEngineFactory.class, null, true);
- }
-
- /**
- * Creates a new <code>PAPPolicyEngine</code> based on the configured <code>ONAPPapEngineFactory</code>.
- *
- * @return a new <code>PAPPolicyEngine</code>
- * @throws PAPException
- */
- public abstract PAPPolicyEngine newEngine() throws FactoryException, PAPException;
-
- /**
- * Creates a new <code>PAPPolicyEngine</code> based on the configured <code>ONAPPapEngineFactory</code>.
- *
- * @return a new <code>PAPPolicyEngine</code>
- * @throws PAPException
- */
- public abstract PAPPolicyEngine newEngine(Properties properties) throws FactoryException, PAPException;
+import java.util.Properties;
+public abstract class ONAPPapEngineFactory {
+
+ /**
+ * Creates a new <code>PAPEngineFactory</code> instance using the given class name and the default thread class
+ * loader.
+ *
+ * @param factoryClassName the <code>String</code> name of the factory class to instantiate
+ * @return an instance of an object that extends <code>ONAPPapEngineFactory</code> to use in creating
+ * <code>PAPPolicyEngine</code> objects.
+ */
+ public static ONAPPapEngineFactory newInstance(String factoryClassName) throws FactoryException {
+ return FactoryFinder.newInstance(factoryClassName, ONAPPapEngineFactory.class, null, true);
+ }
+
+ /**
+ * Creates a new <code>PAPPolicyEngine</code> based on the configured <code>ONAPPapEngineFactory</code>.
+ *
+ * @return a new <code>PAPPolicyEngine</code>
+ * @throws PAPException PAPException
+ */
+ public abstract PAPPolicyEngine newEngine() throws FactoryException, PAPException;
+
+ /**
+ * Creates a new <code>PAPPolicyEngine</code> based on the configured <code>ONAPPapEngineFactory</code>.
+ *
+ * @return a new <code>PAPPolicyEngine</code>
+ * @throws PAPException PAPException
+ */
+ public abstract PAPPolicyEngine newEngine(Properties properties) throws FactoryException, PAPException;
}
diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPAPPolicy.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPAPPolicy.java
index 4539b4225..5879c098c 100644
--- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPAPPolicy.java
+++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPAPPolicy.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* ONAP-XACML
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2019 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.
@@ -17,73 +17,115 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.policy.xacml.api.pap;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
import java.net.URI;
import java.util.List;
import java.util.Map;
import org.onap.policy.xacml.std.pap.StdPAPPolicy;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
-
/*
* The following allows us to use Jackson to convert sub-types of this type into JSON and back to objects.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- include = JsonTypeInfo.As.PROPERTY,
- property = "PAPPolicyType")
-@JsonSubTypes({
- @Type(value = StdPAPPolicy.class, name = "StdPAPPolicy") })
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PAPPolicyType")
+@JsonSubTypes({@Type(value = StdPAPPolicy.class, name = "StdPAPPolicy")})
public interface OnapPAPPolicy {
-
- public String getPolicyName();
- public String getOldPolicyFileName();
- public String getPolicyDescription();
- public String getOnapName();
- public String getConfigName();
- public Map<String, String> getDynamicFieldConfigAttributes();
- public Map<String, String> getTreatments();
- public Map<String, String> getDynamicSettingsMap();
- public List<String> getDynamicRuleAlgorithmLabels();
- public List<String> getDynamicRuleAlgorithmCombo();
- public List<String> getDynamicRuleAlgorithmField1();
- public List<String> getDynamicRuleAlgorithmField2();
- public List<Object> getDynamicVariableList();
- public List<String> getDataTypeList();
- public String getConfigBodyData();
- public String getPolicyID();
- public String getRuleID();
- public String getConfigType();
- public Boolean isEditPolicy();
- public Boolean isDraft();
- public String getVersion();
- public String getDomainDir();
- public String getConfigPolicyType();
- public String getJsonBody();
- public Integer getHighestVersion();
- public URI getLocation();
- public String getActionPerformer();
- public String getActionAttribute();
- public String getActionBody();
- public Map<String, String> getDropDownMap();
- public String getActionDictHeader();
- public String getActionDictType();
- public String getActionDictUrl();
- public String getActionDictMethod();
- public String getServiceType();
- public String getUuid();
- public String getMsLocation();
- public String getPriority();
+
+ public String getPolicyName();
+
+ public String getOldPolicyFileName();
+
+ public String getPolicyDescription();
+
+ public String getOnapName();
+
+ public String getConfigName();
+
+ public Map<String, String> getDynamicFieldConfigAttributes();
+
+ public Map<String, String> getTreatments();
+
+ public Map<String, String> getDynamicSettingsMap();
+
+ public List<String> getDynamicRuleAlgorithmLabels();
+
+ public List<String> getDynamicRuleAlgorithmCombo();
+
+ public List<String> getDynamicRuleAlgorithmField1();
+
+ public List<String> getDynamicRuleAlgorithmField2();
+
+ public List<Object> getDynamicVariableList();
+
+ public List<String> getDataTypeList();
+
+ public String getConfigBodyData();
+
+ public String getPolicyID();
+
+ public String getRuleID();
+
+ public String getConfigType();
+
+ public Boolean isEditPolicy();
+
+ public Boolean isDraft();
+
+ public String getVersion();
+
+ public String getDomainDir();
+
+ public String getConfigPolicyType();
+
+ public String getJsonBody();
+
+ public Integer getHighestVersion();
+
+ public URI getLocation();
+
+ public String getActionPerformer();
+
+ public String getActionAttribute();
+
+ public String getActionBody();
+
+ public Map<String, String> getDropDownMap();
+
+ public String getActionDictHeader();
+
+ public String getActionDictType();
+
+ public String getActionDictUrl();
+
+ public String getActionDictMethod();
+
+ public String getServiceType();
+
+ public String getUuid();
+
+ public String getMsLocation();
+
+ public String getPriority();
+
public String getDeleteCondition();
+
public String getDictionaryType();
+
public String getDictionary();
+
public String getDictionaryFields();
- public String getRiskLevel();
- public String getGuard();
- public String getRiskType();
- public String getTTLDate();
+
+ public String getRiskLevel();
+
+ public String getGuard();
+
+ public String getRiskType();
+
+ public String getTTLDate();
}
diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPDP.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPDP.java
index 65db0b980..6224e38cd 100644
--- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPDP.java
+++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPDP.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* ONAP-XACML
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2019 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.
@@ -17,28 +17,25 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.xacml.api.pap;
-import org.onap.policy.xacml.std.pap.StdPDP;
+package org.onap.policy.xacml.api.pap;
import com.att.research.xacml.api.pap.PDP;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import org.onap.policy.xacml.std.pap.StdPDP;
+
/*
* The following allows us to use Jackson to convert sub-types of this type into JSON and back to objects.
*/
-@JsonTypeInfo(
- use = JsonTypeInfo.Id.NAME,
- include = JsonTypeInfo.As.PROPERTY,
- property = "PDPType")
-@JsonSubTypes({
- @Type(value = StdPDP.class, name = "StdPDP") })
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PDPType")
+@JsonSubTypes({@Type(value = StdPDP.class, name = "StdPDP")})
public interface OnapPDP extends PDP {
- public Integer getJmxPort();
-
- public void setJmxPort(Integer jmxport);
-
+ public Integer getJmxPort();
+
+ public void setJmxPort(Integer jmxport);
+
}
diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPDPGroup.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPDPGroup.java
index 7d3ad0c63..77561652a 100644
--- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPDPGroup.java
+++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/OnapPDPGroup.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* ONAP-XACML
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2019 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.
@@ -20,16 +20,16 @@
package org.onap.policy.xacml.api.pap;
-import java.util.Set;
-
import com.att.research.xacml.api.pap.PDPGroup;
import com.att.research.xacml.api.pap.PDPPolicy;
+import java.util.Set;
+
public interface OnapPDPGroup extends PDPGroup {
- public Set<OnapPDP> getOnapPdps();
-
- public Set<PDPPolicy> getSelectedPolicies();
-
- public String getOperation();
+ public Set<OnapPDP> getOnapPdps();
+
+ public Set<PDPPolicy> getSelectedPolicies();
+
+ public String getOperation();
}
diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/PAPPolicyEngine.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/PAPPolicyEngine.java
index cae7456bc..cfb1434bc 100644
--- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/PAPPolicyEngine.java
+++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/api/pap/PAPPolicyEngine.java
@@ -23,6 +23,7 @@ package org.onap.policy.xacml.api.pap;
import com.att.research.xacml.api.pap.PAPException;
import com.att.research.xacml.api.pap.PDPPolicy;
import com.att.research.xacml.api.pap.PDPStatus;
+
import java.io.InputStream;
import java.util.Set;