import java.io.Serializable;
import java.util.List;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
import lombok.NonNull;
/**
* and interfaces on all concepts that are sub-classes of this class.
*/
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
public abstract class PfConcept extends Validated implements Serializable, Comparable<PfConcept> {
private static final long serialVersionUID = -7434939557282697490L;
- /**
- * Default constructor.
- */
- protected PfConcept() {
- // Default Constructor
- }
-
/**
* Copy constructor.
*
import java.util.NavigableMap;
import java.util.Set;
import java.util.TreeSet;
+import lombok.AllArgsConstructor;
import org.onap.policy.common.utils.validation.Assertions;
/**
*
* @param <C> the type of concept on which the interface implementation is applied.
*/
+@AllArgsConstructor
public class PfConceptGetterImpl<C> implements PfConceptGetter<C> {
// The map from which to get concepts
private final NavigableMap<PfConceptKey, C> conceptMap;
- /**
- * Constructor that sets the concept map on which the getter methods in the interface will operate..
- *
- * @param conceptMap the concept map on which the method will operate
- */
- public PfConceptGetterImpl(final NavigableMap<PfConceptKey, C> conceptMap) {
- this.conceptMap = conceptMap;
- }
@Override
public C get(final PfConceptKey conceptKey) {
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
+import lombok.ToString;
import org.onap.policy.common.parameters.annotations.Pattern;
import org.onap.policy.common.utils.validation.Assertions;
@Embeddable
@Getter
@EqualsAndHashCode(callSuper = false)
+@ToString
public class PfConceptKey extends PfKeyImpl {
private static final long serialVersionUID = 8932717618579392561L;
public static final PfConceptKey getNullKey() {
return new PfConceptKey(PfKey.NULL_KEY_NAME, PfKey.NULL_KEY_VERSION);
}
-
- @Override
- public String toString() {
- return "PfConceptKey(name=" + getName() + ", version=" + getVersion() + ")";
- }
}
package org.onap.policy.models.base;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
import lombok.NonNull;
/**
* The key uniquely identifies every entity in the system. This class is an abstract class to give a common parent for
* all key types in the system.
*/
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
public abstract class PfKey extends PfConcept {
private static final long serialVersionUID = 6281159885962014041L;
IDENTICAL
}
- /**
- * Default constructor.
- */
- protected PfKey() {
- super();
- }
-
/**
* Copy constructor.
*
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.ws.rs.core.Response;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
import lombok.NonNull;
/**
* exist in Policy Framework (particularly the engine) at any time. Of course the model in a JVM can be changed at any
* time provided all users of the model are stopped and restarted in an orderly manner.
*/
-public abstract class PfModelService {
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class PfModelService {
// The map holding the models
private static Map<String, PfConcept> modelMap = new ConcurrentHashMap<>();
- /**
- * This class is an abstract static class that cannot be extended.
- */
- private PfModelService() {
- // Default constructor
- }
-
/**
* Register a model with the model service.
*
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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;
import org.apache.commons.collections4.MapUtils;
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class PfUtils {
- private PfUtils() {
- // Cannot be subclassed
- }
/**
* Compare two objects using their equals methods, nulls are allowed.
<!--
============LICENSE_START=======================================================
Copyright (C) 2019 Nordix Foundation.
- Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.3.1</version>
- </dependency>
</dependencies>
</project>
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.models.dao;
import java.util.Properties;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
/**
* This class is a POJO that holds properties for PF DAOs.
*
* @author Liam Fallon (liam.fallon@est.tech)
*/
+@Getter
+@Setter
+@ToString
public class DaoParameters {
/** The default PF DAO plugin class. */
public static final String DEFAULT_PLUGIN_CLASS = "org.onap.policy.models.dao.impl.DefaultPfDao";
private Properties jdbcProperties = new Properties();
- /**
- * Gets the DAO plugin class, this is the DAO class to use and it must implement the
- * {@link PfDao} interface.
- *
- * @return the DAO plugin class
- */
- public String getPluginClass() {
- return pluginClass;
- }
-
- /**
- * Sets the DAO plugin class, a class that implements the {@link PfDao} interface.
- *
- * @param daoPluginClass the DAO plugin class
- */
- public void setPluginClass(final String daoPluginClass) {
- pluginClass = daoPluginClass;
- }
-
- /**
- * Gets the persistence unit for the DAO. The persistence unit defines the JDBC properties the
- * DAO will use. The persistence unit must defined in the {@code META-INF/persistence.xml}
- * resource file
- *
- * @return the persistence unit to use for JDBC access
- */
- public String getPersistenceUnit() {
- return persistenceUnit;
- }
-
- /**
- * Sets the persistence unit for the DAO. The persistence unit defines the JDBC properties the
- * DAO will use. The persistence unit must defined in the {@code META-INF/persistence.xml}
- * resource file
- *
- * @param daoPersistenceUnit the persistence unit to use for JDBC access
- */
- public void setPersistenceUnit(final String daoPersistenceUnit) {
- persistenceUnit = daoPersistenceUnit;
- }
-
- /**
- * Gets the JDBC properties.
- *
- * @return the JDBC properties
- */
- public Properties getJdbcProperties() {
- return jdbcProperties;
- }
-
- /**
- * Sets the JDBC properties.
- *
- * @param jdbcProperties the JDBC properties
- */
- public void setJdbcProperties(final Properties jdbcProperties) {
- this.jdbcProperties = jdbcProperties;
- }
-
/**
* Gets a single JDBC property.
*
public void setJdbcProperty(final String key, final String value) {
jdbcProperties.setProperty(key, value);
}
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "DAOParameters [pluginClass=" + pluginClass + ", persistenceUnit=" + persistenceUnit
- + ", jdbcProperties=" + jdbcProperties + "]";
- }
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
pars.setPluginClass(SOMEWHERE_OVER_THE_RAINBOW);
assertEquals(SOMEWHERE_OVER_THE_RAINBOW, pars.getPluginClass());
- assertEquals("DAOParameters [pluginClass=somewhere.over.the.rainbow, "
- + "persistenceUnit=Kansas, jdbcProperties={name=Dorothy}]", pars.toString());
+ assertEquals("DaoParameters(pluginClass=somewhere.over.the.rainbow, "
+ + "persistenceUnit=Kansas, jdbcProperties={name=Dorothy})", pars.toString());
}
}
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* No arguments constructor.
*/
public Abated() {
- super();
setClosedLoopEventStatus(ControlLoopEventStatus.ABATED);
}
* ============LICENSE_START=======================================================
* controlloop
* ================================================================================
- * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.controlloop;
-public class ControlLoopTargetType {
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ControlLoopTargetType {
public static final String VM = "VM";
public static final String VF = "VF";
public static final String VFC = "VFC";
public static final String VNF = "VNF";
public static final String PNF = "PNF";
-
- private ControlLoopTargetType() {
- // do nothing
- }
}
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* No arguments constructor.
*/
public Onset() {
- super();
setClosedLoopEventStatus(ControlLoopEventStatus.ONSET);
}
* ============LICENSE_START=======================================================
* controlloop
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.controlloop;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
public class PhysicalControlLoopEvent extends ControlLoopEvent {
private static final long serialVersionUID = -7282930271094849487L;
- public PhysicalControlLoopEvent() {
- // Default constructor
- }
-
/**
* Construct an instance from an existing instance.
*
* ============LICENSE_START=======================================================
* controlloop
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.controlloop;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
public class PhysicalControlLoopNotification extends ControlLoopNotification {
private static final long serialVersionUID = 8105197217140032892L;
- public PhysicalControlLoopNotification() {
- // Default constructor
- }
-
/**
* Construct an instance from an existing instance.
*
import java.time.Instant;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
import org.onap.policy.common.gson.InstantAsMillisTypeAdapter;
import org.onap.policy.common.gson.ZonedDateTimeTypeAdapter;
import org.onap.policy.controlloop.ControlLoopNotificationType;
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class Serialization {
public static final DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSSxxx");
.registerTypeAdapter(ZonedDateTime.class, new ZonedDateTimeTypeAdapter(format))
.registerTypeAdapter(Instant.class, new InstantAsMillisTypeAdapter()).create();
- private Serialization() {
- // Private constructor to prevent subclassing
- }
-
public static class NotificationTypeAdapter
implements JsonSerializer<ControlLoopNotificationType>, JsonDeserializer<ControlLoopNotificationType> {
@Override