<!--
============LICENSE_START=======================================================
- Copyright (C) 2019,2023 Nordix Foundation.
+ Copyright (C) 2019, 2023 Nordix Foundation.
Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (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 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>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-base</artifactId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base;
+import java.io.Serial;
import java.io.Serializable;
import java.util.List;
import lombok.AccessLevel;
/**
* This class is the base class for all Policy Framework concept classes. It enforces implementation of abstract methods
- * and interfaces on all concepts that are sub-classes of this class.
+ * and interfaces on all concepts that are subclasses of this class.
*/
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public abstract class PfConcept extends Validated implements Serializable, Comparable<PfConcept> {
+ @Serial
private static final long serialVersionUID = -7434939557282697490L;
/**
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.base;
import com.google.re2j.Pattern;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToMany;
+import jakarta.persistence.MappedSuperclass;
+import jakarta.persistence.Table;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
import java.lang.reflect.ParameterizedType;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.function.Function;
-import javax.persistence.CascadeType;
-import javax.persistence.EmbeddedId;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.MappedSuperclass;
-import javax.persistence.Table;
-import javax.ws.rs.core.Response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
* Each concept entry is checked to ensure that its key and value are not null and that the key matches the key in the
* map value. Each concept entry is then validated individually.
*
- * @param C the concept being contained
+ * @param <C> the concept being contained
*/
//@formatter:on
@MappedSuperclass
@EqualsAndHashCode(callSuper = false)
public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> extends PfConcept
- implements PfConceptGetter<C>, PfAuthorative<List<Map<String, A>>> {
+ implements PfConceptGetter<C>, PfAuthorative<List<Map<String, A>>> {
+ @Serial
private static final long serialVersionUID = -324211738823208318L;
private static final String VALUE_FIELD = "value";
}
/**
- * This Constructor creates an concept container with all of its fields defined.
+ * This Constructor creates a concept container with all of its fields defined.
*
- * @param key the concept container key
+ * @param key the concept container key
* @param conceptMap the concepts to be stored in the concept container
*/
public PfConceptContainer(@NonNull final PfConceptKey key, @NonNull final Map<PfConceptKey, C> conceptMap) {
}
incomingConceptEntry.getValue().setName(findConceptField(conceptKey, conceptKey.getName(),
- incomingConceptEntry.getValue(), PfNameVersion::getDefinedName));
+ incomingConceptEntry.getValue(), PfNameVersion::getDefinedName));
incomingConceptEntry.getValue().setVersion(findConceptField(conceptKey, conceptKey.getVersion(),
- incomingConceptEntry.getValue(), PfNameVersion::getDefinedVersion));
+ incomingConceptEntry.getValue(), PfNameVersion::getDefinedVersion));
var jpaConcept = getConceptNewInstance();
// This cast allows us to call the fromAuthorative method
if (conceptMap.isEmpty()) {
throw new PfModelRuntimeException(Response.Status.BAD_REQUEST,
- "An incoming list of concepts must have at least one entry");
+ "An incoming list of concepts must have at least one entry");
}
}
}
@Override
- public int compareTo(final PfConcept otherConcept) {
- if (otherConcept == null) {
- return -1;
- }
+ public int compareTo(@NonNull final PfConcept otherConcept) {
if (this == otherConcept) {
return 0;
}
return getClass().getName().compareTo(otherConcept.getClass().getName());
}
- @SuppressWarnings("unchecked")
- final PfConceptContainer<C, A> other = (PfConceptContainer<C, A>) otherConcept;
+ @SuppressWarnings("unchecked") final PfConceptContainer<C, A> other = (PfConceptContainer<C, A>) otherConcept;
int retVal = key.compareTo(other.key);
if (retVal != 0) {
return retVal;
/**
* Get all the concepts that match the given name and version.
*
- * @param conceptKeyName the name of the concept, if null, return all names
+ * @param conceptKeyName the name of the concept, if null, return all names
* @param conceptKeyVersion the version of the concept, if null, return all versions
* @return conceptKeyVersion
*/
private C getConceptNewInstance() {
try {
String conceptClassName =
- ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0].getTypeName();
+ ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0].getTypeName();
return (C) Class.forName(conceptClassName).getDeclaredConstructor().newInstance();
} catch (Exception ex) {
throw new PfModelRuntimeException(Response.Status.INTERNAL_SERVER_ERROR,
- "failed to instantiate instance of container concept class", ex);
+ "failed to instantiate instance of container concept class", ex);
}
}
private String findConceptField(final PfConceptKey conceptKey, final String keyFieldValue,
- final PfNameVersion concept, final Function<PfNameVersion, String> fieldGetterFunction) {
+ final PfNameVersion concept,
+ final Function<PfNameVersion, String> fieldGetterFunction) {
String conceptField = fieldGetterFunction.apply(concept);
return keyFieldValue;
} else {
throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, "Key " + conceptKey.getId() + " field "
- + keyFieldValue + " does not match the value " + conceptField + " in the concept field");
+ + keyFieldValue + " does not match the value " + conceptField + " in the concept field");
}
}
}
\ No newline at end of file
package org.onap.policy.models.base;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import java.io.Serial;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
import org.onap.policy.common.utils.validation.Assertions;
/**
- * An concept key uniquely identifies every first order entity in the system. Every first order concept in the system
+ * A concept key uniquely identifies every first order entity in the system. Every first order concept in the system
* must have an {@link PfConceptKey} to identify it. Concepts that are wholly contained in another concept are
* identified using a {@link PfReferenceKey} key.
*
@EqualsAndHashCode(callSuper = false)
@ToString
public class PfConceptKey extends PfKeyImpl {
+ @Serial
private static final long serialVersionUID = 8932717618579392561L;
@Column(name = NAME_TOKEN, length = 120)
/**
* Constructor to create a key with the specified name and version.
*
- * @param name the key name
+ * @param name the key name
* @param version the key version
*/
public PfConceptKey(final String name, final String version) {
*
* @return a null concept key
*/
- public static final PfConceptKey getNullKey() {
+ public static PfConceptKey getNullKey() {
return new PfConceptKey(PfKey.NULL_KEY_NAME, PfKey.NULL_KEY_VERSION);
}
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base;
+import java.io.Serial;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.NonNull;
*/
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public abstract class PfKey extends PfConcept {
+ @Serial
private static final long serialVersionUID = 6281159885962014041L;
/** Regular expression to specify the structure of key names. */
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
@Getter
@ToString
public abstract class PfKeyImpl extends PfKey {
+ @Serial
private static final long serialVersionUID = 8932717618579392561L;
public static final String NAME_TOKEN = "name";
@Override
public PfKey.Compatibility getCompatibility(@NonNull final PfKey otherKey) {
- if (!(otherKey instanceof PfKeyImpl)) {
+ if (!(otherKey instanceof PfKeyImpl otherConceptKey)) {
return Compatibility.DIFFERENT;
}
- final PfKeyImpl otherConceptKey = (PfKeyImpl) otherKey;
if (this.equals(otherConceptKey)) {
return Compatibility.IDENTICAL;
@Override
public boolean isCompatible(@NonNull final PfKey otherKey) {
- if (!(otherKey instanceof PfKeyImpl)) {
+ if (!(otherKey instanceof PfKeyImpl otherConceptKey)) {
return false;
}
- final PfKeyImpl otherConceptKey = (PfKeyImpl) otherKey;
final var compatibility = this.getCompatibility(otherConceptKey);
// There must always be at least one element in each version
if (!thisVersionArray[0].equals(otherVersionArray[0])) {
- return Integer.valueOf(thisVersionArray[0]) > Integer.valueOf(otherVersionArray[0]);
+ return Integer.parseInt(thisVersionArray[0]) > Integer.parseInt(otherVersionArray[0]);
}
if (thisVersionArray.length >= 2 && otherVersionArray.length >= 2
&& !thisVersionArray[1].equals(otherVersionArray[1])) {
- return Integer.valueOf(thisVersionArray[1]) > Integer.valueOf(otherVersionArray[1]);
+ return Integer.parseInt(thisVersionArray[1]) > Integer.parseInt(otherVersionArray[1]);
}
if (thisVersionArray.length >= 3 && otherVersionArray.length >= 3
&& !thisVersionArray[2].equals(otherVersionArray[2])) {
- return Integer.valueOf(thisVersionArray[2]) > Integer.valueOf(otherVersionArray[2]);
+ return Integer.parseInt(thisVersionArray[2]) > Integer.parseInt(otherVersionArray[2]);
}
return false;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base;
+import java.io.Serial;
import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@EqualsAndHashCode(callSuper = false)
@ToString
public class PfKeyUse extends PfKey {
+ @Serial
private static final long serialVersionUID = 2007147220109881705L;
@VerifyKey
}
@Override
- public int compareTo(final PfConcept otherObj) {
+ public int compareTo(@NonNull final PfConcept otherObj) {
Assertions.argumentNotNull(otherObj, "comparison object may not be null");
if (this == otherObj) {
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.base;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.MappedSuperclass;
+import java.io.Serial;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
-import javax.persistence.EmbeddedId;
-import javax.persistence.MappedSuperclass;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
* from this model so all models must have a key and have key information.
*
* <p>Validation checks that the model key is valid. It goes on to check for null keys and checks
- * each key for uniqueness in the model. A check is carried out to ensure that an {@link PfKeyInfo}
+ * each key for uniqueness in the model. A check is carried out to ensure that an {@link PfKey}
* instance exists for every {@link PfConceptKey} key. For each {@link PfReferenceKey} instance, a
- * check is made that its parent and local name are nut null and that a {@link PfKeyInfo} entry
+ * check is made that its parent and local name are not null and that a {@link PfKey} entry
* exists for its parent. Then a check is made that each used {@link PfConceptKey} and
* {@link PfReferenceKey} usage references a key that exists. Finally, a check is made to ensure
- * that an {@link PfConceptKey} instance exists for every {@link PfKeyInfo} instance.
+ * that an {@link PfConceptKey} instance exists for every {@link PfKey} instance.
*
* @param <C> the type of concept on which the interface is applied.
*/
public abstract class PfModel extends PfConcept {
private static final String KEYS_TOKEN = "keys";
+ @Serial
private static final long serialVersionUID = -771659065637205430L;
@EmbeddedId
/**
* Check for consistent usage of an artifact key in the model.
*
- * @param artifactKey The artifact key to check
+ * @param artifactKey The artifact key to check
* @param artifactKeySet The set of artifact keys encountered so far, this key is appended to
- * the set
- * @param result where to add the results
+ * the set
+ * @param result where to add the results
*/
private void validateArtifactKeyInModel(final PfConceptKey artifactKey,
- final Set<PfConceptKey> artifactKeySet, final BeanValidationResult result) {
+ final Set<PfConceptKey> artifactKeySet, final BeanValidationResult result) {
validateKeyNotNull(result, KEYS_TOKEN, artifactKey);
// Null key name start check
if (artifactKey.getName().toUpperCase().startsWith(PfKey.NULL_KEY_NAME)) {
addResult(result2, "name of " + artifactKey.getId(), artifactKey.getName(),
- "starts with keyword " + PfKey.NULL_KEY_NAME);
+ "starts with keyword " + PfKey.NULL_KEY_NAME);
}
// Unique key check
/**
* Check for consistent usage of a reference key in the model.
*
- * @param referenceKey The reference key to check
+ * @param referenceKey The reference key to check
* @param referenceKeySet The set of reference keys encountered so far, this key is appended to
- * the set
- * @param result where to add the results
+ * the set
+ * @param result where to add the results
*/
private void validateReferenceKeyInModel(final PfReferenceKey referenceKey,
- final Set<PfReferenceKey> referenceKeySet, final BeanValidationResult result) {
+ final Set<PfReferenceKey> referenceKeySet,
+ final BeanValidationResult result) {
// Null key check
if (referenceKey.isNullKey()) {
addResult(result, KEYS_TOKEN, referenceKey, IS_A_NULL_KEY);
// Null parent key check
if (referenceKey.getParentConceptKey().isNullKey()) {
addResult(result2, "parent key of " + referenceKey.getId(), referenceKey.getParentConceptKey().getId(),
- IS_A_NULL_KEY);
+ IS_A_NULL_KEY);
}
// Null local name check
// Null key name start check
if (referenceKey.getParentConceptKey().getName().toUpperCase().startsWith(PfKey.NULL_KEY_NAME)) {
addResult(result2, "parent name of " + referenceKey.getId(), referenceKey.getParentConceptKey().getName(),
- "starts with keyword " + PfKey.NULL_KEY_NAME);
+ "starts with keyword " + PfKey.NULL_KEY_NAME);
}
// Unique key check
/**
* Check for consistent usage of cross-key references in the model.
*
- * @param usedKeySet The set of all keys used in the model
- * @param artifactKeySet The set of artifact keys encountered so far, this key is appended to
- * the set
+ * @param usedKeySet The set of all keys used in the model
+ * @param artifactKeySet The set of artifact keys encountered so far, this key is appended to
+ * the set
* @param referenceKeySet The set of reference keys encountered so far, this key is appended to
- * the set
- * @param result where to add the results
+ * the set
+ * @param result where to add the results
*/
private void validateKeyUses(final Set<PfKeyUse> usedKeySet, final Set<PfConceptKey> artifactKeySet,
- final Set<PfReferenceKey> referenceKeySet, final BeanValidationResult result) {
+ final Set<PfReferenceKey> referenceKeySet, final BeanValidationResult result) {
// Check all key uses
for (final PfKeyUse usedKey : usedKeySet) {
if (usedKey.getKey() instanceof PfConceptKey) {
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 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.models.base;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
import lombok.Getter;
import lombok.ToString;
import org.onap.policy.models.errors.concepts.ErrorResponse;
import org.onap.policy.models.errors.concepts.ErrorResponseUtils;
/**
- * This class is a base exception from which all model exceptions are sub classes.
+ * This class is a base exception from which all model exceptions are subclasses.
*/
@Getter
@ToString
public class PfModelException extends Exception implements ErrorResponseInfo {
+ @Serial
private static final long serialVersionUID = -8507246953751956974L;
// The error response of the exception
* Instantiates a new model exception.
*
* @param statusCode the return code for the exception
- * @param message the message on the exception
+ * @param message the message on the exception
*/
public PfModelException(final Response.Status statusCode, final String message) {
this(statusCode, message, null);
* Instantiates a new model exception.
*
* @param statusCode the return code for the exception
- * @param message the message on the exception
- * @param object the object that the exception was thrown on
+ * @param message the message on the exception
+ * @param object the object that the exception was thrown on
*/
public PfModelException(final Response.Status statusCode, final String message, final Object object) {
super(message);
* Instantiates a new model exception.
*
* @param statusCode the return code for the exception
- * @param message the message on the exception
- * @param exception the exception that caused this exception
+ * @param message the message on the exception
+ * @param exception the exception that caused this exception
*/
public PfModelException(final Response.Status statusCode, final String message, final Exception exception) {
this(statusCode, message, exception, null);
* Instantiates a new exception.
*
* @param statusCode the return code for the exception
- * @param message the message on the exception
- * @param exception the exception that caused this exception
- * @param object the object that the exception was thrown on
+ * @param message the message on the exception
+ * @param exception the exception that caused this exception
+ * @param object the object that the exception was thrown on
*/
public PfModelException(final Response.Status statusCode, final String message, final Exception exception,
- final Object object) {
+ final Object object) {
super(message, exception);
errorResponse.setResponseCode(statusCode);
ErrorResponseUtils.getExceptionMessages(errorResponse, this);
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019, 2021 Nordix Foundation.
+ * Copyright (C) 2019, 2021, 2023 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.models.base;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
import lombok.Getter;
import lombok.ToString;
import org.onap.policy.models.errors.concepts.ErrorResponse;
import org.onap.policy.models.errors.concepts.ErrorResponseUtils;
/**
- * This class is a base model run time exception from which all model run time exceptions are sub classes.
+ * This class is a base model run time exception from which all model run time exceptions are subclasses.
*/
@Getter
@ToString
public class PfModelRuntimeException extends RuntimeException implements ErrorResponseInfo {
+ @Serial
private static final long serialVersionUID = -8507246953751956974L;
// The error response of the exception
* Instantiates a new model runtime exception.
*
* @param statusCode the return code for the exception
- * @param message the message on the exception
+ * @param message the message on the exception
*/
public PfModelRuntimeException(final Response.Status statusCode, final String message) {
this(statusCode, message, null);
* Instantiates a new model runtime exception.
*
* @param statusCode the return code for the exception
- * @param message the message on the exception
- * @param object the object that the exception was thrown on
+ * @param message the message on the exception
+ * @param object the object that the exception was thrown on
*/
public PfModelRuntimeException(final Response.Status statusCode, final String message, final Object object) {
super(message);
* Instantiates a new model runtime exception.
*
* @param statusCode the return code for the exception
- * @param message the message on the exception
- * @param exception the exception that caused this model exception
+ * @param message the message on the exception
+ * @param exception the exception that caused this model exception
*/
public PfModelRuntimeException(final Response.Status statusCode, final String message, final Exception exception) {
this(statusCode, message, exception, null);
* Instantiates a new model runtime exception.
*
* @param statusCode the return code for the exception
- * @param message the message on the exception
- * @param exception the exception that caused this model exception
- * @param object the object that the exception was thrown on
+ * @param message the message on the exception
+ * @param exception the exception that caused this model exception
+ * @param object the object that the exception was thrown on
*/
public PfModelRuntimeException(final Response.Status statusCode, final String message, final Exception exception,
- final Object object) {
+ final Object object) {
super(message, exception);
this.object = object;
errorResponse.setResponseCode(statusCode);
package org.onap.policy.models.base;
+import jakarta.ws.rs.core.Response;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import javax.ws.rs.core.Response;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.NonNull;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class PfModelService {
// The map holding the models
- private static Map<String, PfConcept> modelMap = new ConcurrentHashMap<>();
+ private static final Map<String, PfConcept> modelMap = new ConcurrentHashMap<>();
/**
* Register a model with the model service.
*
- * @param <M> the generic type
+ * @param <M> the generic type
* @param modelKey the key of the model, used to index the model
- * @param model The model
+ * @param model The model
*/
public static <M extends PfConcept> void registerModel(@NonNull final String modelKey, @NonNull final M model) {
modelMap.put(modelKey, model);
/**
* Get a model from the model service.
*
- * @param <M> the generic type
+ * @param <M> the generic type
* @param modelKey the key of the model, used to index the model
* @return The model
*/
if (model == null) {
throw new PfModelRuntimeException(Response.Status.INTERNAL_SERVER_ERROR,
- "Model for name " + modelKey + " not found in model service");
+ "Model for name " + modelKey + " not found in model service");
}
return model;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019,2021 Nordix Foundation.
+ * Copyright (C) 2019, 2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
private static final String PARENT_LOCAL_NAME = "parentLocalName";
private static final String LOCAL_NAME = "localName";
+ @Serial
private static final long serialVersionUID = 8932717618579392561L;
- /** Regular expression to specify the structure of local names in reference keys. */
+ /**
+ * Regular expression to specify the structure of local names in reference keys.
+ */
public static final String LOCAL_NAME_REGEXP = "[A-Za-z0-9\\-_\\.]+|^$";
- /** Regular expression to specify the structure of IDs in reference keys. */
+ /**
+ * Regular expression to specify the structure of IDs in reference keys.
+ */
public static final String REFERENCE_KEY_ID_REGEXP =
- "[A-Za-z0-9\\-_]+:[0-9].[0-9].[0-9]:[A-Za-z0-9\\-_]+:[A-Za-z0-9\\-_]+";
+ "[A-Za-z0-9\\-_]+:[0-9].[0-9].[0-9]:[A-Za-z0-9\\-_]+:[A-Za-z0-9\\-_]+";
private static final int PARENT_NAME_FIELD = 0;
private static final int PARENT_VERSION_FIELD = 1;
/**
* The Copy Constructor creates a key by copying another key.
*
- * @param referenceKey
- * the reference key to copy from
+ * @param referenceKey the reference key to copy from
*/
public PfReferenceKey(final PfReferenceKey referenceKey) {
this(referenceKey.getParentKeyName(), referenceKey.getParentKeyVersion(), referenceKey.getParentLocalName(),
- referenceKey.getLocalName());
+ referenceKey.getLocalName());
}
/**
* Constructor to create a null reference key for the specified parent concept key.
*
- * @param pfConceptKey
- * the parent concept key of this reference key
+ * @param pfConceptKey the parent concept key of this reference key
*/
public PfReferenceKey(final PfConceptKey pfConceptKey) {
this(pfConceptKey.getName(), pfConceptKey.getVersion(), NULL_KEY_NAME, NULL_KEY_NAME);
/**
* Constructor to create a reference key for the given parent concept key with the given local name.
*
- * @param pfConceptKey
- * the parent concept key of this reference key
- * @param localName
- * the local name of this reference key
+ * @param pfConceptKey the parent concept key of this reference key
+ * @param localName the local name of this reference key
*/
public PfReferenceKey(final PfConceptKey pfConceptKey, final String localName) {
this(pfConceptKey, NULL_KEY_NAME, localName);
/**
* Constructor to create a reference key for the given parent reference key with the given local name.
*
- * @param parentReferenceKey
- * the parent reference key of this reference key
- * @param localName
- * the local name of this reference key
+ * @param parentReferenceKey the parent reference key of this reference key
+ * @param localName the local name of this reference key
*/
public PfReferenceKey(final PfReferenceKey parentReferenceKey, final String localName) {
this(parentReferenceKey.getParentConceptKey(), parentReferenceKey.getLocalName(), localName);
* Constructor to create a reference key for the given parent reference key (specified by the parent reference key's
* concept key and local name) with the given local name.
*
- * @param pfConceptKey
- * the concept key of the parent reference key of this reference key
- * @param parentLocalName
- * the local name of the parent reference key of this reference key
- * @param localName
- * the local name of this reference key
+ * @param pfConceptKey the concept key of the parent reference key of this reference key
+ * @param parentLocalName the local name of the parent reference key of this reference key
+ * @param localName the local name of this reference key
*/
public PfReferenceKey(final PfConceptKey pfConceptKey, final String parentLocalName, final String localName) {
this(pfConceptKey.getName(), pfConceptKey.getVersion(), parentLocalName, localName);
* Constructor to create a reference key for the given parent concept key (specified by the parent concept key's
* name and version) with the given local name.
*
- * @param parentKeyName
- * the name of the parent concept key of this reference key
- * @param parentKeyVersion
- * the version of the parent concept key of this reference key
- * @param localName
- * the local name of this reference key
+ * @param parentKeyName the name of the parent concept key of this reference key
+ * @param parentKeyVersion the version of the parent concept key of this reference key
+ * @param localName the local name of this reference key
*/
public PfReferenceKey(final String parentKeyName, final String parentKeyVersion, final String localName) {
this(parentKeyName, parentKeyVersion, NULL_KEY_NAME, localName);
* Constructor to create a reference key for the given parent key (specified by the parent key's name, version nad
* local name) with the given local name.
*
- * @param parentKeyName
- * the parent key name of this reference key
- * @param parentKeyVersion
- * the parent key version of this reference key
- * @param parentLocalName
- * the parent local name of this reference key
- * @param localName
- * the local name of this reference key
+ * @param parentKeyName the parent key name of this reference key
+ * @param parentKeyVersion the parent key version of this reference key
+ * @param parentLocalName the parent local name of this reference key
+ * @param localName the local name of this reference key
*/
public PfReferenceKey(final String parentKeyName, final String parentKeyVersion, final String parentLocalName,
- final String localName) {
+ final String localName) {
super();
this.parentKeyName = Assertions.validateStringParameter(PARENT_KEY_NAME, parentKeyName, NAME_REGEXP);
this.parentKeyVersion = Assertions.validateStringParameter(PARENT_KEY_VERSION, parentKeyVersion,
- VERSION_REGEXP);
+ VERSION_REGEXP);
this.parentLocalName = Assertions.validateStringParameter(PARENT_LOCAL_NAME, parentLocalName,
- LOCAL_NAME_REGEXP);
+ LOCAL_NAME_REGEXP);
this.localName = Assertions.validateStringParameter(LOCAL_NAME, localName, LOCAL_NAME_REGEXP);
}
/**
* Constructor to create a key from the specified key ID.
*
- * @param id
- * the key ID in a format that respects the KEY_ID_REGEXP
+ * @param id the key ID in a format that respects the KEY_ID_REGEXP
*/
public PfReferenceKey(final String id) {
final var conditionedId = Assertions.validateStringParameter("id", id, REFERENCE_KEY_ID_REGEXP);
// Initiate the new key
parentKeyName = Assertions.validateStringParameter(PARENT_KEY_NAME, nameVersionNameArray[PARENT_NAME_FIELD],
- NAME_REGEXP);
+ NAME_REGEXP);
parentKeyVersion = Assertions.validateStringParameter(PARENT_KEY_VERSION,
- nameVersionNameArray[PARENT_VERSION_FIELD], VERSION_REGEXP);
+ nameVersionNameArray[PARENT_VERSION_FIELD], VERSION_REGEXP);
parentLocalName = Assertions.validateStringParameter(PARENT_LOCAL_NAME,
- nameVersionNameArray[PARENT_LOCAL_NAME_FIELD], LOCAL_NAME_REGEXP);
+ nameVersionNameArray[PARENT_LOCAL_NAME_FIELD], LOCAL_NAME_REGEXP);
localName = Assertions.validateStringParameter(LOCAL_NAME, nameVersionNameArray[LOCAL_NAME_FIELD],
- LOCAL_NAME_REGEXP);
+ LOCAL_NAME_REGEXP);
}
/**
*/
public static PfReferenceKey getNullKey() {
return new PfReferenceKey(PfKey.NULL_KEY_NAME, PfKey.NULL_KEY_VERSION, PfKey.NULL_KEY_NAME,
- PfKey.NULL_KEY_NAME);
+ PfKey.NULL_KEY_NAME);
}
@Override
/**
* Sets the parent concept key of this reference key.
*
- * @param parentKey
- * the parent concept key of this reference key
+ * @param parentKey the parent concept key of this reference key
*/
public void setParentConceptKey(final PfConceptKey parentKey) {
Assertions.argumentNotNull(parentKey, "parentKey may not be null");
/**
* Sets the parent reference key of this reference key.
*
- * @param parentKey
- * the parent reference key of this reference key
+ * @param parentKey the parent reference key of this reference key
*/
public void setParentReferenceKey(final PfReferenceKey parentKey) {
Assertions.argumentNotNull(parentKey, "parentKey may not be null");
}
@Override
- public PfKey.Compatibility getCompatibility(final PfKey otherKey) {
- if (!(otherKey instanceof PfReferenceKey)) {
+ public PfKey.Compatibility getCompatibility(@NonNull final PfKey otherKey) {
+ if (!(otherKey instanceof PfReferenceKey otherReferenceKey)) {
return Compatibility.DIFFERENT;
}
- final PfReferenceKey otherReferenceKey = (PfReferenceKey) otherKey;
return this.getParentConceptKey().getCompatibility(otherReferenceKey.getParentConceptKey());
}
@Override
public boolean isCompatible(@NonNull final PfKey otherKey) {
- if (!(otherKey instanceof PfReferenceKey)) {
+ if (!(otherKey instanceof PfReferenceKey otherReferenceKey)) {
return false;
}
- final PfReferenceKey otherReferenceKey = (PfReferenceKey) otherKey;
return this.getParentConceptKey().isCompatible(otherReferenceKey.getParentConceptKey());
}
}
@Override
- public int compareTo(final PfConcept otherObj) {
+ public int compareTo(@NonNull final PfConcept otherObj) {
Assertions.argumentNotNull(otherObj, "comparison object may not be null");
if (this == otherObj) {
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import jakarta.persistence.Embedded;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import java.io.Serial;
import java.time.Instant;
import java.util.Collections;
import java.util.Date;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Embedded;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class PfReferenceTimestampKey extends PfKey {
+ @Serial
private static final long serialVersionUID = 1130918285832617215L;
private static final String TIMESTAMP_TOKEN = "timeStamp";
@Override
public boolean isCompatible(@NonNull PfKey otherKey) {
- if (!(otherKey instanceof PfReferenceTimestampKey)) {
+ if (!(otherKey instanceof PfReferenceTimestampKey otherReferenceKey)) {
return false;
}
- final PfReferenceTimestampKey otherReferenceKey = (PfReferenceTimestampKey) otherKey;
return this.getReferenceKey().getParentConceptKey().isCompatible(otherReferenceKey.getReferenceKey()
.getParentConceptKey());
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import java.io.Serial;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
@Getter
@EqualsAndHashCode(callSuper = false)
public class PfSearchableKey extends PfKeyImpl {
+ @Serial
private static final long serialVersionUID = 8932717618579392561L;
/** Regular expression to specify the structure of key names. */
*
* @return a null key
*/
- public static final PfSearchableKey getNullKey() {
+ public static PfSearchableKey getNullKey() {
return new PfSearchableKey(PfKey.NULL_KEY_NAME, PfKey.NULL_KEY_VERSION);
}
* ============LICENSE_START=======================================================
* ONAP Policy Model
* ================================================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import java.io.Serial;
import java.time.Instant;
import java.util.Date;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class PfTimestampKey extends PfKeyImpl {
+ @Serial
private static final long serialVersionUID = -8410208962541783805L;
private static final String TIMESTAMP_TOKEN = "timeStamp";
/**
* Constructor to create a key with the specified name and version.
*
- * @param name the key name
+ * @param name the key name
* @param version the key version
* @param instant the time stamp of key
*/
public PfTimestampKey(@NonNull final String name, @NonNull final String version,
- @NonNull final Instant instant) {
+ @NonNull final Instant instant) {
super(name, version);
this.timeStamp = Date.from(instant);
}
*
* @return a null key
*/
- public static final PfTimestampKey getNullKey() {
+ public static PfTimestampKey getNullKey() {
return new PfTimestampKey(PfKey.NULL_KEY_NAME, PfKey.NULL_KEY_VERSION, Instant.EPOCH);
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base;
+import jakarta.ws.rs.core.Response;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
import java.util.function.Function;
import java.util.stream.Collectors;
-import javax.ws.rs.core.Response;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
/**
* Compare two objects using their equals methods, nulls are allowed.
*
- * @param leftObject the first object
+ * @param leftObject the first object
* @param rightObject the second object
* @return a measure of the comparison
*/
/**
* Compare two collections of the same type, nulls are allowed.
*
- * @param leftCollection the first collection
+ * @param leftCollection the first collection
* @param rightCollection the second collection
* @return a measure of the comparison
*/
/**
* Compare two maps of the same type, nulls are allowed.
*
- * @param leftMap the first map
+ * @param leftMap the first map
* @param rightMap the second map
* @return a measure of the comparison
*/
}
/**
- * Convenience method to apply a mapping function to all of the elements of a list, generating a new list.
+ * Convenience method to apply a mapping function to all the elements of a list, generating a new list.
*
- * @param source list whose elements are to be mapped, or {@code null}
- * @param mapFunc mapping function
+ * @param source list whose elements are to be mapped, or {@code null}
+ * @param mapFunc mapping function
* @param defaultValue value to be returned if source is {@code null}
- * @return a new list, containing mappings of all of the items in the original list
+ * @return a new list, containing mappings of all the items in the original list
*/
public static <T, R> List<R> mapList(List<T> source, Function<T, R> mapFunc, List<R> defaultValue) {
if (source == null) {
}
/**
- * Convenience method to apply a mapping function to all of the elements of a list, generating a new list.
+ * Convenience method to apply a mapping function to all the elements of a list, generating a new list.
*
- * @param source list whose elements are to be mapped, or {@code null}
+ * @param source list whose elements are to be mapped, or {@code null}
* @param mapFunc mapping function
- * @return a new list, containing mappings of all of the items in the original list, or {@code null} if the source
- * is {@code null}
+ * @return a new list, containing mappings of all the items in the original list, or {@code null} if the source
+ * is {@code null}
*/
public static <T, R> List<R> mapList(List<T> source, Function<T, R> mapFunc) {
return mapList(source, mapFunc, null);
}
/**
- * Convenience method to apply a mapping function to all of the values of a map, generating a new map.
+ * Convenience method to apply a mapping function to all the values of a map, generating a new map.
*
- * @param source map whose values are to be mapped, or {@code null}
- * @param mapFunc mapping function
+ * @param source map whose values are to be mapped, or {@code null}
+ * @param mapFunc mapping function
* @param defaultValue value to be returned if source is {@code null}
- * @return a new map, containing mappings of all of the items in the original map
+ * @return a new map, containing mappings of all the items in the original map
*/
- public static <K, T, R> Map<K, R> mapMap(Map<K, T> source, Function<T, R> mapFunc,
- Map<K, R> defaultValue) {
+ public static <K, T, R> Map<K, R> mapMap(Map<K, T> source, Function<T, R> mapFunc, Map<K, R> defaultValue) {
if (source == null) {
return defaultValue;
}
}
/**
- * Convenience method to apply a mapping function to all of the values of a map, generating a new map.
+ * Convenience method to apply a mapping function to all the values of a map, generating a new map.
*
- * @param source map whose values are to be mapped, or {@code null}
+ * @param source map whose values are to be mapped, or {@code null}
* @param mapFunc mapping function
- * @return a new map, containing mappings of all of the items in the original map, or {@code null} if the source is
- * {@code null}
+ * @return a new map, containing mappings of all the items in the original map, or {@code null} if the source is
+ * {@code null}
*/
public static <K, T, R> Map<K, R> mapMap(Map<K, T> source, Function<T, R> mapFunc) {
return mapMap(source, mapFunc, null);
}
try {
- @SuppressWarnings("unchecked")
- Class<? extends T> clazz = (Class<? extends T>) source.getClass();
+ @SuppressWarnings("unchecked") Class<? extends T> clazz = (Class<? extends T>) source.getClass();
return clazz.getConstructor(clazz).newInstance(source);
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException
- | RuntimeException e) {
+ | RuntimeException e) {
throw new PfModelRuntimeException(Response.Status.INTERNAL_SERVER_ERROR,
- "error copying concept key class: " + source.getClass().getName(), e);
+ "error copying concept key class: " + source.getClass().getName(), e);
}
}
}
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* @return {@code true} if the next check should be performed, {@code false} otherwise
*/
public boolean verPfMin(BeanValidationResult result, String fieldName, PfMin annot, Object value) {
- if (!(value instanceof Number)) {
+ if (!(value instanceof Number num)) {
return true;
}
- Number num = (Number) value;
if (num.longValue() == annot.allowed()) {
// this value is always allowed
return true;
* @return {@code true} if the next check should be performed, {@code false} otherwise
*/
public boolean verKey(BeanValidationResult result, String fieldName, VerifyKey annot, Object value) {
- if (!(value instanceof PfKey)) {
+ if (!(value instanceof PfKey pfkey)) {
return true;
}
- var pfkey = (PfKey) value;
if (annot.keyNotNull() && pfkey.isNullKey()) {
result.addResult(fieldName, xlate(pfkey), ValidationStatus.INVALID, Validated.IS_A_NULL_KEY);
return false;
verCascade(result, fieldName, value);
}
- if (!(pfkey instanceof PfKeyImpl)) {
+ if (!(pfkey instanceof PfKeyImpl keyimpl)) {
return true;
}
var result2 = new BeanValidationResult(fieldName, value);
- PfKeyImpl keyimpl = (PfKeyImpl) pfkey;
-
if (annot.nameNotNull() && keyimpl.isNullName()) {
result2.addResult("name", pfkey.getName(), ValidationStatus.INVALID, Validated.IS_NULL);
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019, 2021 Nordix Foundation.
+ * Copyright (C) 2019, 2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
import java.io.IOException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
import org.junit.Test;
import org.onap.policy.models.errors.concepts.ErrorResponse;
String key = "A String";
PfModelException ae =
- new PfModelException(Response.Status.OK, MESSAGE, new IOException("IO exception message"), key);
+ new PfModelException(Response.Status.OK, MESSAGE, new IOException("IO exception message"), key);
ErrorResponse errorResponse = ae.getErrorResponse();
assertEquals("Message\nIO exception message", String.join("\n", errorResponse.getErrorDetails()));
assertEquals(key, ae.getObject());
String rkey = "A String";
PfModelRuntimeException re = new PfModelRuntimeException(Response.Status.OK, "Runtime Message",
- new IOException("IO runtime exception message"), rkey);
+ new IOException("IO runtime exception message"), rkey);
errorResponse = re.getErrorResponse();
assertEquals("Runtime Message\nIO runtime exception message",
- String.join("\n", errorResponse.getErrorDetails()));
+ String.join("\n", errorResponse.getErrorDetails()));
assertEquals(key, re.getObject());
PfModelRuntimeException pfre = new PfModelRuntimeException(ae);
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
container = new DummyPfConceptContainer(new PfConceptKey());
assertNotNull(container);
- container = new DummyPfConceptContainer(new PfConceptKey(), new TreeMap<PfConceptKey, DummyPfConcept>());
+ container = new DummyPfConceptContainer(new PfConceptKey(), new TreeMap<>());
assertNotNull(container);
- assertThatThrownBy(() -> new PfConceptContainer((PfConceptKey) null, null)).hasMessageMatching(KEY_IS_NULL);
+ assertThatThrownBy(() -> new PfConceptContainer(null, null)).hasMessageMatching(KEY_IS_NULL);
- assertThatThrownBy(() -> new DummyPfConceptContainer((PfConceptKey) null, null))
+ assertThatThrownBy(() -> new DummyPfConceptContainer(null, null))
.hasMessageMatching(KEY_IS_NULL);
assertThatThrownBy(() -> new DummyPfConceptContainer(new PfConceptKey(), null))
.hasMessageMatching("^conceptMap is marked .*on.*ull but is null$");
- assertThatThrownBy(() -> new DummyPfConceptContainer(null, new TreeMap<PfConceptKey, DummyPfConcept>()))
+ assertThatThrownBy(() -> new DummyPfConceptContainer(null, new TreeMap<>()))
.hasMessageMatching(KEY_IS_NULL);
}
assertThatThrownBy(() -> new DummyPfConceptContainer((DummyPfConceptContainer) null))
.isInstanceOf(NullPointerException.class);
+ assertThatThrownBy(() -> container.compareTo(null)).isInstanceOf(NullPointerException.class);
- assertNotEquals(0, container.compareTo(null));
assertEquals(0, container.compareTo(container));
assertNotEquals(0, container.compareTo(conceptKey));
}
@Test(expected = NullPointerException.class)
- public void testnullKey() {
+ public void testNullKey() {
PfConceptKey nullKey = null;
new DummyPfConceptContainer(nullKey);
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2023 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 static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
import org.junit.Test;
import org.onap.policy.models.errors.concepts.ErrorResponseInfo;
* ONAP
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import jakarta.validation.Valid;
+import java.io.Serial;
import java.util.concurrent.atomic.AtomicBoolean;
-import javax.validation.Valid;
import lombok.Getter;
import lombok.NonNull;
import org.junit.Before;
// null key
data.key = new PfConceptKey();
assertThat(validator.validateTop("", data).getResult())
- .contains(KEY_FIELD, "NULL:0.0.0", Validated.IS_A_NULL_KEY).doesNotContain("name", "version");
+ .contains(KEY_FIELD, "NULL:0.0.0", Validated.IS_A_NULL_KEY).doesNotContain("name", "version");
// invalid version - should invoke verCascade() which will invoke key.validate()
data.key = new StandardCoder().decode("{'name':'abc', 'version':'xyzzy'}".replace('\'', '"'),
- PfConceptKey.class);
+ PfConceptKey.class);
assertThat(validator.validateTop("", data).getResult())
- .contains(KEY_FIELD, "version", "xyzzy", "regular expression").doesNotContain("name");
+ .contains(KEY_FIELD, "version", "xyzzy", "regular expression").doesNotContain("name");
// not a PfKeyImpl - should not check individual fields
PfKey pfkey = mock(PfKey.class);
// null name
data.key = new PfConceptKey(PfKey.NULL_KEY_NAME, "2.3.4");
assertThat(validator.validateTop("", data).getResult()).contains(KEY_FIELD, "name", "null")
- .doesNotContain("version", "2.3.4");
+ .doesNotContain("version", "2.3.4");
// null version
data.key = new PfConceptKey(STRING_VALUE, PfKey.NULL_KEY_VERSION);
assertThat(validator.validateTop("", data).getResult()).contains(KEY_FIELD, "version", "null")
- .doesNotContain("name", STRING_VALUE);
+ .doesNotContain("name", STRING_VALUE);
// null name, invalid version - should get two messages
data.key = new StandardCoder().decode("{'name':'NULL', 'version':'xyzzy'}".replace('\'', '"'),
- PfConceptKey.class);
+ PfConceptKey.class);
assertThat(validator.validateTop("", data).getResult()).contains(KEY_FIELD, "name", "null", "version", "xyzzy",
- "regular expression");
+ "regular expression");
/*
* Tests with all flags set to "false" (i.e., no validations).
AtomicBoolean called = new AtomicBoolean();
data2.key = new PfConceptKey() {
+ @Serial
private static final long serialVersionUID = 1L;
@Override
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base.testconcepts;
+import jakarta.persistence.EmbeddedId;
+import java.io.Serial;
import java.util.List;
-import javax.persistence.EmbeddedId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class DummyPfConcept extends PfConcept implements PfAuthorative<DummyAuthorativeConcept> {
+ @Serial
private static final long serialVersionUID = 1L;
@EmbeddedId
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base.testconcepts;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
import lombok.NonNull;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelRuntimeException;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 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.models.base.testconcepts;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
import lombok.NonNull;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelRuntimeException;
public class DummyPfConceptSub extends DummyPfConcept {
+ @Serial
private static final long serialVersionUID = 1L;
/**
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base.testconcepts;
-import java.util.Arrays;
+import java.io.Serial;
import java.util.List;
import lombok.NonNull;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfKey;
public class DummyPfKey extends PfKey {
+ @Serial
private static final long serialVersionUID = 1L;
public DummyPfKey() {
}
@Override
- public int compareTo(PfConcept arg0) {
+ public int compareTo(@NonNull PfConcept arg0) {
return 0;
}
}
@Override
- public Compatibility getCompatibility(PfKey otherKey) {
+ public Compatibility getCompatibility(@NonNull PfKey otherKey) {
return null;
}
@Override
- public boolean isCompatible(PfKey otherKey) {
+ public boolean isCompatible(@NonNull PfKey otherKey) {
return false;
}
@Override
public List<PfKey> getKeys() {
- return Arrays.asList(getKey());
+ return List.of(getKey());
}
@Override
============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-dao</artifactId>
<name>${project.artifactId}</name>
- <description>[${project.parent.artifactId}] module provides common DAO (Data Access Object) model handling for the ONAP Policy Framework</description>
+ <description>[${project.parent.artifactId}] module provides common DAO (Data Access Object) model handling for the
+ ONAP Policy Framework
+ </description>
<dependencies>
<dependency>
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.dao;
+import jakarta.ws.rs.core.Response;
import java.lang.reflect.InvocationTargetException;
-import javax.ws.rs.core.Response;
import org.onap.policy.common.utils.validation.Assertions;
import org.onap.policy.models.base.PfModelException;
import org.slf4j.Logger;
"Parameter \"daoParameters\" may not be null");
// Get the class for the DAO using reflection
- Object pfDaoObject = null;
+ Object pfDaoObject;
try {
pfDaoObject = Class.forName(daoParameters.getPluginClass()).getDeclaredConstructor().newInstance();
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | IllegalArgumentException
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.dao;
+import jakarta.persistence.TypedQuery;
import java.sql.Timestamp;
import java.util.Map;
-import javax.persistence.TypedQuery;
import lombok.Data;
import org.onap.policy.models.base.PfConcept;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.dao.converters;
import com.google.re2j.Pattern;
-import javax.persistence.AttributeConverter;
-import javax.persistence.Converter;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
+import jakarta.xml.bind.annotation.adapters.XmlAdapter;
/**
* The Class CDataConditioner converts a CDATA String to and from database format by removing spaces
* @param in the in
* @return the string
*/
- public static final String clean(final String in) {
+ public static String clean(final String in) {
if (in == null) {
return null;
} else {
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 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.models.dao.converters;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
+import jakarta.xml.bind.annotation.adapters.XmlAdapter;
import java.util.UUID;
-import javax.persistence.AttributeConverter;
-import javax.persistence.Converter;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
/**
* The Class UuidConverter converts a UUID to and from database format.
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021,2023 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.dao.impl;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.Persistence;
+import jakarta.persistence.TypedQuery;
+import jakarta.ws.rs.core.Response;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.persistence.TypedQuery;
-import javax.ws.rs.core.Response;
import org.apache.commons.lang3.StringUtils;
import org.onap.policy.models.base.PfConcept;
import org.onap.policy.models.base.PfConceptKey;
/**
* The Class DefaultPfDao is an JPA implementation of the {@link PfDao} class for Policy Framework concepts
- * ({@link PfConcept}). It uses the default JPA implementation in the javax {@link Persistence} class.
+ * ({@link PfConcept}). It uses the default JPA implementation in the jakarta {@link Persistence} class.
*/
public class DefaultPfDao implements PfDao {
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultPfDao.class);
if (obj == null) {
return;
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
mg.getTransaction().begin();
mg.merge(obj);
mg.getTransaction().commit();
- } finally {
- mg.close();
}
}
if (obj == null) {
return;
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
mg.getTransaction().begin();
mg.remove(mg.contains(obj) ? obj : mg.merge(obj));
mg.getTransaction().commit();
- } finally {
- mg.close();
}
}
if (key == null) {
return;
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
// @formatter:off
mg.getTransaction().begin();
mg.createQuery(setQueryTable(DELETE_BY_CONCEPT_KEY, someClass))
.executeUpdate();
mg.getTransaction().commit();
// @formatter:on
- } finally {
- mg.close();
}
}
if (key == null) {
return;
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
// @formatter:off
mg.getTransaction().begin();
mg.createQuery(setQueryTable(DELETE_BY_REFERENCE_KEY, someClass))
.executeUpdate();
mg.getTransaction().commit();
// @formatter:on
- } finally {
- mg.close();
}
}
if (key == null) {
return;
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
// @formatter:off
mg.getTransaction().begin();
mg.createQuery(setQueryTable(DELETE_BY_TIMESTAMP_KEY, someClass))
.executeUpdate();
mg.getTransaction().commit();
// @formatter:on
- } finally {
- mg.close();
}
}
if (objs == null || objs.isEmpty()) {
return;
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
mg.getTransaction().begin();
for (final T t : objs) {
mg.merge(t);
}
mg.getTransaction().commit();
- } finally {
- mg.close();
}
}
if (objs == null || objs.isEmpty()) {
return;
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
mg.getTransaction().begin();
for (final T t : objs) {
mg.remove(mg.contains(t) ? t : mg.merge(t));
}
mg.getTransaction().commit();
- } finally {
- mg.close();
}
}
return 0;
}
var deletedCount = 0;
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
// @formatter:off
mg.getTransaction().begin();
for (final PfConceptKey key : keys) {
}
mg.getTransaction().commit();
// @formatter:on
- } finally {
- mg.close();
}
return deletedCount;
}
@Override
public <T extends PfConcept> int deleteByReferenceKey(final Class<T> someClass,
- final Collection<PfReferenceKey> keys) {
+ final Collection<PfReferenceKey> keys) {
if (keys == null || keys.isEmpty()) {
return 0;
}
var deletedCount = 0;
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
// @formatter:off
mg.getTransaction().begin();
for (final PfReferenceKey key : keys) {
}
mg.getTransaction().commit();
// @formatter:on
- } finally {
- mg.close();
}
return deletedCount;
}
@Override
public <T extends PfConcept> void deleteAll(final Class<T> someClass) {
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
mg.getTransaction().begin();
mg.createQuery(setQueryTable(DELETE_FROM_TABLE, someClass)).executeUpdate();
mg.getTransaction().commit();
- } finally {
- mg.close();
}
}
@Override
public <T extends PfConcept> List<T> getFiltered(final Class<T> someClass, final String name,
- final String version) {
+ final String version) {
if (name == null) {
return getAll(someClass);
}
@Override
public <T extends PfConcept> List<T> getFiltered(final Class<T> someClass, PfFilterParametersIntfc filterParams) {
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
PfFilter filter = new PfFilterFactory().createFilter(someClass);
var filterQueryString = SELECT_FROM_TABLE
+ filter.genWhereClause(filterParams)
LOGGER.debug("filterQueryString is \"{}\"", filterQueryString);
return query.getResultList();
- } finally {
- mg.close();
}
}
if (someClass == null) {
return null;
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
final var t = mg.find(someClass, key);
if (t != null) {
mg.refresh(t);
}
return checkAndReturn(someClass, t);
- } finally {
- mg.close();
}
}
if (someClass == null) {
return Collections.emptyList();
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
return mg.createQuery(setQueryTable(SELECT_FROM_TABLE, someClass), someClass).getResultList();
- } finally {
- mg.close();
}
}
if (someClass == null) {
return Collections.emptyList();
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
// @formatter:off
return mg.createQuery(setQueryTable(SELECT_ALL_FOR_PARENT, someClass), someClass)
.setParameter(PARENT_NAME, parentKey.getName())
.setParameter(PARENT_VERSION, parentKey.getVersion())
.getResultList();
// @formatter:on
- } finally {
- mg.close();
}
}
if (someClass == null) {
return Collections.emptyList();
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
String query = setQueryTable(SELECT_FROM_TABLE, someClass);
if (StringUtils.isNotBlank(orderBy)) {
return mg.createQuery(query, someClass).setMaxResults(numRecords)
.getResultList();
- } finally {
- mg.close();
}
}
if (someClass == null || parentKeyName == null) {
return Collections.emptyList();
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
// @formatter:off
return mg.createQuery(setQueryTable(SELECT_ALL_VERSIONS_FOR_PARENT, someClass), someClass)
.setParameter(PARENT_NAME, parentKeyName)
.getResultList();
// @formatter:on
- } finally {
- mg.close();
}
}
if (someClass == null || conceptName == null) {
return Collections.emptyList();
}
- final var mg = getEntityManager();
- try {
+ try (var mg = getEntityManager()) {
// @formatter:off
return mg.createQuery(setQueryTable(SELECT_ALL_VERSIONS, someClass), someClass)
.setParameter(NAME, conceptName)
.getResultList();
// @formatter:on
- } finally {
- mg.close();
}
}
if (someClass == null || key == null) {
return null;
}
- final var mg = getEntityManager();
List<T> ret;
- try {
+ try (var mg = getEntityManager()) {
// @formatter:off
ret = mg.createQuery(setQueryTable(SELECT_BY_CONCEPT_KEY, someClass), someClass)
.setParameter(NAME, key.getName())
.setParameter(VERSION, key.getVersion())
.getResultList();
// @formatter:on
- } finally {
- mg.close();
}
return getSingleResult(someClass, key.getId(), ret);
if (someClass == null || key == null) {
return null;
}
- final var mg = getEntityManager();
List<T> ret;
- try {
+ try (var mg = getEntityManager()) {
// @formatter:off
ret = mg.createQuery(setQueryTable(SELECT_BY_REFERENCE_KEY, someClass), someClass)
.setParameter(PARENT_NAME, key.getParentKeyName())
.setParameter(LOCAL_NAME, key.getLocalName())
.getResultList();
// @formatter:on
- } finally {
- mg.close();
}
return getSingleResult(someClass, key.getId(), ret);
@Override
public <T extends PfConcept> T update(final T obj) {
- final var mg = getEntityManager();
T ret;
- try {
+ try (var mg = getEntityManager()) {
mg.getTransaction().begin();
ret = mg.merge(obj);
mg.flush();
mg.getTransaction().commit();
- } finally {
- mg.close();
}
return ret;
}
if (someClass == null) {
return 0;
}
- final var mg = getEntityManager();
- long size = 0;
- try {
+ long size;
+ try (var mg = getEntityManager()) {
/*
* The invoking code only passes well-known classes into this method, thus
* disabling the sonar about SQL injection.
*/
size = mg.createQuery("SELECT COUNT(c) FROM " + someClass.getSimpleName() + " c", Long.class) // NOSONAR
.getSingleResult();
- } finally {
- mg.close();
}
return size;
}
* Add the table to a query string.
*
* @param queryString the query string
- * @param tableClass the class name of the table
+ * @param tableClass the class name of the table
* @return the updated query string
*/
private <T extends PfConcept> String setQueryTable(final String queryString, final Class<T> tableClass) {
/**
* Check that a query returned one and only one entry and return that entry.
*
- * @param someClass the class being searched for
+ * @param someClass the class being searched for
* @param searchFilter the search filter
- * @param resultList the result list returned by the query
+ * @param resultList the result list returned by the query
* @return the single unique result
*/
private <T extends PfConcept> T getSingleResult(final Class<T> someClass, final String searchFilter,
- List<T> resultList) {
+ List<T> resultList) {
if (resultList == null || resultList.isEmpty()) {
return null;
}
/**
* check the result get from database and return the object.
*
- * @param <T> the type of the object to get, a subclass of {@link PfConcept}
- * @param someClass the class of the object to get, a subclass of {@link PfConcept}
+ * @param <T> the type of the object to get, a subclass of {@link PfConcept}
+ * @param someClass the class of the object to get, a subclass of {@link PfConcept}
* @param objToCheck the object that was retrieved from the database
* @return the checked object or null
*/
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.dao.impl;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.Persistence;
+import jakarta.persistence.TypedQuery;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import javax.persistence.EntityManager;
-import javax.persistence.Persistence;
-import javax.persistence.TypedQuery;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.onap.policy.models.base.PfConcept;
/**
* The Class ProxyDao is an JPA implementation of the {@link ProxyDao} class for Policy Framework concepts
- * ({@link PfConcept}). It uses the default JPA implementation in the javax {@link Persistence} class.
+ * ({@link PfConcept}). It uses the default JPA implementation in the jakarta {@link Persistence} class.
*/
@RequiredArgsConstructor
public class ProxyDao implements PfDao {
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.dao;
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class DummyConceptEntity extends PfConcept {
+ @Serial
private static final long serialVersionUID = -2962570563281067894L;
@EmbeddedId()
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.dao;
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class DummyReferenceEntity extends PfConcept {
+ @Serial
private static final long serialVersionUID = -2962570563281067894L;
@EmbeddedId()
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2021, 2023 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.models.dao;
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class DummyReferenceTimestampEntity extends PfConcept {
+ @Serial
private static final long serialVersionUID = -2962570563281067895L;
@EmbeddedId()
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.dao;
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class DummyTimestampEntity extends PfConcept {
+ @Serial
private static final long serialVersionUID = -2962570563281067895L;
@EmbeddedId()
-->
<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>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-decisions</artifactId>
* ONAP Policy Decision Models
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.decisions.concepts;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
import lombok.Getter;
import lombok.ToString;
import org.onap.policy.models.errors.concepts.ErrorResponse;
@Getter
@ToString
public class DecisionException extends RuntimeException implements ErrorResponseInfo {
+ @Serial
private static final long serialVersionUID = -1255351537691201052L;
private final ErrorResponse errorResponse = new ErrorResponse();
<!--
============LICENSE_START=======================================================
- Copyright (C) 2019 Nordix Foundation.
+ Copyright (C) 2019, 2023 Nordix Foundation.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (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>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-errors</artifactId>
<artifactId>gson</artifactId>
<version>${policy.common.version}</version>
</dependency>
- <dependency>
- <groupId>com.openpojo</groupId>
- <artifactId>openpojo</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
* ONAP Policy Decision Models
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.errors.concepts;
import com.google.gson.annotations.SerializedName;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
import java.io.Serializable;
import java.util.List;
-import javax.ws.rs.core.Response;
import lombok.Data;
/**
* response from API calls in the Policy Framework.
*
* @author pameladragosh
- *
*/
@Data
public class ErrorResponse implements Serializable {
+ @Serial
private static final long serialVersionUID = 6760066094588944729L;
@SerializedName("code")
- private Response.Status responseCode;
+ private Response.Status responseCode;
@SerializedName("error")
- private String errorMessage;
+ private String errorMessage;
@SerializedName("details")
- private List<String> errorDetails;
+ private List<String> errorDetails;
@SerializedName("warnings")
- private List<String> warningDetails;
+ private List<String> warningDetails;
}
* ONAP Policy Decision Models
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.assertj.core.api.Assertions.assertThatCode;
import static org.junit.Assert.assertEquals;
-import java.util.Arrays;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
+import java.util.List;
import org.junit.Test;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.slf4j.Logger;
error.setResponseCode(Response.Status.NOT_ACCEPTABLE);
error.setErrorMessage("Missing metadata section");
- error.setErrorDetails(Arrays.asList("You must have a metadata section with policy-id value"));
+ error.setErrorDetails(List.of("You must have a metadata section with policy-id value"));
- error.setWarningDetails(Arrays.asList("Please make sure topology template field is included."));
+ error.setWarningDetails(List.of("Please make sure topology template field is included."));
StandardCoder coder = new StandardCoder();
String jsonOutput = coder.encode(error);
============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-examples</artifactId>
<description>Various examples of policy type and policy models in various formats</description>
<properties>
- <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
+ <!-- There is no code in this submodule, only holds interfaces. So skip sonar. -->
<sonar.skip>true</sonar.skip>
</properties>
</project>
<!--
============LICENSE_START=======================================================
Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019-2020,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.a1p</artifactId>
<artifactId>gson</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions</groupId>
<artifactId>simulators</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
<!--
============LICENSE_START=======================================================
Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019-2020,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (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">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.aai</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>actor.test</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.aai;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.onap.policy.aai.AaiCqResponse;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.aai;
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
import org.onap.policy.controlloop.actorserviceprovider.impl.HttpOperation;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.aai;
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
import org.onap.policy.aai.AaiConstants;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.aai;
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
import org.onap.policy.aai.AaiConstants;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.aai;
+import jakarta.ws.rs.core.MediaType;
import java.util.HashMap;
import java.util.Map;
-import javax.ws.rs.core.MediaType;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import jakarta.ws.rs.client.InvocationCallback;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
-import javax.ws.rs.client.InvocationCallback;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
import java.util.Map;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
+import jakarta.ws.rs.client.InvocationCallback;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.InvocationCallback;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
+import jakarta.ws.rs.client.InvocationCallback;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.InvocationCallback;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
<!--
============LICENSE_START=======================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.appc</artifactId>
<artifactId>gson</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions</groupId>
<artifactId>simulators</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
<!--
============LICENSE_START=======================================================
Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.appclcm</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
============LICENSE_START=======================================================
Copyright (C) 2019 Bell Canada. All rights reserved.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ Modifications Copyright (C) 2023 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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- 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>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.cds</artifactId>
<dependencies>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
<!--
============LICENSE_START=======================================================
Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019-2020,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (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">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.sdnc</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>actor.test</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.sdnc;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
* Starts the simulator.
*/
protected static void initBeforeClass() throws Exception {
- Util.buildSdncSim();
+ var testServer = Util.buildSdncSim();
+ assertNotNull(testServer);
BusTopicParams clientParams = BusTopicParams.builder().clientName(MY_CLIENT).basePath("restconf/operations/")
.hostname("localhost").managed(true).port(Util.SDNCSIM_SERVER_PORT).build();
<!--
============LICENSE_START=======================================================
Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019-2020,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.sdnr</artifactId>
<artifactId>gson</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions</groupId>
<artifactId>simulators</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
<!--
============LICENSE_START=======================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.so</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>actor.test</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
* ONAP
* ================================================================================
* Copyright (C) 2022 CTC, Inc. and others. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.so;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
import org.onap.policy.common.endpoints.event.comm.Topic;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
import org.onap.policy.common.utils.coder.CoderException;
* ================================================================================
* Copyright (C) 2020 Wipro Limited.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.so;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
import org.onap.policy.common.endpoints.event.comm.Topic;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
import org.onap.policy.common.utils.coder.CoderException;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.so;
+import jakarta.ws.rs.core.EntityTag;
+import jakarta.ws.rs.core.GenericType;
+import jakarta.ws.rs.core.Link;
+import jakarta.ws.rs.core.Link.Builder;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.NewCookie;
+import jakarta.ws.rs.core.Response;
import java.lang.annotation.Annotation;
import java.net.URI;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.Link;
-import javax.ws.rs.core.Link.Builder;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.NewCookie;
-import javax.ws.rs.core.Response;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.onap.policy.common.utils.coder.Coder;
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020 Wipro Limited.
+ * Modifications Copyright (C) 2023 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.onap.aai.domain.yang.CloudRegion;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aai.domain.yang.ModelVer;
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020 Wipro Limited.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.so;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.apache.commons.lang3.tuple.Pair;
import org.onap.aai.domain.yang.ModelVer;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020 Wipro Limited.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.so;
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import java.net.URI;
import java.net.http.HttpRequest;
import java.net.http.HttpRequest.BodyPublishers;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import javax.ws.rs.core.GenericType;
+import jakarta.ws.rs.core.GenericType;
import org.junit.Before;
import org.junit.Test;
import org.onap.policy.common.utils.coder.Coder;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import java.net.http.HttpHeaders;
import java.net.http.HttpRequest;
import java.net.http.HttpRequest.Builder;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.TimeUnit;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.apache.commons.lang3.tuple.Pair;
import org.junit.AfterClass;
import org.junit.Before;
-->
<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">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.test</artifactId>
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.lenient;
+import jakarta.ws.rs.client.AsyncInvoker;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.client.WebTarget;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.AsyncInvoker;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.Response;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
<!--
============LICENSE_START=======================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.vfc</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>actor.test</artifactId>
<artifactId>mockito-core</artifactId>
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.vfc;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
import org.apache.commons.lang3.tuple.Pair;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.vfc;
+import jakarta.ws.rs.core.Response;
import java.util.List;
-import javax.ws.rs.core.Response;
import org.apache.commons.lang3.StringUtils;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
/**
* Treats everything as a success, so we always go into
- * {@link #postProcessResponse(OperationOutcome, String, Response, SoResponse)}.
+ * {@link #postProcessResponse (OperationOutcome, String, Response, SoResponse)}.
*/
@Override
protected boolean isSuccess(Response rawResponse, VfcResponse response) {
-->
<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">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actor.xacml</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>actor.test</artifactId>
* ONAP
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.xacml;
+import jakarta.ws.rs.core.Response;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.core.Response;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.xacml;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
import org.onap.policy.controlloop.actorserviceprovider.CallbackManager;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.xacml;
+import jakarta.ws.rs.core.Response;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.core.Response;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
<!--
============LICENSE_START=======================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>model-actors</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>actorServiceProvider</artifactId>
<artifactId>mockito-core</artifactId>
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
* Actor that uses HTTP, where the only additional property that an operator needs is a
- * URL. The actor's operator parameters are expected to be an {@link HttpParams}.
+ * URL. The actor's operator parameters are expected to be an
+ * {@link org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams}.
*
* @param <P> type of parameters
*/
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actorserviceprovider.impl;
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.Response;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.Response;
import lombok.Getter;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.http.client.HttpClient;
HttpPollingConfig cfg = (HttpPollingConfig) config;
switch (detmStatus(rawResponse, response)) {
- case SUCCESS:
+ case SUCCESS -> {
logger.info("{}.{} request succeeded for {}", params.getActor(), params.getOperation(),
- params.getRequestId());
+ params.getRequestId());
return CompletableFuture
- .completedFuture(setOutcome(outcome, OperationResult.SUCCESS, rawResponse, response));
-
- case FAILURE:
+ .completedFuture(setOutcome(outcome, OperationResult.SUCCESS, rawResponse, response));
+ }
+ case FAILURE -> {
logger.info("{}.{} request failed for {}", params.getActor(), params.getOperation(),
- params.getRequestId());
+ params.getRequestId());
return CompletableFuture
- .completedFuture(setOutcome(outcome, OperationResult.FAILURE, rawResponse, response));
-
- case STILL_WAITING:
- default:
- logger.info("{}.{} request incomplete for {}", params.getActor(), params.getOperation(),
- params.getRequestId());
- break;
+ .completedFuture(setOutcome(outcome, OperationResult.FAILURE, rawResponse, response));
+ }
+ default -> logger.info("{}.{} request incomplete for {}", params.getActor(), params.getOperation(),
+ params.getRequestId());
}
// still incomplete
// see if the limit for the number of polls has been reached
if (pollCount++ >= cfg.getMaxPolls()) {
- logger.warn("{}: execeeded 'poll' limit {} for {}", getFullName(), cfg.getMaxPolls(),
+ logger.warn("{}: exceeded 'poll' limit {} for {}", getFullName(), cfg.getMaxPolls(),
params.getRequestId());
setOutcome(outcome, OperationResult.FAILURE_TIMEOUT);
return CompletableFuture.completedFuture(outcome);
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.DELETE;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReference;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
import lombok.Getter;
import lombok.Setter;
import org.junit.AfterClass;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.Response;
import java.util.Collections;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.TimeUnit;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.Response;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <packaging>pom</packaging>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>pom</packaging>
- <parent>
- <groupId>org.onap.policy.models</groupId>
- <artifactId>policy-models-interactions</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-interactions</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>model-actors</artifactId>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+ <artifactId>model-actors</artifactId>
- <properties>
- <jacoco.dataFile>${project.basedir}/../../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
- </properties>
+ <properties>
+ <jacoco.dataFile>${project.basedir}/../../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
+ </properties>
- <modules>
- <module>actorServiceProvider</module>
- <module>actor.test</module>
- <module>actor.aai</module>
- <module>actor.cds</module>
- <module>actor.appc</module>
- <module>actor.appclcm</module>
- <module>actor.sdnc</module>
- <module>actor.sdnr</module>
- <module>actor.a1p</module>
- <module>actor.so</module>
- <module>actor.vfc</module>
- <module>actor.xacml</module>
- </modules>
- <dependencies>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- </dependencies>
+ <modules>
+ <module>actorServiceProvider</module>
+ <module>actor.test</module>
+ <module>actor.aai</module>
+ <module>actor.cds</module>
+ <module>actor.appc</module>
+ <module>actor.appclcm</module>
+ <module>actor.sdnc</module>
+ <module>actor.sdnr</module>
+ <module>actor.a1p</module>
+ <module>actor.so</module>
+ <module>actor.vfc</module>
+ <module>actor.xacml</module>
+ </modules>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ </dependencies>
</project>
aai
================================================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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>
<groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
<artifactId>model-impl</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>aai</artifactId>
<artifactId>rest</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>policy-endpoints</artifactId>
appc
================================================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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.
-->
-<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">
- <modelVersion>4.0.0</modelVersion>
+<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">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>model-impl</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>model-impl</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <artifactId>appc</artifactId>
+ <artifactId>appc</artifactId>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
</project>
appclcm
================================================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>model-impl</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>appclcm</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>model-impl</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>appclcm</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
</project>
============LICENSE_START=======================================================
Copyright (C) 2019-2021 Bell Canada.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ Modifications Copyright (C) 2023 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">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>model-impl</artifactId>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>model-impl</artifactId>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <artifactId>cds</artifactId>
- <name>${project.artifactId}</name>
- <description>gRPC client implementation to send process message to CDS blueprint processor gRPC endpoint.</description>
+ <artifactId>cds</artifactId>
+ <name>${project.artifactId}</name>
+ <description>gRPC client implementation to send process message to CDS blueprint processor gRPC endpoint.
+ </description>
- <properties>
- <grpc.version>1.25.0</grpc.version>
- </properties>
+ <properties>
+ <grpc.version>1.25.0</grpc.version>
+ </properties>
- <dependencies>
- <!-- CDS dependencies -->
- <dependency>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
- <artifactId>blueprint-proto</artifactId>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-testing</artifactId>
- <version>${grpc.version}</version>
- <scope>test</scope>
- </dependency>
+ <dependencies>
+ <!-- CDS dependencies -->
+ <dependency>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-proto</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-testing</artifactId>
+ <version>${grpc.version}</version>
+ <scope>test</scope>
+ </dependency>
- <!-- Policy dependencies -->
- <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>policy-endpoints</artifactId>
- <version>${policy.common.version}</version>
- </dependency>
-
- <!-- junit dependencies -->
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <!-- Policy dependencies -->
+ <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>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ </dependencies>
</project>
events in model-impl
================================================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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">
- <modelVersion>4.0.0</modelVersion>
+<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">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>model-impl</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>model-impl</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <artifactId>events</artifactId>
+ <artifactId>events</artifactId>
- <dependencies>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
</project>
ONAP
================================================================================
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ Modifications Copyright (C) 2023 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
-<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">
- <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>model-impl</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <parent>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>model-impl</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>guard</artifactId>
+ <artifactId>guard</artifactId>
</project>
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021,2023 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023 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.guard;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Index;
+import jakarta.persistence.Table;
+import jakarta.persistence.TableGenerator;
+import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Index;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
import lombok.Data;
@Entity
@Data
public class OperationsHistory implements Serializable {
+ @Serial
private static final long serialVersionUID = -551420180714993577L;
@Id
<parent>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-interactions</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
rest
================================================================================
Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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">
- <modelVersion>4.0.0</modelVersion>
+<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">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>model-impl</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>model-impl</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <artifactId>rest</artifactId>
+ <artifactId>rest</artifactId>
- <dependencies>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
- <version>${policy.common.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents.client5</groupId>
+ <artifactId>httpclient5</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
* rest
* ================================================================================
* Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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.rest;
+import jakarta.xml.bind.DatatypeConverter;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Map.Entry;
-import javax.xml.bind.DatatypeConverter;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
* Perform REST PUT.
*
* @param url the url
- * @param username the user name
+ * @param username the user
* @param password the password
* @param headers any headers
* @param contentType what the content type is
* Perform REST Post.
*
* @param url the url
- * @param username the user name
+ * @param username the user
* @param password the password
* @param headers any headers
* @param contentType what the content type is
* Do a REST get.
*
* @param url URL
- * @param username user name
+ * @param username user
* @param password password
* @param headers any headers to add
* @return a Pair for the response status and the body
* <i>Note: Many REST endpoints will return a 400 error for delete requests with a non-empty body</i>
*
* @param url the url
- * @param username the user name
+ * @param username the user
* @param password the password
* @param headers any headers
* @param contentType what the content type is
* Perform REST Delete.
*
* @param url the url
- * @param username the user name
+ * @param username the user
* @param password the password
* @param headers any headers
* @return the response status code and the body
* Perform REST Patch.
*
* @param url the url
- * @param username the user name
+ * @param username the user
* @param password the password
* @param headers any headers
* @param body body to send
* Add header to the request.
*
* @param request http request to send
- * @param username the user name
+ * @param username the user
* @param password the password
* @param headers any headers
*/
* rest
* ================================================================================
* Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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 static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.DELETE;
+import jakarta.ws.rs.DefaultValue;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.HttpMethod;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.MediaType;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
import org.apache.commons.lang3.tuple.Pair;
import org.junit.AfterClass;
import org.junit.BeforeClass;
============LICENSE_START=======================================================
Copyright (C) 2018 Huawei. All rights reserved.
Modifications Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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.
============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+<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">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
+ <parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
<artifactId>model-impl</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <artifactId>sdnc</artifactId>
+ <artifactId>sdnc</artifactId>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>rest</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
- <version>${policy.common.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
</project>
================================================================================
Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
Modifications Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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.
-->
-<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">
- <modelVersion>4.0.0</modelVersion>
+<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">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
+ <parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
<artifactId>model-impl</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <artifactId>sdnr</artifactId>
+ <artifactId>sdnr</artifactId>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
</project>
so
================================================================================
Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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">
- <modelVersion>4.0.0</modelVersion>
+<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">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
+ <parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
<artifactId>model-impl</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <artifactId>so</artifactId>
+ <artifactId>so</artifactId>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>rest</artifactId>
- <version>${project.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.glassfish.jersey.containers</groupId>
- <artifactId>jersey-container-grizzly2-http</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>rest</artifactId>
+ <version>${project.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.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-grizzly2-http</artifactId>
+ <version>3.1.3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
============LICENSE_START=======================================================
Copyright (C) 2017 Intel Corp. All rights reserved.
Modifications Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+<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">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
+ <parent>
<groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
<artifactId>model-impl</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
- <artifactId>vfc</artifactId>
+ <artifactId>vfc</artifactId>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>rest</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
- <version>${policy.common.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
</project>
ONAP
================================================================================
Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023 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">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-interactions</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<groupId>org.onap.policy.models.policy-models-interactions</groupId>
<artifactId>policy-endpoints</artifactId>
<version>${policy.common.version}</version>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
<artifactId>aai</artifactId>
* simulators
* ================================================================================
* Copyright (C) 2017-2018, 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.simulators;
-import java.io.IOException;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.common.utils.services.Registry;
*
* @param req the request
* @return the response
- * @throws IOException if a response file cannot be read
*/
@PUT
@Path("/{version:v16|v21}/query")
@Consumes(MediaType.APPLICATION_JSON)
@Produces("application/json")
- public Response aaiPutQuery(final String req) throws IOException {
+ public Response aaiPutQuery(final String req) {
return getResponse("AaiCqResponse", "invalid-cq");
}
* A&AI get PNF query using pnfName.
*
* @return the result
- * @throws IOException if a response file cannot be read
*/
@GET
@Path("/{version:v16|v21}/network/pnfs/pnf/{pnfName}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces("application/json")
- public Response aaiGetPnfUsingPnfName(@PathParam("pnfName") final String pnfName) throws IOException {
+ public Response aaiGetPnfUsingPnfName(@PathParam("pnfName") final String pnfName) {
return getResponse(pnfName, INVALID_PNF_FILE_NAME);
}
* A&AI get PNF query using pnf-id.
*
* @return the result
- * @throws IOException if a response file cannot be read
*/
@GET
@Path("/{version:v16|v21}/network/pnfs/pnf")
@Consumes(MediaType.APPLICATION_JSON)
@Produces("application/json")
- public Response aaiGetPnfUsingPnfId(@QueryParam("pnf-id") final String pnfId) throws IOException {
+ public Response aaiGetPnfUsingPnfId(@QueryParam("pnf-id") final String pnfId) {
return getResponse(pnfId, INVALID_PNF_FILE_NAME);
}
* A&AI get VNF query using vnf-id.
*
* @return the result
- * @throws IOException if a response file cannot be read
*/
@GET
@Path("/{version:v16|v21}/network/generic-vnfs/generic-vnf/{vnfId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces("application/json")
- public Response aaiGetVnfUsingVnfId(@PathParam("vnfId") final String vnfId) throws IOException {
+ public Response aaiGetVnfUsingVnfId(@PathParam("vnfId") final String vnfId) {
return getResponse(vnfId, INVALID_VNF_FILE_NAME);
}
* A&AI get VNF query using vnf-name.
*
* @return the result
- * @throws IOException if a response file cannot be read
*/
@GET
@Path("/{version:v16|v21}/network/generic-vnfs/generic-vnf")
@Consumes(MediaType.APPLICATION_JSON)
@Produces("application/json")
- public Response aaiGetVnfUsingVnfName(@QueryParam("vnf-name") final String vnfName) throws IOException {
+ public Response aaiGetVnfUsingVnfName(@QueryParam("vnf-name") final String vnfName) {
return getResponse(vnfName, INVALID_VNF_FILE_NAME);
}
* simulators
* ================================================================================
* Copyright (C) 2018 Huawei. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.simulators;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
import java.util.UUID;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
import org.onap.policy.sdnc.SdncResponse;
import org.onap.policy.sdnc.SdncResponseOutput;
import org.onap.policy.sdnc.util.Serialization;
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.simulators;
+import java.io.Serial;
+
public class SimulatorRuntimeException extends RuntimeException {
+ @Serial
private static final long serialVersionUID = 1L;
public SimulatorRuntimeException() {
* simulators
* ================================================================================
* Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020 Wipro Limited.
* Modifications Copyright (C) 2022 CTC, Inc. and others.
* ================================================================================
package org.onap.policy.simulators;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.DELETE;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
import lombok.Setter;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.so.SoRequest;
/**
* SO post query.
*
- * @param serviceInstanceId the service instance Id
- * @param vnfInstanceId the VNF Id
+ * @param serviceInstanceId the service instance ID
+ * @param vnfInstanceId the VNF ID
* @return the response
*/
@POST
/**
* SO Delete.
*
- * @param serviceInstanceId the service instance Id
- * @param vnfInstanceId the VNF Id
+ * @param serviceInstanceId the service instance ID
+ * @param vnfInstanceId the VNF ID
* @return the response
*/
@DELETE
* simulators
* ================================================================================
* Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
- * Build an SO simulator.
+ * Build a SO simulator.
*
* @return the simulator
* @throws InterruptedException if a thread is interrupted
*/
public static HttpServletServer buildDmaapSim(String resourceName) throws InterruptedException {
var json = ResourceUtils.getResourceAsString(resourceName);
- DmaapSimParameterGroup params = null;
+ DmaapSimParameterGroup params;
try {
params = new StandardCoder().decode(json, DmaapSimParameterGroup.class);
} catch (CoderException ce) {
* simulators
* ================================================================================
* Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 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.simulators;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.MediaType;
import org.slf4j.LoggerFactory;
@Path("/api/nslcm/v1")
/**
* VFC get query.
*
- * @param jobId tthe job id
+ * @param jobId the job id
* @return the response
*/
@GET
return "{\"jobId\" : " + jobId
+ ",\"responseDescriptor\" : {\"progress\" : \"40\",\"status\" : \"finished\",\"statusDescription"
+ "\" : \"OMC VMs are decommissioned in VIM\",\"errorCode\" : null,\"responseId\": 101 ,\""
- + "responseHistoryList\": [{\"progress\" : \"40\",\"status\" : \"proccessing\",\"statusDescription"
+ + "responseHistoryList\": [{\"progress\" : \"40\",\"status\" : \"processing\",\"statusDescription"
+ "\" : \"OMC VMs are decommissioned in VIM\",\"errorCode\" : null,\"responseId\" : \"1\"}, {\""
- + "progress\" : \"41\",\"status\" : \"proccessing\",\"statusDescription\" : \"OMC VMs are "
+ + "progress\" : \"41\",\"status\" : \"processing\",\"statusDescription\" : \"OMC VMs are "
+ "decommissioned in VIM\",\"errorCode\" : null,\"responseId\" : \"2\"}]}}";
}
* simulators
* ================================================================================
* Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 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.simulators;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
@BeforeClass
public static void setUpSimulator() {
try {
- Util.buildAaiSim();
+ var testServer = Util.buildAaiSim();
+ assertNotNull(testServer);
} catch (final Exception e) {
fail(e.getMessage());
}
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2023 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 io.grpc.stub.StreamObserver;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
+import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@Test
public void test() throws Exception {
- String reqstr = IOUtils.toString(getClass().getResource("cds/cds.request.json"), StandardCharsets.UTF_8);
+ String reqstr = IOUtils.toString(Objects.requireNonNull(getClass().getResource("cds/cds.request.json")),
+ StandardCharsets.UTF_8);
Builder builder = ExecutionServiceInput.newBuilder();
JsonFormat.parser().ignoringUnknownFields().merge(reqstr, builder);
ExecutionServiceInput request = builder.build();
BluePrintProcessingServiceStub asyncStub = BluePrintProcessingServiceGrpc.newStub(channel);
- StreamObserver<ExecutionServiceOutput> responseObserver = new StreamObserver<ExecutionServiceOutput>() {
+ StreamObserver<ExecutionServiceOutput> responseObserver = new StreamObserver<>() {
@Override
public void onNext(ExecutionServiceOutput output) {
future.complete(output);
* ============LICENSE_START=======================================================
* Copyright (C) 2019, 2022 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2023 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.utils.coder.StandardCoder;
public class DmaapSimulatorTest {
- private static final int MAX_WAIT_SEC = 5;
+ private static final int MAX_WAIT_SEC = 10;
private static final String TOPIC = "MY-TOPIC";
private static final String AUTH_TOPIC = "MY-AUTH-TOPIC";
private static final String AUTH_PORT = "3903";
@BeforeClass
public static void setUpSimulator() {
try {
- Util.buildSoSim();
+ var testServer = Util.buildSoSim();
+ assertNotNull(testServer);
} catch (final Exception e) {
fail(e.getMessage());
}
@BeforeClass
public static void setUpSimulator() {
try {
- Util.buildVfcSim();
+ var testServer = Util.buildVfcSim();
+ assertNotNull(testServer);
} catch (final Exception e) {
fail(e.getMessage());
}
public void testPost() {
final Pair<Integer, String> httpDetails =
new RestManager().post("http://localhost:6668/api/nslcm/v1/ns/1234567890/heal", "username", "password",
- new HashMap<String, String>(), "application/json", "Some Request Here");
+ new HashMap<>(), "application/json", "Some Request Here");
assertNotNull(httpDetails);
assertEquals(202, httpDetails.getLeft().intValue());
final VfcResponse response = Serialization.gsonPretty.fromJson(httpDetails.getRight(), VfcResponse.class);
@Test
public void testGet() {
final Pair<Integer, String> httpDetails = new RestManager().get("http://localhost:6668/api/nslcm/v1/jobs/1234",
- "username", "password", new HashMap<String, String>());
+ "username", "password", new HashMap<>());
assertNotNull(httpDetails);
final VfcResponse response = Serialization.gsonPretty.fromJson(httpDetails.getRight(), VfcResponse.class);
assertNotNull(response);
@BeforeClass
public static void setupSimulator() {
try {
- org.onap.policy.simulators.Util.buildXacmlSim();
+ var testServer = Util.buildXacmlSim();
+ assertNotNull(testServer);
} catch (Exception e) {
fail(e.getMessage());
}
============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.policy.models</groupId>
- <artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>policy-models-interactions</artifactId>
- <packaging>pom</packaging>
- <name>${project.artifactId}</name>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>policy-models-interactions</artifactId>
+ <packaging>pom</packaging>
+ <name>${project.artifactId}</name>
- <properties>
- <jacoco.dataFile>${project.basedir}/../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
- </properties>
+ <properties>
+ <jacoco.dataFile>${project.basedir}/../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
+ </properties>
- <modules>
- <module>model-simulators</module>
- <module>model-impl</module>
- <module>model-actors</module>
- </modules>
+ <modules>
+ <module>model-simulators</module>
+ <module>model-impl</module>
+ <module>model-actors</module>
+ </modules>
</project>
<!--
============LICENSE_START=======================================================
- Copyright (C) 2019-2021 Nordix Foundation.
+ Copyright (C) 2019-2021, 2023 Nordix Foundation.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (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>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-pap</artifactId>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-base</artifactId>
<version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models</groupId>
- <artifactId>policy-models-dao</artifactId>
- <version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-dao</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021,2023 Nordix Foundation.
+ * Copyright (C) 2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.pap.persistence.concepts;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Index;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import jakarta.persistence.TableGenerator;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.validation.constraints.NotNull;
+import java.io.Serial;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Index;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaPolicyAudit extends PfConcept implements PfAuthorative<PolicyAudit> {
+ @Serial
private static final long serialVersionUID = -2935734300607322191L;
@Id
<parent>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-pdp</artifactId>
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2023 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.models.pdp.concepts;
+import jakarta.persistence.Embeddable;
+import java.io.Serial;
import java.io.Serializable;
-import javax.persistence.Embeddable;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
@Data
@NoArgsConstructor
public class PdpEngineWorkerStatistics implements Serializable {
+ @Serial
private static final long serialVersionUID = 8262176849743624013L;
private String engineId;
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 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.models.pdp.persistence.concepts;
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaPdp extends PfConcept implements PfAuthorative<Pdp>, Serializable {
+ @Serial
private static final long serialVersionUID = -357224425637789775L;
@EmbeddedId
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019,2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.pdp.persistence.concepts;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import javax.persistence.CascadeType;
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaPdpGroup extends PfConcept implements PfAuthorative<PdpGroup> {
+ @Serial
private static final long serialVersionUID = -357224425637789775L;
@EmbeddedId
* ONAP
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.pdp.persistence.concepts;
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Index;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Index;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaPdpPolicyStatus extends PfConcept implements PfAuthorative<PdpPolicyStatus> {
+ @Serial
private static final long serialVersionUID = -357224425637789775L;
/**
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 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.models.pdp.persistence.concepts;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaPdpSubGroup extends PfConcept implements PfAuthorative<PdpSubGroup> {
+ @Serial
private static final long serialVersionUID = -357224425637789775L;
@EmbeddedId
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2023 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.pdp.persistence.provider;
+import jakarta.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
-import javax.ws.rs.core.Response;
import lombok.NonNull;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptKey;
* @param dao the DAO to use to access the database
* @param name the name of the PDP group to get, null to get all PDP groups
* @return the PDP groups found
- * @throws PfModelException on errors getting PDP groups
*/
- public List<PdpGroup> getPdpGroups(@NonNull final PfDao dao, final String name) throws PfModelException {
+ public List<PdpGroup> getPdpGroups(@NonNull final PfDao dao, final String name) {
return asPdpGroupList(dao.getFiltered(JpaPdpGroup.class, name, PfKey.NULL_KEY_VERSION));
}
* @param dao the DAO to use to access the database
* @param filter the filter for the PDP groups to get
* @return the PDP groups found
- * @throws PfModelException on errors getting policies
*/
public List<PdpGroup> getFilteredPdpGroups(@NonNull final PfDao dao, @NonNull final PdpGroupFilter filter) {
* @param dao the DAO to use to access the database
* @param pdpGroups a specification of the PDP groups to create
* @return the PDP groups created
- * @throws PfModelException on errors creating PDP groups
*/
- public List<PdpGroup> createPdpGroups(@NonNull final PfDao dao, @NonNull final List<PdpGroup> pdpGroups)
- throws PfModelException {
+ public List<PdpGroup> createPdpGroups(@NonNull final PfDao dao, @NonNull final List<PdpGroup> pdpGroups) {
for (PdpGroup pdpGroup : pdpGroups) {
var jpaPdpGroup = new JpaPdpGroup();
* @param dao the DAO to use to access the database
* @param pdpGroups a specification of the PDP groups to update
* @return the PDP groups updated
- * @throws PfModelException on errors updating PDP groups
*/
- public List<PdpGroup> updatePdpGroups(@NonNull final PfDao dao, @NonNull final List<PdpGroup> pdpGroups)
- throws PfModelException {
+ public List<PdpGroup> updatePdpGroups(@NonNull final PfDao dao, @NonNull final List<PdpGroup> pdpGroups) {
for (PdpGroup pdpGroup : pdpGroups) {
var jpaPdpGroup = new JpaPdpGroup();
* @param dao the DAO to use to access the database
* @param pdpGroupName the name of the PDP group of the PDP subgroup
* @param pdpSubGroup the PDP subgroup to be updated
- * @throws PfModelException on errors updating PDP subgroups
*/
public void updatePdpSubGroup(@NonNull final PfDao dao, @NonNull final String pdpGroupName,
- @NonNull final PdpSubGroup pdpSubGroup) throws PfModelException {
+ @NonNull final PdpSubGroup pdpSubGroup) {
final var subGroupKey =
new PfReferenceKey(pdpGroupName, PfKey.NULL_KEY_VERSION, pdpSubGroup.getPdpType());
* @param pdpGroupName the name of the PDP group of the PDP subgroup
* @param pdpSubGroup the PDP subgroup to be updated
* @param pdp the PDP to be updated
- * @throws PfModelException on errors updating PDP subgroups
*/
public void updatePdp(@NonNull final PfDao dao, @NonNull final String pdpGroupName,
@NonNull final String pdpSubGroup, @NonNull final Pdp pdp) {
* @param dao the DAO to use to access the database
* @param name the name of the policy to get, null to get all PDP groups
* @return the PDP group deleted
- * @throws PfModelException on errors deleting PDP groups
*/
public PdpGroup deletePdpGroup(@NonNull final PfDao dao, @NonNull final String name) {
*
* @param dao the DAO to use to access the database
* @return the deployments found
- * @throws PfModelException on errors getting PDP groups
*/
- public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull final PfDao dao)
- throws PfModelException {
-
+ public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull final PfDao dao) {
return dao.getAll(JpaPdpPolicyStatus.class).stream().map(JpaPdpPolicyStatus::toAuthorative)
.collect(Collectors.toList());
}
*
* @param dao the DAO to use to access the database
* @return the deployments found
- * @throws PfModelException on errors getting PDP groups
*/
public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull final PfDao dao,
- @NonNull ToscaConceptIdentifierOptVersion policy) throws PfModelException {
-
+ @NonNull ToscaConceptIdentifierOptVersion policy) {
if (policy.getVersion() != null) {
return dao.getAll(JpaPdpPolicyStatus.class, new PfConceptKey(policy.getName(), policy.getVersion()))
.stream().map(JpaPdpPolicyStatus::toAuthorative).collect(Collectors.toList());
* @param groupName the name of the PDP group of interest, null to get results for all
* PDP groups
* @return the deployments found
- * @throws PfModelException on errors getting PDP groups
*/
- public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull final PfDao dao, @NonNull final String groupName)
- throws PfModelException {
-
+ public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull final PfDao dao, @NonNull final String groupName) {
PfFilterParameters params = PfFilterParameters.builder().filterMap(Map.of("pdpGroup", groupName)).build();
return dao.getFiltered(JpaPdpPolicyStatus.class, params)
<!--
============LICENSE_START=======================================================
Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ Modifications Copyright (C) 2023 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with 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 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>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-provider</artifactId>
<artifactId>policy-models-pap</artifactId>
<version>${project.version}</version>
</dependency>
-
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
-
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
-
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.provider;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
import lombok.NonNull;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.dao.impl.ProxyDao;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.provider.impl;
+import jakarta.ws.rs.core.Response;
import java.io.Closeable;
-import javax.ws.rs.core.Response;
import lombok.Getter;
import lombok.NonNull;
import org.onap.policy.models.base.PfModelException;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2022 Nordix Foundation.
+ * Copyright (C) 2021-2023 Nordix Foundation.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.provider.impl;
+import jakarta.ws.rs.core.Response;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-import javax.ws.rs.core.Response;
import lombok.NonNull;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.base.PfModelRuntimeException;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020, 2022 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.provider.impl;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
import lombok.Getter;
import lombok.NonNull;
import org.onap.policy.models.base.PfModelException;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021,2023 Nordix Foundation.
+ * Copyright (C) 2021, 2023 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.models.provider.impl;
+import jakarta.ws.rs.core.Response;
import java.util.Properties;
-import javax.ws.rs.core.Response;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.onap.policy.models.base.PfModelException;
// @formatter:off
var jdbcProperties = new Properties();
- jdbcProperties.setProperty("javax.persistence.jdbc.driver", parameters.getDatabaseDriver());
- jdbcProperties.setProperty("javax.persistence.jdbc.url", parameters.getDatabaseUrl());
- jdbcProperties.setProperty("javax.persistence.jdbc.user", parameters.getDatabaseUser());
- jdbcProperties.setProperty("javax.persistence.jdbc.password", parameters.getDatabasePassword());
+ jdbcProperties.setProperty("jakarta.persistence.jdbc.driver", parameters.getDatabaseDriver());
+ jdbcProperties.setProperty("jakarta.persistence.jdbc.url", parameters.getDatabaseUrl());
+ jdbcProperties.setProperty("jakarta.persistence.jdbc.user", parameters.getDatabaseUser());
+ jdbcProperties.setProperty("jakarta.persistence.jdbc.password", parameters.getDatabasePassword());
jdbcProperties.setProperty("hibernate.dialect",
(parameters.getDatabaseType() == null
? "org.hibernate.dialect.MariaDBDialect"
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2022 Nordix Foundation.
+ * Copyright (C) 2019-2023 Nordix Foundation.
* Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020, 2022 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.provider.impl;
+import jakarta.ws.rs.core.Response;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
-import javax.ws.rs.core.Response;
import lombok.NonNull;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.base.PfModelRuntimeException;
}
@Override
- public void close() throws PfModelException {
+ public void close() {
// do nothing
}
@Override
- public void init() throws PfModelException {
+ public void init() {
// do nothing
}
@Override
public List<ToscaServiceTemplate> getFilteredServiceTemplateList(
- @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) throws PfModelException {
+ @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) {
return null;
}
@Override
- public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
- throws PfModelException {
+ public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate) {
return null;
}
@Override
- public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
- throws PfModelException {
+ public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate) {
return null;
}
@Override
- public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version)
- throws PfModelException {
+ public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version) {
return null;
}
@Override
- public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
+ public ToscaServiceTemplate getPolicyTypes(final String name, final String version) {
return null;
}
@Override
- public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
- throws PfModelException {
+ public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate) {
return null;
}
@Override
- public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
- throws PfModelException {
+ public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate) {
return null;
}
@Override
- public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException {
+ public ToscaServiceTemplate deletePolicyType(final String name, final String version) {
return null;
}
@Override
- public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
+ public ToscaServiceTemplate getPolicies(final String name, final String version) {
return null;
}
@Override
- public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
+ public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) {
return null;
}
@Override
- public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
+ public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) {
return null;
}
@Override
- public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException {
+ public ToscaServiceTemplate deletePolicy(final String name, final String version) {
return null;
}
@Override
- public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
- throws PfModelException {
+ public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate) {
return null;
}
@Override
public ToscaServiceTemplate updateToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
- throws PfModelRuntimeException, PfModelException {
+ throws PfModelRuntimeException {
return null;
}
@Override
- public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version)
- throws PfModelException {
+ public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version) {
return null;
}
@Override
public List<Map<ToscaEntityKey, Map<String, Object>>> getNodeTemplateMetadataSets(@NonNull String name,
- @NonNull String version)
- throws PfModelException {
+ @NonNull String version) {
return null;
}
@Override
- public List<ToscaNodeTemplate> getToscaNodeTemplate(final String name, final String version)
- throws PfModelException {
+ public List<ToscaNodeTemplate> getToscaNodeTemplate(final String name, final String version) {
return null;
}
@Override
- public List<PdpGroup> getPdpGroups(String name) throws PfModelException {
+ public List<PdpGroup> getPdpGroups(String name) {
return Collections.emptyList();
}
@Override
- public List<PdpGroup> createPdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
+ public List<PdpGroup> createPdpGroups(@NonNull List<PdpGroup> pdpGroups) {
return Collections.emptyList();
}
@Override
- public List<PdpGroup> updatePdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
+ public List<PdpGroup> updatePdpGroups(@NonNull List<PdpGroup> pdpGroups) {
return Collections.emptyList();
}
@Override
- public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp)
- throws PfModelException {
+ public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp) {
// do nothing
}
@Override
- public PdpGroup deletePdpGroup(@NonNull String name) throws PfModelException {
+ public PdpGroup deletePdpGroup(@NonNull String name) {
return null;
}
@Override
- public List<ToscaPolicyType> getPolicyTypeList(String name, String version) throws PfModelException {
+ public List<ToscaPolicyType> getPolicyTypeList(String name, String version) {
return Collections.emptyList();
}
@Override
- public ToscaServiceTemplate getFilteredPolicyTypes(@NonNull ToscaEntityFilter<ToscaPolicyType> filter)
- throws PfModelException {
+ public ToscaServiceTemplate getFilteredPolicyTypes(@NonNull ToscaEntityFilter<ToscaPolicyType> filter) {
return null;
}
@Override
- public List<ToscaPolicyType> getFilteredPolicyTypeList(@NonNull ToscaEntityFilter<ToscaPolicyType> filter)
- throws PfModelException {
+ public List<ToscaPolicyType> getFilteredPolicyTypeList(@NonNull ToscaEntityFilter<ToscaPolicyType> filter) {
return Collections.emptyList();
}
@Override
- public List<ToscaPolicy> getPolicyList(String name, String version) throws PfModelException {
+ public List<ToscaPolicy> getPolicyList(String name, String version) {
return Collections.emptyList();
}
@Override
- public ToscaServiceTemplate getFilteredPolicies(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter)
- throws PfModelException {
+ public ToscaServiceTemplate getFilteredPolicies(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter) {
return null;
}
@Override
- public List<ToscaPolicy> getFilteredPolicyList(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter)
- throws PfModelException {
+ public List<ToscaPolicy> getFilteredPolicyList(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter) {
return Collections.emptyList();
}
@Override
- public List<PdpGroup> getFilteredPdpGroups(@NonNull PdpGroupFilter filter) throws PfModelException {
+ public List<PdpGroup> getFilteredPdpGroups(@NonNull PdpGroupFilter filter) {
return Collections.emptyList();
}
@Override
- public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup)
- throws PfModelException {
+ public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup) {
// do nothing
}
@Override
- public List<PdpPolicyStatus> getAllPolicyStatus() throws PfModelException {
+ public List<PdpPolicyStatus> getAllPolicyStatus() {
// Not implemented
return null;
}
@Override
- public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy)
- throws PfModelException {
+ public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy) {
// Not implemented
return null;
}
@Override
- public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull String groupName) throws PfModelException {
+ public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull String groupName) {
// Not implemented
return null;
}
}
@Override
- public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) throws PfModelException {
+ public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) {
// Not implemented
return null;
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2022 Nordix Foundation.
+ * Copyright (C) 2019-2023 Nordix Foundation.
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020, 2022 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.provider.impl;
+import jakarta.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-import javax.ws.rs.core.Response;
import lombok.NonNull;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
}
@Override
- public void init() throws PfModelException {
+ public void init() {
// Not required on the dummy provider
}
@Override
- public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) throws PfModelException {
+ public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) {
return new ArrayList<>();
}
@Override
public List<ToscaServiceTemplate> getFilteredServiceTemplateList(
- @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) throws PfModelException {
+ @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) {
return new ArrayList<>();
}
}
@Override
- public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
+ public ToscaServiceTemplate getPolicyTypes(final String name, final String version) {
return getDummyResponse("dummyimpl/DummyToscaPolicyTypeGetResponse.json");
}
@Override
- public List<ToscaPolicyType> getPolicyTypeList(final String name, final String version) throws PfModelException {
+ public List<ToscaPolicyType> getPolicyTypeList(final String name, final String version) {
return new ArrayList<>();
}
@Override
- public ToscaServiceTemplate getFilteredPolicyTypes(ToscaEntityFilter<ToscaPolicyType> filter)
- throws PfModelException {
+ public ToscaServiceTemplate getFilteredPolicyTypes(ToscaEntityFilter<ToscaPolicyType> filter) {
return getDummyResponse("dummyimpl/DummyToscaPolicyTypeGetResponse.json");
}
}
@Override
- public ToscaServiceTemplate createPolicyTypes(final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+ public ToscaServiceTemplate createPolicyTypes(final ToscaServiceTemplate serviceTemplate) {
return serviceTemplate;
}
@Override
- public ToscaServiceTemplate updatePolicyTypes(final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+ public ToscaServiceTemplate updatePolicyTypes(final ToscaServiceTemplate serviceTemplate) {
return serviceTemplate;
}
@Override
- public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException {
+ public ToscaServiceTemplate deletePolicyType(final String name, final String version) {
return getDummyResponse("dummyimpl/DummyToscaPolicyTypeDeleteResponse.json");
}
@Override
- public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
+ public ToscaServiceTemplate getPolicies(final String name, final String version) {
return getDummyResponse("dummyimpl/DummyToscaPolicyGetResponse.json");
}
@Override
- public List<ToscaPolicy> getPolicyList(final String name, final String version) throws PfModelException {
+ public List<ToscaPolicy> getPolicyList(final String name, final String version) {
return new ArrayList<>();
}
@Override
- public ToscaServiceTemplate getFilteredPolicies(ToscaTypedEntityFilter<ToscaPolicy> filter)
- throws PfModelException {
+ public ToscaServiceTemplate getFilteredPolicies(ToscaTypedEntityFilter<ToscaPolicy> filter) {
return getDummyResponse("dummyimpl/DummyToscaPolicyGetResponse.json");
}
@Override
- public List<ToscaPolicy> getFilteredPolicyList(ToscaTypedEntityFilter<ToscaPolicy> filter) throws PfModelException {
+ public List<ToscaPolicy> getFilteredPolicyList(ToscaTypedEntityFilter<ToscaPolicy> filter) {
return new ArrayList<>();
}
@Override
- public ToscaServiceTemplate createPolicies(final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+ public ToscaServiceTemplate createPolicies(final ToscaServiceTemplate serviceTemplate) {
return serviceTemplate;
}
@Override
- public ToscaServiceTemplate updatePolicies(final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+ public ToscaServiceTemplate updatePolicies(final ToscaServiceTemplate serviceTemplate) {
return serviceTemplate;
}
@Override
- public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException {
+ public ToscaServiceTemplate deletePolicy(final String name, final String version) {
return getDummyResponse("dummyimpl/DummyToscaPolicyDeleteResponse.json");
}
@Override
- public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
- throws PfModelException {
+ public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate) {
return getDummyNodeTemplateResponse("dummyimpl/DummyToscaNodeTemplateResponse.json");
}
@Override
public ToscaServiceTemplate updateToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
- throws PfModelRuntimeException, PfModelException {
+ throws PfModelRuntimeException {
return getDummyNodeTemplateResponse("dummyimpl/DummyToscaNodeTemplateResponse.json");
}
@Override
- public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version)
- throws PfModelException {
+ public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version) {
return getDummyNodeTemplateResponse("dummyimpl/DummyToscaNodeTemplateResponse.json");
}
@Override
public List<Map<ToscaEntityKey, Map<String, Object>>> getNodeTemplateMetadataSets(@NonNull String name,
- @NonNull String version)
- throws PfModelException {
+ @NonNull String version) {
return new ArrayList<>();
}
@Override
- public List<ToscaNodeTemplate> getToscaNodeTemplate(final String name, final String version)
- throws PfModelException {
+ public List<ToscaNodeTemplate> getToscaNodeTemplate(final String name, final String version) {
return new ArrayList<>();
}
@Override
- public List<PdpGroup> getPdpGroups(final String name) throws PfModelException {
+ public List<PdpGroup> getPdpGroups(final String name) {
return new ArrayList<>();
}
@Override
- public List<PdpGroup> getFilteredPdpGroups(PdpGroupFilter filter) throws PfModelException {
+ public List<PdpGroup> getFilteredPdpGroups(PdpGroupFilter filter) {
return new ArrayList<>();
}
@Override
- public List<PdpGroup> createPdpGroups(final List<PdpGroup> pdpGroups) throws PfModelException {
+ public List<PdpGroup> createPdpGroups(final List<PdpGroup> pdpGroups) {
return new ArrayList<>();
}
@Override
- public List<PdpGroup> updatePdpGroups(final List<PdpGroup> pdpGroups) throws PfModelException {
+ public List<PdpGroup> updatePdpGroups(final List<PdpGroup> pdpGroups) {
return new ArrayList<>();
}
@Override
- public void updatePdpSubGroup(final String pdpGroupName, final PdpSubGroup pdpSubGroup) throws PfModelException {
+ public void updatePdpSubGroup(final String pdpGroupName, final PdpSubGroup pdpSubGroup) {
// Not implemented
}
@Override
- public void updatePdp(String pdpGroupName, String pdpSubGroup, Pdp pdp) throws PfModelException {
+ public void updatePdp(String pdpGroupName, String pdpSubGroup, Pdp pdp) {
// Not implemented
}
@Override
- public PdpGroup deletePdpGroup(final String name) throws PfModelException {
+ public PdpGroup deletePdpGroup(final String name) {
return null;
}
@Override
- public List<PdpPolicyStatus> getAllPolicyStatus() throws PfModelException {
+ public List<PdpPolicyStatus> getAllPolicyStatus() {
// Not implemented
return new ArrayList<>();
}
@Override
- public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy)
- throws PfModelException {
+ public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy) {
// Not implemented
return new ArrayList<>();
}
@Override
- public List<PdpPolicyStatus> getGroupPolicyStatus(String groupName) throws PfModelException {
+ public List<PdpPolicyStatus> getGroupPolicyStatus(String groupName) {
// Not implemented
return new ArrayList<>();
}
<!--
============LICENSE_START=======================================================
- Copyright (C) 2019,2023 Nordix Foundation.
+ Copyright (C) 2019, 2023 Nordix Foundation.
Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
<parent>
<groupId>org.onap.policy.models.sim</groupId>
<artifactId>policy-models-sim</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-sim-dmaap</artifactId>
<description>A module that implements a very simple DMaaP simulator.</description>
<dependencies>
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- </dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>common-parameters</artifactId>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.sim.dmaap.provider;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
import lombok.Getter;
import lombok.Setter;
import org.onap.policy.common.utils.services.ServiceManagerContainer;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 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.models.sim.dmaap.rest;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.Response.ResponseBuilder;
import java.net.HttpURLConnection;
import java.util.UUID;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response.ResponseBuilder;
/**
* Version v1 common superclass to provide DMaaP endpoints for the DMaaP simulator component.
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.sim.dmaap.rest;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.ext.MessageBodyReader;
+import jakarta.ws.rs.ext.Provider;
import java.io.BufferedReader;
import java.io.EOFException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.LinkedList;
import java.util.List;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
import org.apache.commons.io.IOUtils;
/**
if (chr == '.') {
String text = bldr.toString().trim();
- return (text.isEmpty() ? 0 : Integer.valueOf(text));
+ return (text.isEmpty() ? 0 : Integer.parseInt(text));
}
if (!Character.isDigit(chr)) {
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019,2021 Nordix Foundation.
+ * Copyright (C) 2019, 2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.sim.dmaap.rest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.DefaultValue;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.Response;
import org.onap.policy.models.sim.dmaap.provider.DmaapSimProvider;
/**
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.sim.dmaap.rest;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.ext.MessageBodyReader;
+import jakarta.ws.rs.ext.Provider;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.LinkedList;
import java.util.List;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
/**
* Provider that decodes "text/plain" messages.
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
}
/**
- * Verifies that the constructor adds all of the expected actions to the service
+ * Verifies that the constructor adds all the expected actions to the service
* manager container.
*/
@Test
public void testProcessDmaapMessageGet_Ex() throws InterruptedException {
BlockingQueue<Response> respQueue = new LinkedBlockingQueue<>();
- // put in a background thread so it doesn't interrupt the tester thread
+ // put in a background thread, so it doesn't interrupt the tester thread
new Thread(() -> {
try {
when(data1.read(any(), anyInt(), anyLong())).thenThrow(new InterruptedException(EXPECTED_EXCEPTION));
@Test
public void testMakeTimerPool() {
- // use a real provider so we can test the real makeTimer() method
+ // use a real provider, so we can test the real makeTimer() method
DmaapSimProvider prov2 = new DmaapSimProvider(params);
prov2.start();
- assertThatCode(() -> prov2.stop()).doesNotThrowAnyException();
+ assertThatCode(prov2::stop).doesNotThrowAnyException();
}
@Test
public void testMakeTopicData() {
- // use a real provider so we can test the real makeTopicData() method
+ // use a real provider, so we can test the real makeTopicData() method
DmaapSimProvider prov2 = new DmaapSimProvider(params);
assertThatCode(() -> prov2.processDmaapMessageGet(TOPIC1, CONSUMER1, CONSUMER_ID1, 0, 0))
.doesNotThrowAnyException();
@Override
protected TopicData makeTopicData(String topicName) {
- switch (topicName) {
- case TOPIC1:
- return data1;
- case TOPIC2:
- return data2;
- default:
- throw new IllegalArgumentException("unknown topic name: " + topicName);
- }
+ return switch (topicName) {
+ case TOPIC1 -> data1;
+ case TOPIC2 -> data2;
+ default -> throw new IllegalArgumentException("unknown topic name: " + topicName);
+ };
}
}
}
* ONAP PAP
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.ResponseBuilder;
import java.util.UUID;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.ResponseBuilder;
import org.junit.Before;
import org.junit.Test;
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import jakarta.ws.rs.core.MediaType;
import java.io.ByteArrayInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.List;
-import javax.ws.rs.core.MediaType;
import org.junit.Before;
import org.junit.Test;
* ============LICENSE_START=======================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
+import jakarta.ws.rs.core.Response;
import java.io.File;
import java.util.Arrays;
import java.util.Map;
-import javax.ws.rs.core.Response;
import org.junit.Before;
import org.junit.Test;
import org.onap.policy.common.utils.coder.Coder;
private static final String CONSUMER = "my-consumer";
private static final String CONSUMER_ID = "my-id";
- private static Coder coder = new StandardCoder();
+ private static final Coder coder = new StandardCoder();
private DmaapSimRestControllerV1 rest;
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import jakarta.ws.rs.core.MediaType;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.List;
-import javax.ws.rs.core.MediaType;
import org.junit.Before;
import org.junit.Test;
-->
<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>
<groupId>org.onap.policy.models.sim</groupId>
<artifactId>models-sim-packages</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>models-simulator-docker</artifactId>
<docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
<docker.contextDir>${project.basedir}/src/main/docker</docker.contextDir>
<maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
- <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
+ <!-- There is no code in this submodule, only holds interfaces. So skip sonar. -->
<sonar.skip>true</sonar.skip>
</properties>
<dependencySets>
<dependencySet>
<includes>
- <include>org.onap.policy.models.sim:models-simulator-tarball</include>
+ <include>org.onap.policy.models.sim:models-simulator-tarball
+ </include>
</includes>
<outputDirectory>/lib</outputDirectory>
<outputFileNameMapping>models-simulator.tar.gz</outputFileNameMapping>
COPY /maven/lib/models-simulator.tar.gz /packages/
RUN tar xvzf /packages/models-simulator.tar.gz --directory /extracted/
-FROM onap/policy-jre-alpine:3.0.0-SNAPSHOT
+FROM onap/policy-jre-alpine:3.0.1-SNAPSHOT
LABEL maintainer="Policy Team"
LABEL org.opencontainers.image.title="Policy Models Simulator"
-->
<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">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.policy.models.sim</groupId>
- <artifactId>models-sim-packages</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+ 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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.policy.models.sim</groupId>
+ <artifactId>models-sim-packages</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <artifactId>models-simulator-tarball</artifactId>
+ <artifactId>models-simulator-tarball</artifactId>
- <name>${project.artifactId}</name>
- <description>A module that runs all "simulators", including DMaaP.</description>
+ <name>${project.artifactId}</name>
+ <description>A module that runs all "simulators", including DMaaP.</description>
- <properties>
- <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
- <sonar.skip>true</sonar.skip>
- </properties>
+ <properties>
+ <!-- There is no code in this submodule, only holds interfaces. So skip sonar. -->
+ <sonar.skip>true</sonar.skip>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>org.onap.policy.models.sim</groupId>
- <artifactId>policy-models-simulators</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.policy.models.sim</groupId>
+ <artifactId>policy-models-simulators</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
- <build>
- <resources>
- <!-- Output the version of the service -->
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/version.txt</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/version.txt</exclude>
- </excludes>
- </resource>
- </resources>
+ <build>
+ <resources>
+ <!-- Output the version of the service -->
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/version.txt</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/version.txt</exclude>
+ </excludes>
+ </resource>
+ </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-complete-tar</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly.xml</descriptor>
- </descriptors>
- <finalName>${project.artifactId}-${project.version}</finalName>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-complete-tar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly.xml</descriptor>
+ </descriptors>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
- </build>
+ </build>
</project>
-->
<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>
<groupId>org.onap.policy.models.sim</groupId>
<artifactId>policy-models-sim</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>models-sim-packages</artifactId>
<description>The module for packaging the policy-models-simulator component.</description>
<properties>
- <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
+ <!-- There is no code in this submodule, only holds interfaces. So skip sonar. -->
<sonar.skip>true</sonar.skip>
</properties>
-<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.policy.models.sim</groupId>
- <artifactId>policy-models-sim</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>policy-models-sim-pdp</artifactId>
- <name>policy-models-sim-pdp</name>
+<!--
+ ============LICENSE_START=======================================================
+ Copyright (C) 2019 Bell Canada. All rights reserved.
+ Modifications Copyright (C) 2023 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
-<description>A module that implements a simulator for PDP.</description>
- <dependencies>
+ 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.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+-->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.policy.models.sim</groupId>
+ <artifactId>policy-models-sim</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>policy-models-sim-pdp</artifactId>
+ <name>policy-models-sim-pdp</name>
+
+ <description>A module that implements a simulator for PDP.</description>
+ <dependencies>
<dependency>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-pdp</artifactId>
<artifactId>common-parameters</artifactId>
<version>${policy.common.version}</version>
</dependency>
-
- <!--test dependencies -->
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
<resources>
private static final Logger LOGGER = LoggerFactory.getLogger(PdpSimulatorActivator.class);
private final PdpSimulatorParameterGroup pdpSimulatorParameterGroup;
- private List<TopicSink> topicSinks; // topics to which pdp sends pdp status
- private List<TopicSource> topicSources; // topics to which pdp listens to for messages from pap.
+ private final List<TopicSink> topicSinks; // topics to which pdp sends pdp status
+ private final List<TopicSource> topicSources; // topics to which pdp listens to for messages from pap.
private static final String[] MSG_TYPE_NAMES = { "messageName" };
/*
/**
* Used to manage the services.
*/
- private ServiceManager manager;
+ private final ServiceManager manager;
@Getter
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
activator.terminate();
}
} catch (final PdpSimulatorException e) {
- LOGGER.warn("error occured during shut down of the pdp simulator service", e);
+ LOGGER.warn("error occurred during shut down of the pdp simulator service", e);
}
}
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
private static final Logger LOGGER = LoggerFactory.getLogger(PdpStatusPublisher.class);
- private TopicSinkClient topicSinkClient;
- private Timer timer;
+ private final TopicSinkClient topicSinkClient;
+ private final Timer timer;
@Getter
- private long interval;
+ private final long interval;
/**
* Constructor for instantiating PdpStatusPublisher.
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
*
* @return PdpResponseDetails
*/
- public PdpResponseDetails createPdpResonseDetails(final String requestId, final PdpResponseStatus status,
- final String responseMessage) {
+ public PdpResponseDetails createPdpResponseDetails(final String requestId, final PdpResponseStatus status,
+ final String responseMessage) {
final var pdpResponseDetails = new PdpResponseDetails();
pdpResponseDetails.setResponseTo(requestId);
pdpResponseDetails.setResponseStatus(status);
final PdpStatus pdpStatusContext, final PdpMessageHandler pdpMessageHandler) {
PdpResponseDetails pdpResponseDetails = null;
if (pdpStatusContext.getState().equals(PdpState.ACTIVE)) {
- pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
+ pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(),
PdpResponseStatus.SUCCESS, "Pdp already in active state");
} else {
final List<ToscaPolicy> policies = Registry.get(PdpSimulatorConstants.REG_PDP_TOSCA_POLICY_LIST);
if (policies.isEmpty()) {
pdpStatusContext.setState(PdpState.ACTIVE);
- pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
+ pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(),
PdpResponseStatus.SUCCESS, "State changed to active. No policies found.");
} else {
- pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
+ pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(),
PdpResponseStatus.SUCCESS, "Pdp started. State changed to active.");
pdpStatusContext.setState(PdpState.ACTIVE);
}
final PdpStatus pdpStatusContext, final PdpMessageHandler pdpMessageHandler) {
PdpResponseDetails pdpResponseDetails = null;
if (pdpStatusContext.getState().equals(PdpState.PASSIVE)) {
- pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
+ pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(),
PdpResponseStatus.SUCCESS, "Pdp already in passive state");
} else {
- pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
+ pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(),
PdpResponseStatus.SUCCESS, "Pdp state changed from Active to Passive.");
pdpStatusContext.setState(PdpState.PASSIVE);
}
final var pdpStatusPublisher =
Registry.get(PdpSimulatorConstants.REG_PDP_STATUS_PUBLISHER, PdpStatusPublisher.class);
if (checkIfAlreadyHandled(pdpUpdateMsg, pdpStatusContext)) {
- pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpUpdateMsg.getRequestId(),
+ pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(),
PdpResponseStatus.SUCCESS, "Pdp already updated");
} else {
if (null != pdpUpdateMsg.getPdpHeartbeatIntervalMs() && pdpUpdateMsg.getPdpHeartbeatIntervalMs() > 0
.collect(Collectors.toList()));
if (pdpStatusContext.getState().equals(PdpState.ACTIVE)
&& !pdpUpdateMsg.getPoliciesToBeDeployed().isEmpty()) {
- pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpUpdateMsg.getRequestId(),
+ pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(),
PdpResponseStatus.SUCCESS, "Pdp engine started and policies are running.");
}
Registry.registerOrReplace(PdpSimulatorConstants.REG_PDP_TOSCA_POLICY_LIST, policies);
if (null == pdpResponseDetails) {
- pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpUpdateMsg.getRequestId(),
+ pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(),
PdpResponseStatus.SUCCESS, "Pdp update successful.");
}
}
# Docker file to build an image that runs the PDP simulator on Java 8 in alpine
#
-FROM onap/policy-jre-alpine:3.0.0-SNAPSHOT
+FROM onap/policy-jre-alpine:3.0.1-SNAPSHOT
LABEL maintainer="Policy Team"
-->
<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">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models.sim</groupId>
<artifactId>policy-models-sim</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-simulators</artifactId>
<artifactId>simulators</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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 static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import jakarta.ws.rs.core.Response;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Properties;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
-import javax.ws.rs.core.Response;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.policy.models</groupId>
- <artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
- <groupId>org.onap.policy.models.sim</groupId>
- <artifactId>policy-models-sim</artifactId>
- <packaging>pom</packaging>
- <name>${project.artifactId}</name>
+ <groupId>org.onap.policy.models.sim</groupId>
+ <artifactId>policy-models-sim</artifactId>
+ <packaging>pom</packaging>
+ <name>${project.artifactId}</name>
- <properties>
- <jacoco.dataFile>${project.basedir}/../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
- </properties>
+ <properties>
+ <jacoco.dataFile>${project.basedir}/../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
+ </properties>
- <modules>
- <module>models-sim-dmaap</module>
- <module>policy-models-sim-pdp</module>
- <module>policy-models-simulators</module>
- <module>packages</module>
- </modules>
+ <modules>
+ <module>models-sim-dmaap</module>
+ <module>policy-models-sim-pdp</module>
+ <module>policy-models-simulators</module>
+ <module>packages</module>
+ </modules>
</project>
============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-models-tosca</artifactId>
* ============LICENSE_START=======================================================
* ONAP Policy Model
* ================================================================================
- * Copyright (C) 2019-2022 Nordix Foundation.
+ * Copyright (C) 2019-2023 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.models.tosca.authorative.concepts;
import com.google.gson.annotations.SerializedName;
+import jakarta.ws.rs.core.Response;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import javax.ws.rs.core.Response;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2022 Nordix Foundation.
+ * Copyright (C) 2019-2023 Nordix Foundation.
* Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.authorative.provider;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
import lombok.NonNull;
import org.apache.commons.collections4.CollectionUtils;
import org.onap.policy.models.base.PfConceptKey;
private <T> List<T> asConceptList(final List<Map<String, T>> listOfMaps) {
List<T> returnList = new ArrayList<>();
for (Map<String, T> conceptMap : listOfMaps) {
- for (T concept : conceptMap.values()) {
- returnList.add(concept);
- }
+ returnList.addAll(conceptMap.values());
}
return returnList;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020-2021 Nordix Foundation.
+ * Copyright (C) 2020-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Lob;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Lob;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@EqualsAndHashCode(callSuper = false)
public class JpaToscaCapabilityAssignment extends JpaToscaWithTypeAndStringProperties<ToscaCapabilityAssignment> {
+ @Serial
private static final long serialVersionUID = 1675770231921107988L;
private static final String AUTHORATIVE_UNBOUNDED_LITERAL = "UNBOUNDED";
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
implements PfAuthorative<List<Map<String, ToscaCapabilityAssignment>>> {
public static final String DEFAULT_NAME = "ToscaCapabilityAssignmentsSimple";
public static final String DEFAULT_VERSION = "1.0.0";
+ @Serial
private static final long serialVersionUID = -7526648702327776101L;
/**
}
/**
- * This Constructor creates an concept container with all of its fields defined.
+ * This Constructor creates a concept container with all of its fields defined.
*
* @param key the concept container key
* @param conceptMap the concepts to be stored in the concept container
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class JpaToscaCapabilityType extends JpaToscaWithToscaProperties<ToscaCapabilityType> {
+ @Serial
private static final long serialVersionUID = -563659852901842616L;
/**
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
public class JpaToscaCapabilityTypes extends PfConceptContainer<JpaToscaCapabilityType, ToscaCapabilityType> {
public static final String DEFAULT_NAME = "ToscaCapabilityTypesSimple";
public static final String DEFAULT_VERSION = "1.0.0";
+ @Serial
private static final long serialVersionUID = -4157979965271220098L;
/**
}
/**
- * This Constructor creates an concept container with all of its fields defined.
+ * This Constructor creates a concept container with all of its fields defined.
*
* @param key the concept container key
* @param conceptMap the concepts to be stored in the concept container
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2021, 2023 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.models.tosca.simple.concepts;
+import jakarta.persistence.ElementCollection;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.ElementCollection;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
@EqualsAndHashCode(callSuper = false)
@ToString
public class JpaToscaConstraintInRange extends JpaToscaConstraint {
+ @Serial
private static final long serialVersionUID = -5060193250508635456L;
@ElementCollection
}
@Override
- public int compareTo(JpaToscaConstraint otherConstraint) {
- if (otherConstraint == null) {
- return -1;
- }
+ public int compareTo(@NonNull JpaToscaConstraint otherConstraint) {
if (this == otherConstraint) {
return 0;
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
-import javax.persistence.Column;
+import jakarta.persistence.Column;
+import java.io.Serial;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
@EqualsAndHashCode(callSuper = false)
@ToString
public class JpaToscaConstraintLogical extends JpaToscaConstraint {
+ @Serial
private static final long serialVersionUID = -2730203215911880756L;
@Column
}
switch (operation) {
- case EQ:
- toscaConstraint.setEqual(compareTo);
- break;
-
- case GT:
- toscaConstraint.setGreaterThan(compareTo);
- break;
-
- case GE:
- toscaConstraint.setGreaterOrEqual(compareTo);
- break;
-
- case LT:
- toscaConstraint.setLessThan(compareTo);
- break;
-
- case LE:
- toscaConstraint.setLessOrEqual(compareTo);
- break;
-
- default:
- // Can't happen
+ case EQ -> toscaConstraint.setEqual(compareTo);
+ case GT -> toscaConstraint.setGreaterThan(compareTo);
+ case GE -> toscaConstraint.setGreaterOrEqual(compareTo);
+ case LT -> toscaConstraint.setLessThan(compareTo);
+ case LE -> toscaConstraint.setLessOrEqual(compareTo);
+ default -> {
+ return null;
+ }
}
return toscaConstraint;
}
@Override
- public int compareTo(JpaToscaConstraint otherConstraint) {
- if (otherConstraint == null) {
- return -1;
- }
+ public int compareTo(@NonNull JpaToscaConstraint otherConstraint) {
if (this == otherConstraint) {
return 0;
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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.models.tosca.simple.concepts;
+import jakarta.persistence.ElementCollection;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.ElementCollection;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
@EqualsAndHashCode(callSuper = false)
@ToString
public class JpaToscaConstraintValidValues extends JpaToscaConstraint {
+ @Serial
private static final long serialVersionUID = -5060193250508635456L;
@ElementCollection
}
@Override
- public int compareTo(JpaToscaConstraint otherConstraint) {
- if (otherConstraint == null) {
- return -1;
- }
+ public int compareTo(@NonNull JpaToscaConstraint otherConstraint) {
if (this == otherConstraint) {
return 0;
}
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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.models.tosca.simple.concepts;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class JpaToscaDataType extends JpaToscaWithToscaProperties<ToscaDataType> {
+ @Serial
private static final long serialVersionUID = -3922690413436539164L;
@ElementCollection
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.NonNull;
import lombok.ToString;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptContainer;
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class JpaToscaDataTypes extends PfConceptContainer<JpaToscaDataType, ToscaDataType> {
+ @Serial
private static final long serialVersionUID = 2941102271022190348L;
public static final String DEFAULT_NAME = "ToscaDataTypesSimple";
}
/**
- * This Constructor creates an concept container with all of its fields defined.
+ * This Constructor creates a concept container with all of its fields defined.
*
* @param key the concept container key
* @param conceptMap the concepts to be stored in the concept container
}
@Override
- public BeanValidationResult validate(String fieldName) {
+ public BeanValidationResult validate(@NonNull String fieldName) {
BeanValidationResult result = super.validate(fieldName);
for (JpaToscaDataType dataType : this.getConceptMap().values()) {
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020,2022-2023 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2022-2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.AttributeOverride;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Lob;
+import jakarta.persistence.MappedSuperclass;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
-import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Lob;
-import javax.persistence.MappedSuperclass;
-import javax.ws.rs.core.Response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaToscaEntityType<T extends ToscaEntity> extends PfConcept implements PfAuthorative<T> {
+ @Serial
private static final long serialVersionUID = -1330661834220739393L;
private static final StandardCoder STANDARD_CODER = new StandardCoder();
// @formatter:off
@Column
- @AttributeOverrides({
- @AttributeOverride(name = "name", column = @Column(name = "derived_from_name")),
- @AttributeOverride(name = "version", column = @Column(name = "derived_from_version"))
- })
+ @AttributeOverride(name = "name", column = @Column(name = "derived_from_name"))
+ @AttributeOverride(name = "version", column = @Column(name = "derived_from_version"))
@VerifyKey
private PfConceptKey derivedFrom;
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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.models.tosca.simple.concepts;
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaToscaEventFilter extends PfConcept {
+ @Serial
private static final long serialVersionUID = 8769020537228210247L;
@EmbeddedId
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020,2023 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinColumns;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
import java.util.List;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
/**
* A container class for a TOSCA model with multiple service templates. This class is a container class that allows a
- * model with many service templates to be constructed that contains a well formed overall TOSCA model.
+ * model with many service templates to be constructed that contains a well-formed overall TOSCA model.
*
* <p>Validation runs {@link JpaToscaModel} validation on the model and all its sub concepts.
*/
private static final long serialVersionUID = 8800599637708309945L;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "serviceTemplatesName", referencedColumnName = "name"),
- @JoinColumn(name = "serviceTemplatesVersion", referencedColumnName = "version")
- })
+ @JoinColumn(name = "serviceTemplatesName", referencedColumnName = "name")
+ @JoinColumn(name = "serviceTemplatesVersion", referencedColumnName = "version")
@Valid
private JpaToscaServiceTemplates serviceTemplates;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020-2021,2023 Nordix Foundation.
+ * Copyright (C) 2020-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.ws.rs.core.Response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaToscaNodeTemplate extends JpaToscaWithTypeAndStringProperties<ToscaNodeTemplate> {
+ @Serial
private static final long serialVersionUID = 1675770231921107988L;
private static final StandardCoder STANDARD_CODER = new StandardCoder();
// formatter:off
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "requirementsName", referencedColumnName = "name"),
- @JoinColumn(name = "requirementsVersion", referencedColumnName = "version")
- })
+ @JoinColumn(name = "requirementsName", referencedColumnName = "name")
+ @JoinColumn(name = "requirementsVersion", referencedColumnName = "version")
@Valid
private JpaToscaRequirements requirements;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "capabilitiesName", referencedColumnName = "name"),
- @JoinColumn(name = "capabilitiesVersion", referencedColumnName = "version")
- })
+ @JoinColumn(name = "capabilitiesName", referencedColumnName = "name")
+ @JoinColumn(name = "capabilitiesVersion", referencedColumnName = "version")
@Valid
private JpaToscaCapabilityAssignments capabilities;
// @formatter:on
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.NonNull;
import lombok.ToString;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptContainer;
public class JpaToscaNodeTemplates extends PfConceptContainer<JpaToscaNodeTemplate, ToscaNodeTemplate> {
public static final String DEFAULT_NAME = "ToscaNodeTemplatesSimple";
public static final String DEFAULT_VERSION = "1.0.0";
+ @Serial
private static final long serialVersionUID = -4157979965271220098L;
/**
}
/**
- * This Constructor creates an concept container with all of its fields defined.
+ * This Constructor creates a concept container with all of its fields defined.
*
* @param key the concept container key
* @param conceptMap the concepts to be stored in the concept container
}
@Override
- public BeanValidationResult validate(String fieldName) {
+ public BeanValidationResult validate(@NonNull String fieldName) {
BeanValidationResult result = super.validate(fieldName);
// Check that all ancestors of this node template exist
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020,2023 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class JpaToscaNodeType extends JpaToscaWithToscaProperties<ToscaNodeType> {
+ @Serial
private static final long serialVersionUID = -563659852901842616L;
// formatter:off
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "requirementsName", referencedColumnName = "name"),
- @JoinColumn(name = "requirementsVersion", referencedColumnName = "version")
- })
+ @JoinColumn(name = "requirementsName", referencedColumnName = "name")
+ @JoinColumn(name = "requirementsVersion", referencedColumnName = "version")
// @formatter:on
@Valid
private JpaToscaRequirements requirements;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.NonNull;
import lombok.ToString;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptContainer;
public class JpaToscaNodeTypes extends PfConceptContainer<JpaToscaNodeType, ToscaNodeType> {
public static final String DEFAULT_NAME = "ToscaNodeTypesSimple";
public static final String DEFAULT_VERSION = "1.0.0";
+ @Serial
private static final long serialVersionUID = -4157979965271220098L;
/**
}
/**
- * This Constructor creates an concept container with all of its fields defined.
+ * This Constructor creates a concept container with all of its fields defined.
*
* @param key the concept container key
* @param conceptMap the concepts to be stored in the concept container
}
@Override
- public BeanValidationResult validate(String fieldName) {
+ public BeanValidationResult validate(@NonNull String fieldName) {
BeanValidationResult result = super.validate(fieldName);
// Check that all ancestors of this policy type exist
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.NonNull;
import lombok.ToString;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfAuthorative;
@EqualsAndHashCode(callSuper = true)
public class JpaToscaPolicies extends PfConceptContainer<JpaToscaPolicy, ToscaPolicy>
implements PfAuthorative<List<Map<String, ToscaPolicy>>> {
+ @Serial
private static final long serialVersionUID = -7526648702327776101L;
public static final String DEFAULT_NAME = "ToscaPoliciesSimple";
}
@Override
- public BeanValidationResult validate(String fieldName) {
+ public BeanValidationResult validate(@NonNull String fieldName) {
BeanValidationResult result = super.validate(fieldName);
for (JpaToscaPolicy policy : this.getConceptMap().values()) {
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.Table;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
import java.util.LinkedHashMap;
import java.util.List;
-import javax.persistence.CollectionTable;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.Table;
-import javax.ws.rs.core.Response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = true)
public class JpaToscaPolicy extends JpaToscaWithTypeAndStringProperties<ToscaPolicy> {
+ @Serial
private static final long serialVersionUID = 3265174757061982805L;
private static final String METADATA_METADATA_SET_NAME_TAG = "metadataSetName";
private static final String METADATA_METADATA_SET_VERSION_TAG = "metadataSetVersion";
}
@Override
- public BeanValidationResult validate(String fieldName) {
+ public BeanValidationResult validate(@NonNull String fieldName) {
BeanValidationResult result = super.validate(fieldName);
validateKeyVersionNotNull(result, "key", getKey());
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.Lob;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
-import javax.persistence.CollectionTable;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.Lob;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class JpaToscaPolicyType extends JpaToscaWithToscaProperties<ToscaPolicyType> {
+ @Serial
private static final long serialVersionUID = -563659852901842616L;
@ElementCollection
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.NonNull;
import lombok.ToString;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptContainer;
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class JpaToscaPolicyTypes extends PfConceptContainer<JpaToscaPolicyType, ToscaPolicyType> {
+ @Serial
private static final long serialVersionUID = -4157979965271220098L;
public static final String DEFAULT_NAME = "ToscaPolicyTypesSimple";
}
/**
- * This Constructor creates an concept container with all of its fields defined.
+ * This Constructor creates a concept container with all of its fields defined.
*
* @param key the concept container key
* @param conceptMap the concepts to be stored in the concept container
}
@Override
- public BeanValidationResult validate(String fieldName) {
+ public BeanValidationResult validate(@NonNull String fieldName) {
BeanValidationResult result = super.validate(fieldName);
// Check that all ancestors of this policy type exist
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.EmbeddedId;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaToscaProperty extends PfConcept implements PfAuthorative<ToscaProperty> {
+ @Serial
private static final long serialVersionUID = 1675770231921107988L;
@EmbeddedId
}
@Override
- public int compareTo(final PfConcept otherConcept) {
- if (otherConcept == null) {
- return -1;
- }
+ public int compareTo(@NonNull final PfConcept otherConcept) {
if (this == otherConcept) {
return 0;
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class JpaToscaRelationshipType extends JpaToscaWithToscaProperties<ToscaRelationshipType> {
+ @Serial
private static final long serialVersionUID = -563659852901842616L;
/**
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.NonNull;
import lombok.ToString;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfConceptContainer;
public class JpaToscaRelationshipTypes extends PfConceptContainer<JpaToscaRelationshipType, ToscaRelationshipType> {
public static final String DEFAULT_NAME = "ToscaRelationshipTypesSimple";
public static final String DEFAULT_VERSION = "1.0.0";
+ @Serial
private static final long serialVersionUID = -4157979965271220098L;
/**
}
/**
- * This Constructor creates an concept container with all of its fields defined.
+ * This Constructor creates a concept container with all of its fields defined.
*
* @param key the concept container key
* @param conceptMap the concepts to be stored in the concept container
}
@Override
- public BeanValidationResult validate(String fieldName) {
+ public BeanValidationResult validate(@NonNull String fieldName) {
BeanValidationResult result = super.validate(fieldName);
// Check that all ancestors of this policy type exist
* ONAP Requirement Model
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 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.models.tosca.simple.concepts;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@EqualsAndHashCode(callSuper = true)
public class JpaToscaRequirement extends JpaToscaWithTypeAndStringProperties<ToscaRequirement> {
+ @Serial
private static final long serialVersionUID = 2785481541573683089L;
private static final String AUTHORATIVE_UNBOUNDED_LITERAL = "UNBOUNDED";
private static final Integer JPA_UNBOUNDED_VALUE = -1;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.NonNull;
import lombok.ToString;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.models.base.PfAuthorative;
@EqualsAndHashCode(callSuper = true)
public class JpaToscaRequirements extends PfConceptContainer<JpaToscaRequirement, ToscaRequirement>
implements PfAuthorative<List<Map<String, ToscaRequirement>>> {
+ @Serial
private static final long serialVersionUID = -7526648702327776101L;
public static final String DEFAULT_NAME = "ToscaRequirementsSimple";
}
/**
- * This Constructor creates an concept container with all of its fields defined.
+ * This Constructor creates a concept container with all of its fields defined.
*
* @param key the concept container key
* @param conceptMap the concepts to be stored in the concept container
}
@Override
- public BeanValidationResult validate(String fieldName) {
+ public BeanValidationResult validate(@NonNull String fieldName) {
BeanValidationResult result = super.validate(fieldName);
for (JpaToscaRequirement requirement : this.getConceptMap().values()) {
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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.models.tosca.simple.concepts;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
public class JpaToscaSchemaDefinition extends Validated
implements PfAuthorative<ToscaSchemaDefinition>, Serializable, Comparable<JpaToscaSchemaDefinition> {
+ @Serial
private static final long serialVersionUID = 3645882081163287058L;
@Column
copy.setDescription(description);
if (constraints != null) {
- final List<JpaToscaConstraint> newConstraints = new ArrayList<>();
- for (final JpaToscaConstraint constraint : constraints) {
- newConstraints.add(constraint); // Constraints are immutable
- }
+ // Constraints are immutable
+ final List<JpaToscaConstraint> newConstraints = new ArrayList<>(constraints);
copy.setConstraints(newConstraints);
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021,2023 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
import com.google.gson.annotations.SerializedName;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = true)
public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemplate>
- implements PfAuthorative<ToscaServiceTemplate> {
+ implements PfAuthorative<ToscaServiceTemplate> {
+ @Serial
private static final long serialVersionUID = 8084846046148349401L;
- public static final String DEFAULT_TOSCA_DEFINTIONS_VERISON = "tosca_simple_yaml_1_1_0";
+ public static final String DEFAULT_TOSCA_DEFINITIONS_VERSION = "tosca_simple_yaml_1_1_0";
public static final String DEFAULT_NAME = "ToscaServiceTemplateSimple";
public static final String DEFAULT_VERSION = "1.0.0";
private String toscaDefinitionsVersion;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "dataTypesName", referencedColumnName = "name"),
- @JoinColumn(name = "dataTypesVersion", referencedColumnName = "version")
- })
+ @JoinColumn(name = "dataTypesName", referencedColumnName = "name")
+ @JoinColumn(name = "dataTypesVersion", referencedColumnName = "version")
@SerializedName("data_types")
@Valid
private JpaToscaDataTypes dataTypes;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "capabilityTypesName", referencedColumnName = "name"),
- @JoinColumn(name = "capabilityTypesVersion", referencedColumnName = "version")
- })
+ @JoinColumn(name = "capabilityTypesName", referencedColumnName = "name")
+ @JoinColumn(name = "capabilityTypesVersion", referencedColumnName = "version")
@SerializedName("capability_types")
@Valid
private JpaToscaCapabilityTypes capabilityTypes;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "relationshipTypesName", referencedColumnName = "name"),
- @JoinColumn(name = "relationshipTypesVersion", referencedColumnName = "version")
- })
+ @JoinColumn(name = "relationshipTypesName", referencedColumnName = "name")
+ @JoinColumn(name = "relationshipTypesVersion", referencedColumnName = "version")
@SerializedName("relationship_types")
@Valid
private JpaToscaRelationshipTypes relationshipTypes;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "nodeTypesName", referencedColumnName = "name"),
- @JoinColumn(name = "nodeTypesVersion", referencedColumnName = "version")
- })
+ @JoinColumn(name = "nodeTypesName", referencedColumnName = "name")
+ @JoinColumn(name = "nodeTypesVersion", referencedColumnName = "version")
@SerializedName("node_types")
@Valid
private JpaToscaNodeTypes nodeTypes;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "policyTypesName", referencedColumnName = "name"),
- @JoinColumn(name = "policyTypesVersion", referencedColumnName = "version")
- })
+ @JoinColumn(name = "policyTypesName", referencedColumnName = "name")
+ @JoinColumn(name = "policyTypesVersion", referencedColumnName = "version")
@SerializedName("policy_types")
@Valid
private JpaToscaPolicyTypes policyTypes;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "topologyTemplateParentKeyName", referencedColumnName = "parentKeyName"),
- @JoinColumn(name = "topologyTemplateParentKeyVersion", referencedColumnName = "parentKeyVersion"),
- @JoinColumn(name = "topologyTemplateParentLocalName", referencedColumnName = "parentLocalName"),
- @JoinColumn(name = "topologyTemplateLocalName", referencedColumnName = "localName")
- })
+ @JoinColumn(name = "topologyTemplateParentKeyName", referencedColumnName = "parentKeyName")
+ @JoinColumn(name = "topologyTemplateParentKeyVersion", referencedColumnName = "parentKeyVersion")
+ @JoinColumn(name = "topologyTemplateParentLocalName", referencedColumnName = "parentLocalName")
+ @JoinColumn(name = "topologyTemplateLocalName", referencedColumnName = "localName")
@SerializedName("topology_template")
@Valid
private JpaToscaTopologyTemplate topologyTemplate;
* @param key the key
*/
public JpaToscaServiceTemplate(@NonNull final PfConceptKey key) {
- this(key, DEFAULT_TOSCA_DEFINTIONS_VERISON);
+ this(key, DEFAULT_TOSCA_DEFINITIONS_VERSION);
}
/**
* The full constructor creates a {@link JpaToscaServiceTemplate} object with all mandatory parameters.
*
- * @param key the key
+ * @param key the key
* @param toscaDefinitionsVersion the TOSCA version string
*/
public JpaToscaServiceTemplate(@NonNull final PfConceptKey key, @NonNull final String toscaDefinitionsVersion) {
this.toscaDefinitionsVersion = copyConcept.toscaDefinitionsVersion;
this.dataTypes = (copyConcept.dataTypes != null ? new JpaToscaDataTypes(copyConcept.dataTypes) : null);
this.capabilityTypes =
- (copyConcept.capabilityTypes != null ? new JpaToscaCapabilityTypes(copyConcept.capabilityTypes) : null);
+ (copyConcept.capabilityTypes != null ? new JpaToscaCapabilityTypes(copyConcept.capabilityTypes) : null);
this.relationshipTypes =
- (copyConcept.relationshipTypes != null ? new JpaToscaRelationshipTypes(copyConcept.relationshipTypes)
- : null);
+ (copyConcept.relationshipTypes != null ? new JpaToscaRelationshipTypes(copyConcept.relationshipTypes)
+ : null);
this.nodeTypes = (copyConcept.nodeTypes != null ? new JpaToscaNodeTypes(copyConcept.nodeTypes) : null);
this.policyTypes = (copyConcept.policyTypes != null ? new JpaToscaPolicyTypes(copyConcept.policyTypes) : null);
this.topologyTemplate =
- (copyConcept.topologyTemplate != null ? new JpaToscaTopologyTemplate(copyConcept.topologyTemplate)
- : null);
+ (copyConcept.topologyTemplate != null ? new JpaToscaTopologyTemplate(copyConcept.topologyTemplate)
+ : null);
}
/**
/**
* Takes a list of maps and flattens it into a single map.
*
- * @param list list to be be flattened
- * @return a map containing all of the elements from the list of maps
+ * @param list list to be flattened
+ * @return a map containing all the elements from the list of maps
*/
private <V> Map<String, V> flattenMap(List<Map<String, V>> list) {
Map<String, V> result = new LinkedHashMap<>();
public BeanValidationResult validate(String fieldName) {
BeanValidationResult result = super.validate(fieldName);
- // No point in validating cross references if the structure of the individual parts are not valid
+ // No point in validating cross-references if the structure of the individual parts are not valid
if (!result.isValid()) {
return result;
}
* Validate that the referenced data types exist for a collection of data type keys.
*
* @param dataTypeKeyCollection the data type key collection
- * @param result where the results are added
+ * @param result where the results are added
*/
private void validateReferencedDataTypesExists(final Collection<PfConceptKey> dataTypeKeyCollection,
- final BeanValidationResult result) {
+ final BeanValidationResult result) {
for (PfConceptKey dataTypeKey : dataTypeKeyCollection) {
if (dataTypes == null || dataTypes.get(dataTypeKey) == null) {
addResult(result, "data type", dataTypeKey.getId(), NOT_FOUND);
*/
private void validatePolicyTypesInPolicies(BeanValidationResult result) {
if (topologyTemplate == null || topologyTemplate.getPolicies() == null
- || topologyTemplate.getPolicies().getConceptMap().isEmpty()) {
+ || topologyTemplate.getPolicies().getConceptMap().isEmpty()) {
return;
}
if (policyTypes == null || policyTypes.getConceptMap().isEmpty()) {
addResult(result, "policyTypes", policyTypes,
- "no policy types are defined on the service template for the policies in the topology template");
+ "no policy types are defined on the service template for the policies in the topology template");
return;
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.onap.policy.models.base.PfConceptContainer;
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 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.models.tosca.simple.concepts;
import com.google.gson.annotations.SerializedName;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.sql.Timestamp;
import java.time.Instant;
import java.util.List;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaToscaTimeInterval extends PfConcept {
+ @Serial
private static final long serialVersionUID = 9151467029611969980L;
@EmbeddedId
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020,2023 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
import com.google.gson.annotations.SerializedName;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinColumns;
+import jakarta.persistence.Lob;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import java.io.Serial;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.Lob;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
public class JpaToscaTopologyTemplate extends PfConcept implements PfAuthorative<ToscaTopologyTemplate> {
+ @Serial
private static final long serialVersionUID = 8969698734673232603L;
public static final String DEFAULT_LOCAL_NAME = "ToscaTopologyTemplateSimple";
@NotBlank
private String description;
- // @formatter:off
@ElementCollection
@Lob
private Map<@NotNull String, @NotNull @Valid JpaToscaParameter> inputs;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "nodeTemplatesName", referencedColumnName = "name"),
- @JoinColumn(name = "nodeTemplatessVersion", referencedColumnName = "version")
- })
+ @JoinColumn(name = "nodeTemplatesName", referencedColumnName = "name")
+ @JoinColumn(name = "nodeTemplatessVersion", referencedColumnName = "version")
@SerializedName("data_types")
@Valid
private JpaToscaNodeTemplates nodeTemplates;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumns({
- @JoinColumn(name = "policyName", referencedColumnName = "name"),
- @JoinColumn(name = "policyVersion", referencedColumnName = "version")
-
- })
- // @formatter:on
+ @JoinColumn(name = "policyName", referencedColumnName = "name")
+ @JoinColumn(name = "policyVersion", referencedColumnName = "version")
@Valid
private JpaToscaPolicies policies;
*/
public JpaToscaTopologyTemplate() {
this(new PfReferenceKey(JpaToscaServiceTemplate.DEFAULT_NAME, JpaToscaServiceTemplate.DEFAULT_VERSION,
- DEFAULT_LOCAL_NAME));
+ DEFAULT_LOCAL_NAME));
}
/**
this.description = copyConcept.description;
this.inputs = PfUtils.mapMap(copyConcept.inputs, JpaToscaParameter::new);
this.nodeTemplates =
- (copyConcept.nodeTemplates != null ? new JpaToscaNodeTemplates(copyConcept.nodeTemplates) : null);
+ (copyConcept.nodeTemplates != null ? new JpaToscaNodeTemplates(copyConcept.nodeTemplates) : null);
this.policies = (copyConcept.policies != null ? new JpaToscaPolicies(copyConcept.policies) : null);
}
* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
import com.google.gson.annotations.SerializedName;
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
import java.time.Duration;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.tosca.simple.concepts;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Lob;
+import jakarta.persistence.MappedSuperclass;
+import java.io.Serial;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import javax.persistence.ElementCollection;
-import javax.persistence.Lob;
-import javax.persistence.MappedSuperclass;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@EqualsAndHashCode(callSuper = true)
public abstract class JpaToscaWithToscaProperties<T extends ToscaWithToscaProperties> extends JpaToscaEntityType<T>
implements PfAuthorative<T> {
+ @Serial
private static final long serialVersionUID = -563659852901842616L;
@ElementCollection
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021,2023 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023 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.models.tosca.simple.concepts;
+import jakarta.persistence.AttributeOverride;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Lob;
+import jakarta.persistence.MappedSuperclass;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Lob;
-import javax.persistence.MappedSuperclass;
-import javax.ws.rs.core.Response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
public abstract class JpaToscaWithTypeAndStringProperties<T extends ToscaWithTypeAndObjectProperties>
extends JpaToscaEntityType<T> implements PfAuthorative<T> {
+ @Serial
private static final long serialVersionUID = 2785481541573683089L;
@Column
- @AttributeOverrides ({
- @AttributeOverride(name = "name", column = @Column(name = "type_name")),
- @AttributeOverride(name = "version", column = @Column(name = "type_version"))
- })
+ @AttributeOverride(name = "name", column = @Column(name = "type_name"))
+ @AttributeOverride(name = "version", column = @Column(name = "type_version"))
@VerifyKey
@NotNull
private PfConceptKey type;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020,2022 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2022-2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.provider;
+import jakarta.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import javax.ws.rs.core.Response;
import lombok.NonNull;
import org.apache.commons.collections4.CollectionUtils;
import org.onap.policy.common.parameters.BeanValidationResult;
deletedServiceTemplate.setPolicyTypes(new JpaToscaPolicyTypes());
deletedServiceTemplate.getPolicyTypes().getConceptMap().put(policyTypeKey, policyType4Deletion);
- LOGGER.debug("<-deletePolicyType: key={}, serviceTempalate={}", policyTypeKey, deletedServiceTemplate);
+ LOGGER.debug("<-deletePolicyType: key={}, serviceTemplate={}", policyTypeKey, deletedServiceTemplate);
return deletedServiceTemplate;
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 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.models.tosca.simple.provider;
-import javax.ws.rs.core.Response.Status;
+import jakarta.ws.rs.core.Response.Status;
import lombok.NonNull;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelException;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020,2022 Nordix Foundation.
+ * Copyright (C) 2020, 2022-2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.utils;
+import jakarta.ws.rs.core.Response;
import java.util.Map.Entry;
-import javax.ws.rs.core.Response;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.NonNull;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2022 Nordix Foundation.
+ * Copyright (C) 2019-2023 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.utils;
+import jakarta.ws.rs.core.Response;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Function;
-import javax.ws.rs.core.Response;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.NonNull;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.tosca.simple.concepts;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
JpaToscaConstraintLogical jc5 = new JpaToscaConstraintLogical(c5);
assertNull(jc5.toAuthorative());
- assertEquals(-1, jc0.compareTo(null));
+ assertThatThrownBy(() -> jc0.compareTo(null)).isInstanceOf(NullPointerException.class);
assertEquals(0, jc0.compareTo(jc0));
assertNotEquals(0, jc0.compareTo(new JpaToscaConstraintValidValues(new ArrayList<>())));
assertEquals(-2, jc0.compareTo(jc1));
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
validValues.add("hello");
validValues.add("goodbye");
JpaToscaConstraintValidValues cvv0 = new JpaToscaConstraintValidValues(validValues);
- assertEquals(-1, cvv0.compareTo(null));
+ assertThatThrownBy(() -> cvv0.compareTo(null)).isInstanceOf(NullPointerException.class);
assertEquals(0, cvv0.compareTo(cvv0));
assertNotEquals(0, cvv0.compareTo(new JpaToscaConstraintLogical(JpaToscaConstraintOperation.EQ, CONSTRAINT)));
JpaToscaConstraintValidValues cvv1 = new JpaToscaConstraintValidValues(validValues);
rangeValues.add("hello");
rangeValues.add("goodbye");
JpaToscaConstraintInRange cir0 = new JpaToscaConstraintInRange(rangeValues);
- assertEquals(-1, cir0.compareTo(null));
+ assertThatThrownBy(() -> cir0.compareTo(null)).isInstanceOf(NullPointerException.class);
assertEquals(0, cir0.compareTo(cir0));
assertNotEquals(0, cir0.compareTo(new JpaToscaConstraintLogical(JpaToscaConstraintOperation.EQ, CONSTRAINT)));
JpaToscaConstraintInRange cir1 = new JpaToscaConstraintInRange(rangeValues);
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
assertEquals(tp, tdtClone1);
assertEquals(0, tp.compareTo(tdtClone1));
- assertEquals(-1, tp.compareTo(null));
+ assertThatThrownBy(() -> tp.compareTo(null)).isInstanceOf(NullPointerException.class);
assertEquals(0, tp.compareTo(tp));
assertNotEquals(0, tp.compareTo(tp.getKey()));
}
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
tst.setTopologyTemplate(ttt);
assertEquals(ttt, tst.getTopologyTemplate());
- JpaToscaServiceTemplate tttClone0 = new JpaToscaServiceTemplate(tst);
- assertEquals(tst, tttClone0);
- assertEquals(0, tst.compareTo(tttClone0));
-
- JpaToscaServiceTemplate tttClone1 = new JpaToscaServiceTemplate(tst);
- assertEquals(tst, tttClone1);
- assertEquals(0, tst.compareTo(tttClone1));
-
- assertEquals(-1, tst.compareTo(null));
- assertEquals(0, tst.compareTo(tst));
- assertNotEquals(0, tst.compareTo(tst.getKey()));
-
- PfConceptKey otherDtKey = new PfConceptKey("otherDt", VERSION_001);
- JpaToscaServiceTemplate otherDt = new JpaToscaServiceTemplate(otherDtKey);
-
- assertNotEquals(0, tst.compareTo(otherDt));
- otherDt.setKey(tstKey);
- assertNotEquals(0, tst.compareTo(otherDt));
- otherDt.setToscaDefinitionsVersion("Tosca Version");
- assertNotEquals(0, tst.compareTo(otherDt));
- otherDt.setDataTypes(dataTypes);
- assertNotEquals(0, tst.compareTo(otherDt));
- otherDt.setPolicyTypes(policyTypes);
- assertNotEquals(0, tst.compareTo(otherDt));
- otherDt.setTopologyTemplate(ttt);
- assertEquals(0, tst.compareTo(otherDt));
-
- assertEquals(6, tst.getKeys().size());
- assertEquals(1, new JpaToscaServiceTemplate().getKeys().size());
-
- new JpaToscaServiceTemplate().clean();
- tst.clean();
- assertEquals(tttClone0, tst);
+ assertCloneAndCopies(tstKey, tst, dataTypes, policyTypes, ttt);
assertTrue(new JpaToscaServiceTemplate().validate("").isValid());
assertTrue(tst.validate("").isValid());
BeanValidationResult result = tst.validate("");
assertThat(result.getResult()).contains("tosca_definitions_version").contains(Validated.IS_NULL);
- tst.setToscaDefinitionsVersion(JpaToscaServiceTemplate.DEFAULT_TOSCA_DEFINTIONS_VERISON);
+ tst.setToscaDefinitionsVersion(JpaToscaServiceTemplate.DEFAULT_TOSCA_DEFINITIONS_VERSION);
tst.setDataTypes(null);
result = tst.validate("");
assertTrue(result.isValid());
JpaToscaProperty prop0 = new JpaToscaProperty(new PfReferenceKey(pt0.getKey(), "prop0"));
prop0.setType(dt0.getKey());
+ assertDataTypesAndToscaTopology(tst, pt0, dt0, prop0);
+
+ tst.setPolicyTypes(null);
+ result = tst.validate("");
+ assertTrue(result.isValid());
+
+ assertNoPolicyType(tst, policyTypes, pt0, dt0);
+
+ }
+
+ private static void assertDataTypesAndToscaTopology(JpaToscaServiceTemplate tst, JpaToscaPolicyType pt0,
+ JpaToscaDataType dt0, JpaToscaProperty prop0) {
+ BeanValidationResult result;
pt0.setProperties(new LinkedHashMap<>());
pt0.getProperties().put(prop0.getKey().getLocalName(), prop0);
result = tst.validate("");
tst.getTopologyTemplate().setPolicies(new JpaToscaPolicies());
result = tst.validate("");
assertTrue(result.isValid());
+ }
- tst.setPolicyTypes(null);
- result = tst.validate("");
- assertTrue(result.isValid());
+ private static void assertCloneAndCopies(PfConceptKey tstKey, JpaToscaServiceTemplate tst,
+ JpaToscaDataTypes dataTypes, JpaToscaPolicyTypes policyTypes,
+ JpaToscaTopologyTemplate ttt) {
+ JpaToscaServiceTemplate tttClone0 = new JpaToscaServiceTemplate(tst);
+ assertEquals(tst, tttClone0);
+ assertEquals(0, tst.compareTo(tttClone0));
+
+ JpaToscaServiceTemplate tttClone1 = new JpaToscaServiceTemplate(tst);
+ assertEquals(tst, tttClone1);
+ assertEquals(0, tst.compareTo(tttClone1));
+
+ assertEquals(-1, tst.compareTo(null));
+ assertEquals(0, tst.compareTo(tst));
+ assertNotEquals(0, tst.compareTo(tst.getKey()));
+
+ PfConceptKey otherDtKey = new PfConceptKey("otherDt", VERSION_001);
+ JpaToscaServiceTemplate otherDt = new JpaToscaServiceTemplate(otherDtKey);
+
+ assertNotEquals(0, tst.compareTo(otherDt));
+ otherDt.setKey(tstKey);
+ assertNotEquals(0, tst.compareTo(otherDt));
+ otherDt.setToscaDefinitionsVersion("Tosca Version");
+ assertNotEquals(0, tst.compareTo(otherDt));
+ otherDt.setDataTypes(dataTypes);
+ assertNotEquals(0, tst.compareTo(otherDt));
+ otherDt.setPolicyTypes(policyTypes);
+ assertNotEquals(0, tst.compareTo(otherDt));
+ otherDt.setTopologyTemplate(ttt);
+ assertEquals(0, tst.compareTo(otherDt));
+
+ assertEquals(6, tst.getKeys().size());
+ assertEquals(1, new JpaToscaServiceTemplate().getKeys().size());
+
+ new JpaToscaServiceTemplate().clean();
+ tst.clean();
+ assertEquals(tttClone0, tst);
+ }
+ private static void assertNoPolicyType(JpaToscaServiceTemplate tst, JpaToscaPolicyTypes policyTypes,
+ JpaToscaPolicyType pt0, JpaToscaDataType dt0) {
+ BeanValidationResult result;
JpaToscaPolicy pol0 = new JpaToscaPolicy(new PfConceptKey("pol0:0.0.1"));
tst.getTopologyTemplate().getPolicies().getConceptMap().put(pol0.getKey(), pol0);
result = tst.validate("");
assertFalse(result.isValid());
assertThat(result.getResult()).contains(
"no policy types are defined on the service template for the policies in the topology template");
-
}
}
<!--
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. All rights reserved.
- Copyright (C) 2019-2020,2022-2023 Nordix Foundation.
+ Copyright (C) 2019-2020, 2022-2023 Nordix Foundation.
Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2020 Bell Canada.
================================================================================
============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 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>
<groupId>org.onap.policy.parent</groupId>
<artifactId>integration</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.1-SNAPSHOT</version>
<relativePath />
</parent>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>policy-models</name>
<description>This repo holds model code agnostic to PDP engines</description>
<properties>
- <policy.common.version>2.0.0-SNAPSHOT</policy.common.version>
+ <policy.common.version>2.0.1-SNAPSHOT</policy.common.version>
</properties>
<modules>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>utils</artifactId>
+ <version>${policy.common.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.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
-
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<artifactId>snakeyaml</artifactId>
</dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- </dependency>
-
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</dependency>
<dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.1-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>utils-test</artifactId>
- <version>${policy.common.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.openpojo</groupId>
- <artifactId>openpojo</artifactId>
- <scope>test</scope>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
+ <version>${version.jersey}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
+ <version>${version.jetty}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<version>${version.jersey}</version>
</dependency>
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.openpojo</groupId>
+ <artifactId>openpojo</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents.client5</groupId>
+ <artifactId>httpclient5</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
minor=3
minor=0
-patch=0
+patch=1
base_version=${major}.${minor}.${patch}