<dependencies>
<dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jakarta.xml.bind</groupId>
- <artifactId>jakarta.xml.bind-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-runtime</artifactId>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>capabilities</artifactId>
+ <version>${policy.common.version}</version>
</dependency>
<dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>guard</artifactId>
- <version>${policy.models.version}</version>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>gson</artifactId>
+ <version>${policy.common.version}</version>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<version>${policy.common.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>guard</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-examples</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>com.att.research.xacml</groupId>
<artifactId>xacml-pdp</artifactId>
- <version>4.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.persistence</groupId>
+ <artifactId>jakarta.persistence-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jaxb</groupId>
+ <artifactId>jaxb-runtime</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models</groupId>
- <artifactId>policy-models-examples</artifactId>
- <version>${policy.models.version}</version>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-junit-jupiter</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
</project>
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public class GetOperationOutcomePip extends StdOnapPip {
public static final String ISSUER_NAME = "get-operation-outcome";
- private static Logger logger = LoggerFactory.getLogger(GetOperationOutcomePip.class);
+ private static final Logger logger = LoggerFactory.getLogger(GetOperationOutcomePip.class);
public GetOperationOutcomePip() {
super();
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.common.gson.GsonMessageBodyHandler;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.common.gson.GsonMessageBodyHandler;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardYamlCoder;
import org.onap.policy.common.utils.network.NetworkUtil;
ONAP Policy Engine - XACML PDP
================================================================================
Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2023 Nordix Foundation.
+ Modifications Copyright (C) 2023-2024 Nordix Foundation.
================================================================================
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.
<artifactId>common</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.xacml-pdp</groupId>
<artifactId>xacml-test</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>guard</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.persistence</groupId>
+ <artifactId>jakarta.persistence-api</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>utils</artifactId>
<version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
+<!--
+ ============LICENSE_START=======================================================
+ ONAP Policy Engine - XACML PDP
+ ================================================================================
+ Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ Modifications Copyright (C) 2023-2024 Nordix Foundation.
+ ================================================================================
+ 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=========================================================
+ -->
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020, 2024 Nordix Foundation.
* Modifications Copyright (C) 2024 Deutsche Telekom AG.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* This class implements one translator that interprets TOSCA policy and decision API request/response payload.
*
* @author Chenfei Gao (cgao@research.att.com)
- *
*/
@NoArgsConstructor
public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
protected String getNativeXacmlPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException {
var nativeDefinition = ToscaPolicyTranslatorUtils.decodeProperties(toscaPolicy.getProperties(),
- NativeDefinition.class);
+ NativeDefinition.class);
LOGGER.debug("Base64 encoded native xacml policy {}", nativeDefinition.getPolicy());
return nativeDefinition.getPolicy();
policySetType.setVersion(String.valueOf(toscaPolicy.getMetadata().get("policy-version")));
policySetType.setDescription(String.valueOf(toscaPolicy.getMetadata().get(DESCRIPTION)));
policySetType.setTarget(setPolicySetTarget(toscaPolicy.getMetadata().get("action")));
- for (Map<String, Object> type: (List<Map<String, Object>>) toscaPolicy.getProperties().get("policies")) {
+ for (Map<String, Object> type : (List<Map<String, Object>>) toscaPolicy.getProperties().get("policies")) {
ToscaPolicy policy = new ToscaPolicy();
policy.setMetadata((Map<String, Object>) type.get("metadata"));
policy.setProperties((Map<String, Object>) type.get("properties"));
ObjectFactory objectFactory = new ObjectFactory();
policySetType.getPolicySetOrPolicyOrPolicySetIdReference()
- .add(objectFactory.createPolicy(convertPolicyXacml(policy)));
+ .add(objectFactory.createPolicy(convertPolicyXacml(policy)));
}
return policySetType;
}
Map<String, Object> properties = toscaPolicy.getProperties();
if (properties.get("combiningAlgo") != null) {
policyType.setRuleCombiningAlgId(validateFilterPropertyFunction((String)
- properties.get("combiningAlgo")).stringValue());
+ properties.get("combiningAlgo")).stringValue());
} else {
policyType.setRuleCombiningAlgId(XACML3.ID_RULE_FIRST_APPLICABLE.stringValue());
}
}
private void setAdviceExpression(RuleType ruleType, Map<String, Object> rule)
- throws ToscaPolicyConversionException {
+ throws ToscaPolicyConversionException {
String decision = (String) rule.get("decision");
if ("Deny".equalsIgnoreCase(decision)) {
ruleType.setEffect(EffectType.DENY);
String datatype = getDatatype(operator);
matchType.setMatchId(validateFilterPropertyFunction(operator).stringValue());
var valueType = setAttributeValueType(match.get(VALUE),
- validateFilterPropertyFunction(datatype).stringValue());
+ validateFilterPropertyFunction(datatype).stringValue());
matchType.setAttributeValue(valueType);
String attribute = "";
String category = "";
if (((String) match.get("key")).contains("action")) {
attribute = validateFilterPropertyFunction((String) match
- .get("key")).stringValue();
+ .get("key")).stringValue();
category = XACML3.ID_ATTRIBUTE_CATEGORY_ACTION.stringValue();
} else {
attribute = (String) match.get("key");
category = XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue();
}
var designator = setAttributeDesignatorType(attribute, category,
- validateFilterPropertyFunction(datatype).stringValue(), false);
+ validateFilterPropertyFunction(datatype).stringValue(), false);
matchType.setAttributeDesignator(designator);
listMatch.add(matchType);
}
var valueType = setAttributeValueType(value, XACML3.ID_DATATYPE_STRING.stringValue());
matchType.setAttributeValue(valueType);
var designator = setAttributeDesignatorType(XACML3.ID_ACTION_ACTION_ID.stringValue(),
- XACML3.ID_ATTRIBUTE_CATEGORY_ACTION.stringValue(),
- XACML3.ID_DATATYPE_STRING.stringValue(), false);
+ XACML3.ID_ATTRIBUTE_CATEGORY_ACTION.stringValue(),
+ XACML3.ID_DATATYPE_STRING.stringValue(), false);
matchType.setAttributeDesignator(designator);
var anyOfType = new AnyOfType();
anyOfType.getAllOf().add(ToscaPolicyTranslatorUtils.buildAllOf(matchType));
keyList.add(setApply((Map<String, Object>) ((Map<?, ?>) keyObject).get(APPLY)));
} else {
throw new ToscaPolicyConversionException(
- "Invalid key entry, object does not contain list, function or apply");
+ "Invalid key entry, object does not contain list, function or apply");
}
} else {
setAttributes(keyObject, keyList, datatype, factory);
private void setAttributeAndDesignator(List<Object> keyList, ApplyType apply, ObjectFactory factory) {
keyList.stream()
- .sorted((firstKey, secondKey) -> {
- if (firstKey instanceof AttributeValueType) {
- return -1;
- } else if (firstKey instanceof ApplyType) {
- return 1;
- }
- return 0;
- })
- .forEach(key -> {
- if (key instanceof AttributeValueType) {
- apply.getExpression().add(factory.createAttributeValue((AttributeValueType) key));
- }
- if (key instanceof ApplyType) {
- apply.getExpression().add(factory.createApply((ApplyType) key));
- }
- });
+ .sorted((firstKey, secondKey) -> {
+ if (firstKey instanceof AttributeValueType) {
+ return -1;
+ } else if (firstKey instanceof ApplyType) {
+ return 1;
+ }
+ return 0;
+ })
+ .forEach(key -> {
+ if (key instanceof AttributeValueType) {
+ apply.getExpression().add(factory.createAttributeValue((AttributeValueType) key));
+ }
+ if (key instanceof ApplyType) {
+ apply.getExpression().add(factory.createApply((ApplyType) key));
+ }
+ });
}
private void setAttributes(Object key, List<Object> keyList, String datatype, ObjectFactory factory)
- throws ToscaPolicyConversionException {
+ throws ToscaPolicyConversionException {
try {
- if (key instanceof String) {
- String value = (String) key;
+ if (key instanceof String value) {
if (value.startsWith("'") && value.endsWith("'")) {
AttributeValueType attributeValue = setAttributeValueType(value.substring(1, value.length() - 1),
- validateFilterPropertyFunction(datatype).stringValue());
+ validateFilterPropertyFunction(datatype).stringValue());
keyList.add(attributeValue);
} else {
var keyDesignator = setAttributeDesignatorType(value,
- XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
- validateFilterPropertyFunction(datatype).stringValue(), false);
+ XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
+ validateFilterPropertyFunction(datatype).stringValue(), false);
ApplyType keyApply = new ApplyType();
keyApply.setFunctionId(validateFilterPropertyFunction(datatype + ONE_AND_ONLY).stringValue());
keyApply.getExpression().add(factory.createAttributeDesignator(keyDesignator));
}
} else {
AttributeValueType attributeValue = setAttributeValueType(key,
- validateFilterPropertyFunction(datatype).stringValue());
+ validateFilterPropertyFunction(datatype).stringValue());
keyList.add(attributeValue);
}
} catch (NullPointerException ex) {
}
private void setBagApply(ApplyType apply, List<Object> list, String datatype, ObjectFactory factory)
- throws ToscaPolicyConversionException {
+ throws ToscaPolicyConversionException {
try {
var bagApply = new ApplyType();
bagApply.setFunctionId(validateFilterPropertyFunction(datatype + "-bag").stringValue());
for (Object attribute : list) {
if (attribute instanceof String && !(((String) attribute).startsWith("'")
- && ((String) attribute).endsWith("'"))) {
+ && ((String) attribute).endsWith("'"))) {
var applyDesignator = new ApplyType();
applyDesignator.setFunctionId(
- validateFilterPropertyFunction(datatype + ONE_AND_ONLY).stringValue());
+ validateFilterPropertyFunction(datatype + ONE_AND_ONLY).stringValue());
var designator = setAttributeDesignatorType((String) attribute,
- XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
- validateFilterPropertyFunction(datatype).stringValue(), false);
+ XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
+ validateFilterPropertyFunction(datatype).stringValue(), false);
applyDesignator.getExpression().add(factory.createAttributeDesignator(designator));
bagApply.getExpression().add(factory.createApply(applyDesignator));
}
}
for (Object attribute : list) {
- if (attribute instanceof String) {
- String value = (String) attribute;
+ if (attribute instanceof String value) {
if (value.startsWith("'") && value.endsWith("'")) {
var attributeValue = setAttributeValueType(value.substring(1, value.length() - 1),
- validateFilterPropertyFunction(datatype).stringValue());
+ validateFilterPropertyFunction(datatype).stringValue());
bagApply.getExpression().add(factory.createAttributeValue(attributeValue));
}
} else {
var attributeValue = setAttributeValueType(attribute,
- validateFilterPropertyFunction(datatype).stringValue());
+ validateFilterPropertyFunction(datatype).stringValue());
bagApply.getExpression().add(factory.createAttributeValue(attributeValue));
}
}
}
private void setFunctionType(ApplyType apply, String function, ObjectFactory factory)
- throws ToscaPolicyConversionException {
+ throws ToscaPolicyConversionException {
try {
var functionType = new FunctionType();
functionType.setFunctionId(validateFilterPropertyFunction(function).stringValue());
apply.getExpression().add(factory.createApply(compareApply));
} else if (compareWith.get(VALUE) != null) {
var attributeValue = setAttributeValueType(compareWith.get(VALUE),
- validateFilterPropertyFunction(datatype).stringValue());
+ validateFilterPropertyFunction(datatype).stringValue());
apply.getExpression().add(factory.createAttributeValue(attributeValue));
} else if (compareWith.get("key") != null) {
var keyDesignator = setAttributeDesignatorType((String) compareWith.get("key"),
- XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
- validateFilterPropertyFunction(datatype).stringValue(), false);
+ XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
+ validateFilterPropertyFunction(datatype).stringValue(), false);
var keyApply = new ApplyType();
keyApply.setFunctionId(validateFilterPropertyFunction(datatype + ONE_AND_ONLY).stringValue());
keyApply.getExpression().add(factory.createAttributeDesignator(keyDesignator));
}
private AdviceExpressionsType setAdvice(Map<String, Object> advice, String decision)
- throws ToscaPolicyConversionException {
+ throws ToscaPolicyConversionException {
var adviceExpressions = new AdviceExpressionsType();
try {
var adviceExpression = new AdviceExpressionType();
return DOUBLE;
}
List<String> datatypes = Arrays.asList("string", "boolean", "integer", DOUBLE, "time", "date", "dateTime",
- "dayTimeDuration", "yearMonthDuration", "anyURI", "hexBinary", "rfc822Name", "base64Binary",
- "x500Name", "ipAddress", "dnsName");
+ "dayTimeDuration", "yearMonthDuration", "anyURI", "hexBinary", "rfc822Name", "base64Binary",
+ "x500Name", "ipAddress", "dnsName");
if (datatypes.stream().anyMatch(operator::contains)) {
return operator.split("-")[0];
}
identifierMap.put("datetime-add-yearmonthduration", XACML3.ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION);
identifierMap.put("datetime-subtract-daytimeturation", XACML3.ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION);
identifierMap.put("datetime-subtract-yearmonthduration",
- XACML3.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION);
+ XACML3.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION);
identifierMap.put("date-add-yearmonthduration", XACML3.ID_FUNCTION_DATE_ADD_YEARMONTHDURATION);
identifierMap.put("date-subtract-yearmonthduration", XACML3.ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION);
identifierMap.put("time-greater-than", XACML3.ID_FUNCTION_TIME_GREATER_THAN);
identifierMap.put("hexbinary-set-equals", XACML3.ID_FUNCTION_HEXBINARY_SET_EQUALS);
identifierMap.put("base64binary-intersection", XACML3.ID_FUNCTION_BASE64BINARY_INTERSECTION);
identifierMap.put("base64binary-at-least-one-member-of",
- XACML3.ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF);
+ XACML3.ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF);
identifierMap.put("base64binary-union", XACML3.ID_FUNCTION_BASE64BINARY_UNION);
identifierMap.put("base64binary-subset", XACML3.ID_FUNCTION_BASE64BINARY_SUBSET);
identifierMap.put("base64binary-set-equals", XACML3.ID_FUNCTION_BASE64BINARY_SET_EQUALS);
identifierMap.put("daytimeduration-intersection", XACML3.ID_FUNCTION_DAYTIMEDURATION_INTERSECTION);
identifierMap.put("daytimeduration-at-least-one-member-of",
- XACML3.ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF);
+ XACML3.ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF);
identifierMap.put("daytimeduration-union", XACML3.ID_FUNCTION_DAYTIMEDURATION_UNION);
identifierMap.put("daytimeduration-subset", XACML3.ID_FUNCTION_DAYTIMEDURATION_SUBSET);
identifierMap.put("daytimeduration-set-equals", XACML3.ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS);
identifierMap.put("yearmonthduration-intersection", XACML3.ID_FUNCTION_YEARMONTHDURATION_INTERSECTION);
identifierMap.put("yearmonthduration-at-least-one-member-of",
- XACML3.ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF);
+ XACML3.ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF);
identifierMap.put("yearmonthduration-union", XACML3.ID_FUNCTION_YEARMONTHDURATION_UNION);
identifierMap.put("yearmonthduration-subset", XACML3.ID_FUNCTION_YEARMONTHDURATION_SUBSET);
identifierMap.put("yearmonthduration-set-equals", XACML3.ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS);
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.
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
</properties>
<dependencies>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>capabilities</artifactId>
- <version>${policy.common.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
- <version>${policy.common.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>common-parameters</artifactId>
- <version>${policy.common.version}</version>
- </dependency>
<dependency>
<groupId>org.onap.policy.xacml-pdp.applications</groupId>
<artifactId>common</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>utils-test</artifactId>
- <version>${policy.common.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.xacml-pdp.applications</groupId>
<artifactId>xacml-monitoring</artifactId>
<version>${project.version}</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.onap.policy.xacml-pdp.applications</groupId>
<artifactId>xacml-guard</artifactId>
<version>${project.version}</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.onap.policy.xacml-pdp.applications</groupId>
<artifactId>xacml-match</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>capabilities</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>gson</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-base</artifactId>
+ <version>${policy.models.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-errors</artifactId>
+ <version>${policy.models.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-pdp</artifactId>
<version>${policy.models.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.prometheus</groupId>
+ <artifactId>simpleclient</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.validation</groupId>
+ <artifactId>jakarta.validation-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.toolchain</groupId>
+ <artifactId>jetty-jakarta-servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-client</artifactId>
+ </dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_logback</artifactId>
<artifactId>kafka-clients</artifactId>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.media</groupId>
+ <artifactId>jersey-media-json-jackson</artifactId>
+ <version>${version.jersey}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils-test</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.onap.policy.xacml-pdp</groupId>
<artifactId>xacml-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
- <!-- Swagger v3 annotations -->
- <dependency>
- <groupId>io.swagger.core.v3</groupId>
- <artifactId>swagger-annotations</artifactId>
- </dependency>
<dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcpkix-fips</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-junit-jupiter</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.glassfish.jersey.media</groupId>
- <artifactId>jersey-media-json-jackson</artifactId>
- <version>${version.jersey}</version>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
<generateModels>false</generateModels>
<generateSupportingFiles>false</generateSupportingFiles>
<importMappings>
- HealthCheckReport=org.onap.policy.common.endpoints.report.HealthCheckReport,
+ HealthCheckReport=org.onap.policy.common.utils.report.HealthCheckReport,
DecisionException=org.onap.policy.models.decisions.concepts.DecisionException,
DecisionRequest=org.onap.policy.models.decisions.concepts.DecisionRequest,
DecisionResponse=org.onap.policy.models.decisions.concepts.DecisionResponse,
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import lombok.Getter;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClient;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClient;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
* @param state tracks the state of this PDP
*/
public XacmlPdpHearbeatPublisher(BidirectionalTopicClient topicChecker, long probeHeartbeatTopicMs,
- XacmlState state) {
+ XacmlState state) {
LOGGER.info("heartbeat topic probe {}ms", probeHeartbeatTopicMs);
this.topicChecker = topicChecker;
this.probeHeartbeatTopicMs = probeHeartbeatTopicMs;
* ONAP
* ================================================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.pdpx.main.comm;
import lombok.AllArgsConstructor;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClientException;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClientException;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Sends PDP register and unregister message to the PAP.
+ *
* @param status of the PDP
* @throws TopicSinkClientException if the topic sink does not exist
*/
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.AllArgsConstructor;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
// incoming data
Map<ToscaConceptIdentifier, ToscaPolicy> toBeDeployedPolicies = policyToMap(message.getPoliciesToBeDeployed());
List<ToscaConceptIdentifier> toBeUndeployedIds =
- Optional.ofNullable(message.getPoliciesToBeUndeployed()).orElse(Collections.emptyList());
+ Optional.ofNullable(message.getPoliciesToBeUndeployed()).orElse(Collections.emptyList());
var stats = XacmlPdpStatisticsManager.getCurrent();
// Undeploy policies
- for (ToscaConceptIdentifier policyId: toBeUndeployedIds) {
+ for (ToscaConceptIdentifier policyId : toBeUndeployedIds) {
ToscaPolicy policy = deployedPolicies.get(policyId);
if (policy == null) {
LOGGER.warn("attempt to undeploy policy that has not been previously deployed: {}", policyId);
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.pdpx.main.comm.listeners;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClientException;
import org.onap.policy.common.endpoints.listeners.ScoListener;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClientException;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.pdp.concepts.PdpStatus;
* Constructs the object.
*
* @param client used to send back response after receiving state change message
- * @param state tracks the state of this PDP
+ * @param state tracks the state of this PDP
*/
public XacmlPdpStateChangeListener(TopicSinkClient client, XacmlState state) {
super(PdpStateChange.class);
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.pdpx.main.comm.listeners;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
import org.onap.policy.common.endpoints.listeners.ScoListener;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
import org.onap.policy.pdpx.main.XacmlState;
/**
* Constructs the object.
*
- * @param client used to send back response after receiving state change message
- * @param state tracks the state of this PDP
- * @param heartbeat heart beat publisher
+ * @param client used to send back response after receiving state change message
+ * @param state tracks the state of this PDP
+ * @param heartbeat heart beat publisher
* @param appManager application manager
*/
public XacmlPdpUpdateListener(TopicSinkClient client, XacmlState state, XacmlPdpHearbeatPublisher heartbeat,
- XacmlPdpApplicationManager appManager) {
+ XacmlPdpApplicationManager appManager) {
super(PdpUpdate.class);
this.state = state;
this.heartbeat = heartbeat;
// these may be overridden by junit tests
protected XacmlPdpUpdatePublisher makePublisher(TopicSinkClient client, XacmlState state,
- XacmlPdpApplicationManager appManager) {
+ XacmlPdpApplicationManager appManager) {
return new XacmlPdpUpdatePublisher(client, state, appManager);
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.common.parameters.ParameterGroupImpl;
import org.onap.policy.common.parameters.ValidationStatus;
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.common.parameters.annotations.Valid;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
import org.onap.policy.models.base.Validated;
/**
* Class to hold all parameters needed for xacml pdp component.
- *
*/
@Getter
@NotNull
/**
* Create the xacml pdp parameter group.
*
- * @param name the parameter group name
+ * @param name the parameter group name
* @param pdpGroup the pdp group name
*/
public XacmlPdpParameterGroup(final String name, final String pdpGroup, final String pdpType,
- final RestServerParameters restServerParameters, final RestClientParameters policyApiParameters,
- final TopicParameterGroup topicParameterGroup, final XacmlApplicationParameters applicationParameters) {
+ final RestServerParameters restServerParameters,
+ final RestClientParameters policyApiParameters,
+ final TopicParameterGroup topicParameterGroup,
+ final XacmlApplicationParameters applicationParameters) {
super(name);
this.pdpGroup = pdpGroup;
this.pdpType = pdpType;
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.pdpx.main.parameters;
import java.io.File;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
import org.onap.policy.common.parameters.ValidationResult;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.pdpx.main.PolicyXacmlPdpException;
import org.slf4j.LoggerFactory;
-
/**
* This class handles reading, parsing and validating of policy xacml pdp parameters from JSON
* files.
* @throws PolicyXacmlPdpException on parameter exceptions
*/
public XacmlPdpParameterGroup getParameters(final XacmlPdpCommandLineArguments arguments)
- throws PolicyXacmlPdpException {
+ throws PolicyXacmlPdpException {
XacmlPdpParameterGroup xacmlPdpParameterGroup = null;
try {
// Read the parameters from JSON
xacmlPdpParameterGroup = CODER.decode(new File(arguments.getFullConfigurationFilePath()),
- XacmlPdpParameterGroup.class);
+ XacmlPdpParameterGroup.class);
} catch (final Exception e) {
final String errorMessage = "error reading parameters from \"" + arguments.getConfigurationFilePath()
- + "\"\n" + "(" + e.getClass().getSimpleName() + "):" + e.getMessage();
+ + "\"\n" + "(" + e.getClass().getSimpleName() + "):" + e.getMessage();
LOGGER.error(errorMessage);
throw new PolicyXacmlPdpException(errorMessage, e);
}
final ValidationResult validationResult = xacmlPdpParameterGroup.validate();
if (!validationResult.isValid()) {
String returnMessage =
- "validation error(s) on parameters from \"" + arguments.getConfigurationFilePath() + "\"\n";
+ "validation error(s) on parameters from \"" + arguments.getConfigurationFilePath() + "\"\n";
returnMessage += validationResult.getResult();
LOGGER.error(returnMessage);
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.pdpx.main.rest.provider;
-import org.onap.policy.common.endpoints.report.HealthCheckReport;
+import org.onap.policy.common.utils.report.HealthCheckReport;
import org.onap.policy.pdpx.main.XacmlState;
import org.onap.policy.pdpx.main.startstop.XacmlPdpActivator;
/**
* Class to fetch health check of xacml pdp service.
- *
*/
public class HealthCheckProvider {
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.List;
import lombok.Getter;
import lombok.Setter;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClient;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClientException;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
import org.onap.policy.common.endpoints.http.client.HttpClient;
import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.listeners.MessageTypeDispatcher;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClient;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClientException;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
import org.onap.policy.common.parameters.ParameterService;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
import org.onap.policy.common.utils.services.ServiceManagerContainer;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.models.pdp.enums.PdpMessageType;
HttpClient apiClient = HttpClientFactoryInstance.getClientFactory().build(apiClientParams);
var appmgr = new XacmlPdpApplicationManager(xacmlPdpParameterGroup.getApplicationParameters(),
- apiClient);
+ apiClient);
XacmlPdpApplicationManager.setCurrent(appmgr);
var stats = new XacmlPdpStatisticsManager();
sinkClient = new TopicSinkClient(topicClient.getSink());
heartbeat = new XacmlPdpHearbeatPublisher(topicClient,
- xacmlPdpParameterGroup.getProbeHeartbeatTopicSec() * 1000, state);
+ xacmlPdpParameterGroup.getProbeHeartbeatTopicSec() * 1000, state);
/*
* since the dispatcher isn't registered with the topic yet, we can go ahead
* and register the listeners with it.
*/
msgDispatcher.register(PdpMessageType.PDP_STATE_CHANGE.name(),
- new XacmlPdpStateChangeListener(sinkClient, state));
+ new XacmlPdpStateChangeListener(sinkClient, state));
msgDispatcher.register(PdpMessageType.PDP_UPDATE.name(),
- new XacmlPdpUpdateListener(sinkClient, state, heartbeat, appmgr));
+ new XacmlPdpUpdateListener(sinkClient, state, heartbeat, appmgr));
XacmlPdpServiceFilter.disableApi();
restServer = new XacmlPdpRestServer(xacmlPdpParameterGroup.getRestServerParameters(),
- List.of(XacmlPdpServiceFilter.class), List.of(XacmlPdpRestController.class));
+ List.of(XacmlPdpServiceFilter.class), List.of(XacmlPdpRestController.class));
} catch (RuntimeException | HttpClientConfigException | BidirectionalTopicClientException e) {
throw new PolicyXacmlPdpRuntimeException(e.getMessage(), e);
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.onap.policy.common.endpoints.http.server.RestServer;
import org.onap.policy.common.endpoints.http.server.YamlExceptionMapper;
import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.common.gson.GsonMessageBodyHandler;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
import org.onap.policy.pdpx.main.rest.serialization.XacmlJsonExceptionMapper;
import org.onap.policy.pdpx.main.rest.serialization.XacmlJsonMessageBodyHandler;
import org.onap.policy.pdpx.main.rest.serialization.XacmlXmlExceptionMapper;
import jakarta.ws.rs.core.MediaType;
import java.io.File;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.SecureRandom;
+import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.net.ssl.SSLContext;
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
static {
try {
File file = new File(ResourceUtils.getFilePath4Resource("parameters/XacmlPdpConfigParameters_Std.json"));
- STD_CONFIG = new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8);
+ STD_CONFIG = Files.readString(file.toPath());
file = new File(file.getParentFile(), "Test_XacmlPdpConfigParameters.json");
file.deleteOnExit();
* Writes a JSON config file, substituting an allocated port number for occurrences of
* "${port}".
*
- * @return the allocated server port
* @throws IOException if the config file cannot be created
*/
- public static int writeJsonConfig() throws IOException {
+ public static void writeJsonConfig() throws IOException {
port = NetworkUtil.allocPort();
String config = STD_CONFIG.replace("${port}", String.valueOf(port));
- Files.write(CONFIG_PATH, config.getBytes(StandardCharsets.UTF_8));
+ Files.writeString(CONFIG_PATH, config);
- return port;
}
/**
// always trust the host name
final ClientBuilder clientBuilder =
- ClientBuilder.newBuilder().sslContext(sc).hostnameVerifier((host, session) -> true);
+ ClientBuilder.newBuilder().sslContext(sc).hostnameVerifier((host, session) -> true);
final Client client = clientBuilder.build();
final HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic("healthcheck", "zb!XztG34");
*/
private void markActivator(boolean newAlive) {
Object manager = ReflectionTestUtils.getField(XacmlPdpActivator.getCurrent(), "serviceManager");
- AtomicBoolean running = (AtomicBoolean) ReflectionTestUtils.getField(manager, "running");
- running.set(newAlive);
+ AtomicBoolean running = (AtomicBoolean) ReflectionTestUtils
+ .getField(Objects.requireNonNull(manager), "running");
+ Objects.requireNonNull(running).set(newAlive);
}
}
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClient;
+import org.onap.policy.common.message.bus.event.TopicSink;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClient;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.pdpx.main.XacmlState;
@ExtendWith(MockitoExtension.class)
-class XacmlPdpHearbeatPublisherTest {
+class XacmlPdpHeartbeatPublisherTest {
private static final long INTERVAL1 = 1000L;
private static final long INTERVAL2 = 2000L;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
import org.onap.policy.models.pdp.concepts.PdpStatus;
@ExtendWith(MockitoExtension.class)
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.pdpx.main.XacmlState;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
import org.onap.policy.pdpx.main.XacmlState;
import org.onap.policy.pdpx.main.comm.XacmlPdpHearbeatPublisher;
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
+import org.onap.policy.common.parameters.topic.TopicParameters;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
/**
* Class to hold/create all parameters for test cases.
- *
*/
public class CommonTestData {
* Converts the contents of a map to a parameter class.
*
* @param source property map
- * @param clazz class of object to be created from the map
+ * @param clazz class of object to be created from the map
* @return a new object represented by the map
*/
public <T> T toObject(final Map<String, Object> source, final Class<T> clazz) {
/**
* Returns a property map for a XacmlApplicationParameters map for test cases.
*
- * @param isEmpty boolean value to represent that object created should be empty or not
- * @param tempPath Application Path string
+ * @param isEmpty boolean value to represent that object created should be empty or not
+ * @param tempPath Application Path string
* @param exclusions An optional list of application classnames for exclusion
* @return a property map suitable for constructing an object
*/
public Map<String, Object> getXacmlapplicationParametersMap(boolean isEmpty, String tempPath,
- String... exclusions) {
+ String... exclusions) {
final Map<String, Object> map = new TreeMap<>();
if (!isEmpty) {
map.put("applicationPath", tempPath);
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
import org.onap.policy.common.parameters.ValidationResult;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
/**
* Class to perform unit test of XacmlPdpParameterGroup.
import java.util.Map;
import java.util.Properties;
import java.util.ServiceLoader;
+import java.util.stream.Stream;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.onap.policy.common.endpoints.http.client.HttpClient;
import org.onap.policy.common.endpoints.http.client.internal.JerseyClient;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.models.decisions.concepts.DecisionRequest;
private static final CommonTestData testData = new CommonTestData();
private static final Properties properties = new Properties();
- private static File propertiesFile;
private static XacmlApplicationServiceProvider service;
@TempDir
//
Path src = Paths.get("src/test/resources/apps");
File apps = appsFolder.resolve("apps").toFile();
- Files.walk(src).forEach(source -> copy(source, apps.toPath().resolve(src.relativize(source))));
+
+ try (Stream<Path> sources = Files.walk(src)) {
+ sources.forEach(source -> copy(source, apps.toPath().resolve(src.relativize(source))));
+ }
// Start the Monitoring Application
startXacmlApplicationService(apps);
throws XacmlApplicationException, IOException {
LOGGER.info("****** Starting Xacml Application Service ******");
//
- // Setup our temporary folder
+ // Set up our temporary folder
//
XacmlPolicyUtils.FileCreator myCreator = (String filename) -> {
- new File(apps, "monitoring/" + filename).delete();
+ var deleted = new File(apps, "monitoring/" + filename).delete();
+ LOGGER.info("was file deleted? {}", deleted);
return appsFolder.resolve("apps/monitoring/" + filename).toFile();
};
- propertiesFile = XacmlPolicyUtils.copyXacmlPropertiesContents(
+ File propertiesFile = XacmlPolicyUtils.copyXacmlPropertiesContents(
"../applications/monitoring/src/test/resources/xacml.properties", properties, myCreator);
//
// Load XacmlApplicationServiceProvider service
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import java.util.stream.Stream;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.onap.policy.common.endpoints.http.client.HttpClient;
import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.decisions.concepts.DecisionRequest;
//
Path src = Paths.get("src/test/resources/apps");
File apps = appsFolder.resolve("apps").toFile();
- Files.walk(src).forEach(source -> {
- copy(source, apps.toPath().resolve(src.relativize(source)));
- });
+
+ try (Stream<Path> sources = Files.walk(src)) {
+ sources.forEach(source -> copy(source, apps.toPath().resolve(src.relativize(source))));
+ }
//
// Get the parameters file correct.
//
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.report.HealthCheckReport;
+import org.onap.policy.common.utils.report.HealthCheckReport;
import org.onap.policy.pdpx.main.CommonRest;
import org.onap.policy.pdpx.main.XacmlState;
import org.onap.policy.pdpx.main.rest.model.StatisticsReport;
<policy.common.version>3.0.1-SNAPSHOT</policy.common.version>
<policy.models.version>4.0.1-SNAPSHOT</policy.models.version>
<jacoco.dataFile>${project.basedir}/target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
+ <xacml.version>4.0.0</xacml.version>
</properties>
<modules>
<module>tutorials</module>
</modules>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml-pdp</artifactId>
+ <version>${xacml.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml</artifactId>
+ <version>${xacml.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-ext</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </dependency>
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- </dependency>
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- </dependency>
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models</groupId>
- <artifactId>policy-models-decisions</artifactId>
- <version>${policy.models.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models</groupId>
- <artifactId>policy-models-tosca</artifactId>
- <version>${policy.models.version}</version>
</dependency>
</dependencies>
================================================================================
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2020 Bell Canada.
- Modifications Copyright (C) 2023 Nordix Foundation.
+ Modifications Copyright (C) 2023-2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>policy-models-pap</artifactId>
<version>${policy.models.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>policy-endpoints</artifactId>
<version>${policy.common.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
</dependencies>
+
<build>
<plugins>
<plugin>
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.TopicListener;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClient;
import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.TopicListener;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
+import org.onap.policy.common.parameters.topic.TopicParameters;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.models.decisions.concepts.DecisionRequest;
ONAP Policy Engine - XACML Application Tutorial
================================================================================
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2022-2023 Nordix Foundation.
+ Modifications Copyright (C) 2022-2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.att.research.xacml</groupId>
+ <artifactId>xacml</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<profiles>
import org.onap.policy.models.decisions.concepts.DecisionResponse;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
import org.onap.policy.pdp.xacml.application.common.ToscaDictionary;
-import org.onap.policy.pdp.xacml.application.common.ToscaPolicyConversionException;
import org.onap.policy.pdp.xacml.application.common.ToscaPolicyTranslatorUtils;
import org.onap.policy.pdp.xacml.application.common.std.StdBaseTranslator;
ONAP
================================================================================
Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2023 Nordix Foundation.
+ Modifications Copyright (C) 2023-2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
<groupId>org.onap.policy.common</groupId>
<artifactId>utils</artifactId>
<version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
</dependency>
</dependencies>
</project>