From 7438fe5a86a9fcfaf248ee32197b24d1badaecb3 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 4 Aug 2021 10:41:51 -0400 Subject: Use lombok in apex-pdp #2 Updated context to use lombok. Issue-ID: POLICY-3391 Change-Id: I349e0202fffad161cac08cebaea4a9571db58bda Signed-off-by: Jim Hahn --- .../policy/apex/context/impl/ContextAlbumImpl.java | 76 ++++------------------ .../impl/distribution/AbstractDistributor.java | 44 ++++--------- .../distribution/DistributorFlushTimerTask.java | 13 ++-- .../distribution/jvmlocal/JvmLocalDistributor.java | 8 +-- .../context/impl/locking/AbstractLockManager.java | 10 +-- .../persistence/ephemeral/EphemeralPersistor.java | 11 +--- .../context/impl/schema/AbstractSchemaHelper.java | 27 +------- .../JavaSchemaHelperJsonAdapterParameters.java | 40 ++---------- .../schema/java/JavaSchemaHelperParameters.java | 22 ++----- .../parameters/ContextParameterConstants.java | 21 +++--- .../apex/context/parameters/ContextParameters.java | 76 ++-------------------- .../context/parameters/DistributorParameters.java | 22 ++----- .../context/parameters/LockManagerParameters.java | 22 ++----- .../context/parameters/PersistorParameters.java | 31 ++------- .../context/parameters/SchemaHelperParameters.java | 29 ++------- .../apex/context/parameters/SchemaParameters.java | 22 ++----- 16 files changed, 78 insertions(+), 396 deletions(-) (limited to 'context') diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java index eb2383cae..65a253f87 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications 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. @@ -27,6 +28,9 @@ import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Set; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.onap.policy.apex.context.ContextAlbum; import org.onap.policy.apex.context.ContextException; import org.onap.policy.apex.context.ContextRuntimeException; @@ -47,6 +51,7 @@ import org.slf4j.ext.XLoggerFactory; * * @author Liam Fallon (liam.fallon@ericsson.com) */ +@EqualsAndHashCode(onlyExplicitlyIncluded = true) public final class ContextAlbumImpl implements ContextAlbum, Comparable { // Logger for this class private static final XLogger LOGGER = XLoggerFactory.getXLogger(ContextAlbumImpl.class); @@ -56,18 +61,24 @@ public final class ContextAlbumImpl implements ContextAlbum, Comparable albumMap; // The artifact stack of the artifacts currently using the context album + @Getter + @Setter private AxConcept[] userArtifactStack = null; // The context distributor we are using private final Distributor distributor; // The schema helper that handles translations of Java objects for this album + @Getter private SchemaHelper schemaHelper; // The context monitor for this context album @@ -126,22 +137,6 @@ public final class ContextAlbumImpl implements ContextAlbum, Comparable albumMaps = Collections .synchronizedMap(new HashMap()); // Lock manager for this distributor + @Setter(AccessLevel.PRIVATE) private static LockManager lockManager = null; - // Hold a persistor for this distributor - private Persistor persistor = null; - // Hold a flush timer for this context distributor + @Setter(AccessLevel.PRIVATE) private static DistributorFlushTimerTask flushTimer = null; + // The key of this distributor + @Getter + private AxArtifactKey key = null; + + // Hold a persistor for this distributor + private Persistor persistor = null; + /** * Create an instance of an abstract Context Distributor. */ @@ -105,38 +111,12 @@ public abstract class AbstractDistributor implements Distributor { LOGGER.exit("init(" + key + ")"); } - /** - * Set the static lock manager. - * - * @param incomingLockManager the lock manager value - */ - private static void setLockManager(final LockManager incomingLockManager) { - lockManager = incomingLockManager; - } - - /** - * Set the static flush timer. - * - * @param incomingFlushTimer the flush timer value - */ - private static void setFlushTimer(final DistributorFlushTimerTask incomingFlushTimer) { - flushTimer = incomingFlushTimer; - } - /** * {@inheritDoc}. */ @Override public abstract void shutdown(); - /** - * {@inheritDoc}. - */ - @Override - public AxArtifactKey getKey() { - return key; - } - /** * Create a context album using whatever underlying mechanism we are using for albums. * diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFlushTimerTask.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFlushTimerTask.java index e68f0812c..e98e66148 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFlushTimerTask.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFlushTimerTask.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * 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. @@ -22,6 +23,7 @@ package org.onap.policy.apex.context.impl.distribution; import java.util.Timer; import java.util.TimerTask; +import lombok.ToString; import org.onap.policy.apex.context.ContextException; import org.onap.policy.apex.context.Distributor; import org.onap.policy.apex.context.parameters.ContextParameterConstants; @@ -35,13 +37,16 @@ import org.slf4j.ext.XLoggerFactory; * * @author eeilfn */ +@ToString public class DistributorFlushTimerTask extends TimerTask { private static final XLogger LOGGER = XLoggerFactory.getXLogger(DistributorFlushTimerTask.class); // The timer for flushing + @ToString.Exclude private Timer timer = null; // The context distributor to flush + @ToString.Exclude private final Distributor contextDistributor; // Timing information @@ -104,12 +109,4 @@ public class DistributorFlushTimerTask extends TimerTask { } return true; } - - /** - * {@inheritDoc}. - */ - @Override - public String toString() { - return "ContextDistributorFlushTimerTask [period=" + flushPeriod + ", flushCount=" + flushCount + "]"; - } } diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JvmLocalDistributor.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JvmLocalDistributor.java index ff61bc0bb..65924f463 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JvmLocalDistributor.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JvmLocalDistributor.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * 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. @@ -37,13 +38,6 @@ public class JvmLocalDistributor extends AbstractDistributor { // Logger for this class private static final XLogger LOGGER = XLoggerFactory.getXLogger(JvmLocalDistributor.class); - /** - * Create an instance of a JVM Local Context Distributor. - */ - public JvmLocalDistributor() { - super(); - } - /** * {@inheritDoc}. */ diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/AbstractLockManager.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/AbstractLockManager.java index 4eb878b1c..2ef229193 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/AbstractLockManager.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/AbstractLockManager.java @@ -25,6 +25,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.concurrent.locks.ReadWriteLock; +import lombok.Getter; import org.onap.policy.apex.context.ContextException; import org.onap.policy.apex.context.LockManager; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; @@ -45,6 +46,7 @@ public abstract class AbstractLockManager implements LockManager { private static final String CONTEXT_ITEM = " context item "; // The key of this lock manager + @Getter private AxArtifactKey key = null; // Map of locks in use on this distributor for each context map @@ -59,14 +61,6 @@ public abstract class AbstractLockManager implements LockManager { this.key = lockManagerKey; } - /** - * {@inheritDoc}. - */ - @Override - public AxArtifactKey getKey() { - return key; - } - /** * {@inheritDoc}. */ diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/ephemeral/EphemeralPersistor.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/ephemeral/EphemeralPersistor.java index 32f026633..c4fd5054d 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/ephemeral/EphemeralPersistor.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/ephemeral/EphemeralPersistor.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * 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. @@ -22,6 +23,7 @@ package org.onap.policy.apex.context.impl.persistence.ephemeral; import java.util.Set; import java.util.TreeSet; +import lombok.Getter; import org.onap.policy.apex.context.ContextException; import org.onap.policy.apex.context.Persistor; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; @@ -34,6 +36,7 @@ import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema; * * @author Liam Fallon (liam.fallon@ericsson.com) */ +@Getter public class EphemeralPersistor implements Persistor { // The key of this persistor @@ -47,14 +50,6 @@ public class EphemeralPersistor implements Persistor { this.key = persistorKey; } - /** - * {@inheritDoc}. - */ - @Override - public AxArtifactKey getKey() { - return key; - } - /** * {@inheritDoc}. */ diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java index 44ec22267..d94a59d38 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2019-2020 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. @@ -22,6 +23,7 @@ package org.onap.policy.apex.context.impl.schema; import java.lang.reflect.Constructor; +import lombok.Getter; import org.apache.commons.lang3.NotImplementedException; import org.onap.policy.apex.context.ContextRuntimeException; import org.onap.policy.apex.context.SchemaHelper; @@ -38,6 +40,7 @@ import org.slf4j.ext.XLoggerFactory; * * @author Liam Fallon (liam.fallon@ericsson.com) */ +@Getter public abstract class AbstractSchemaHelper implements SchemaHelper { // Get a reference to the logger private static final XLogger LOGGER = XLoggerFactory.getXLogger(AbstractSchemaHelper.class); @@ -74,30 +77,6 @@ public abstract class AbstractSchemaHelper implements SchemaHelper { this.schema = incomingSchema; } - /** - * {@inheritDoc}. - */ - @Override - public AxKey getUserKey() { - return userKey; - } - - /** - * {@inheritDoc}. - */ - @Override - public AxContextSchema getSchema() { - return schema; - } - - /** - * {@inheritDoc}. - */ - @Override - public Class getSchemaClass() { - return schemaClass; - } - /** * {@inheritDoc}. */ diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperJsonAdapterParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperJsonAdapterParameters.java index 75099f6ad..588f1e6a2 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperJsonAdapterParameters.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperJsonAdapterParameters.java @@ -24,6 +24,8 @@ package org.onap.policy.apex.context.impl.schema.java; import com.google.gson.JsonDeserializer; import com.google.gson.JsonSerializer; import com.google.gson.TypeAdapter; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.onap.policy.common.parameters.BeanValidationResult; import org.onap.policy.common.parameters.BeanValidator; @@ -45,6 +47,8 @@ import org.slf4j.ext.XLoggerFactory; * @author Liam Fallon (liam.fallon@ericsson.com) */ //@formatter:on +@Getter +@Setter public class JavaSchemaHelperJsonAdapterParameters implements ParameterGroup { private static final XLogger LOGGER = XLoggerFactory.getXLogger(JavaSchemaHelperJsonAdapterParameters.class); @@ -71,15 +75,6 @@ public class JavaSchemaHelperJsonAdapterParameters implements ParameterGroup { setAdaptedClass(adaptedClass); } - /** - * Gets the adapted class. - * - * @return the adapted class - */ - public String getAdaptedClass() { - return adaptedClass; - } - /** * Gets the adapted class. * @@ -98,24 +93,6 @@ public class JavaSchemaHelperJsonAdapterParameters implements ParameterGroup { } } - /** - * Sets the adapted class. - * - * @param adaptedClass the new adapted class - */ - public void setAdaptedClass(String adaptedClass) { - this.adaptedClass = adaptedClass; - } - - /** - * Gets the adaptor class. - * - * @return the adaptor class - */ - public String getAdaptorClass() { - return adaptorClass; - } - /** * Gets the adaptor class. * @@ -134,15 +111,6 @@ public class JavaSchemaHelperJsonAdapterParameters implements ParameterGroup { } } - /** - * Sets the adaptor class. - * - * @param adaptorClass the new adaptor class - */ - public void setAdaptorClass(String adaptorClass) { - this.adaptorClass = adaptorClass; - } - /** * {@inheritDoc}. */ diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperParameters.java index 417a2e8ce..65970fdc2 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperParameters.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperParameters.java @@ -23,6 +23,8 @@ package org.onap.policy.apex.context.impl.schema.java; import java.util.LinkedHashMap; import java.util.Map; +import lombok.Getter; +import lombok.Setter; import org.onap.policy.apex.context.parameters.SchemaHelperParameters; import org.onap.policy.common.parameters.annotations.NotNull; import org.onap.policy.common.parameters.annotations.Valid; @@ -32,6 +34,8 @@ import org.onap.policy.common.parameters.annotations.Valid; * * @author Liam Fallon (liam.fallon@ericsson.com) */ +@Getter +@Setter public class JavaSchemaHelperParameters extends SchemaHelperParameters { // Map of specific type adapters for this event private Map jsonAdapters = new LinkedHashMap<>(); @@ -44,22 +48,4 @@ public class JavaSchemaHelperParameters extends SchemaHelperParameters { this.setSchemaHelperPluginClass(JavaSchemaHelper.class.getName()); } - /** - * Get the JSON adapters. - * - * @return the JSON adapters - */ - public Map getJsonAdapters() { - return jsonAdapters; - } - - /** - * Set JSON adapters for the schema helper. - * - * @param jsonAdapters the JSON adapters - */ - public void setJsonAdapters(Map jsonAdapters) { - this.jsonAdapters = jsonAdapters; - } - } diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameterConstants.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameterConstants.java index 9b2ce9c02..d007a1d8d 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameterConstants.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameterConstants.java @@ -1,41 +1,38 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. + * 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. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ package org.onap.policy.apex.context.parameters; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + /** * This class holds constants used when managing context parameter groups in apex. */ -public abstract class ContextParameterConstants { +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public final class ContextParameterConstants { public static final String MAIN_GROUP_NAME = "CONTEXT_PARAMETERS"; public static final String SCHEMA_GROUP_NAME = "CONTEXT_SCHEMA_PARAMETERS"; public static final String SCHEMA_HELPER_GROUP_NAME = "CONTEXT_SCHEMA_HELPER_PARAMETERS"; public static final String DISTRIBUTOR_GROUP_NAME = "CONTEXT_DISTRIBUTOR_PARAMETERS"; public static final String LOCKING_GROUP_NAME = "CONTEXT_LOCKING_PARAMETERS"; public static final String PERSISTENCE_GROUP_NAME = "CONTEXT_PERSISTENCE_PARAMETERS"; - - /** - * Private default constructor to prevent subclassing. - */ - private ContextParameterConstants() { - // Prevents subclassing - } - } diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameters.java index 56b6c8ec4..78c5cb3fc 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameters.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameters.java @@ -21,6 +21,8 @@ package org.onap.policy.apex.context.parameters; +import lombok.Getter; +import lombok.Setter; import org.onap.policy.common.parameters.ParameterGroupImpl; import org.onap.policy.common.parameters.annotations.NotNull; import org.onap.policy.common.parameters.annotations.Valid; @@ -45,6 +47,8 @@ import org.onap.policy.common.parameters.annotations.Valid; * */ @NotNull +@Getter +@Setter public class ContextParameters extends ParameterGroupImpl { private @Valid DistributorParameters distributorParameters = new DistributorParameters(); private @Valid SchemaParameters schemaParameters = new SchemaParameters(); @@ -59,78 +63,6 @@ public class ContextParameters extends ParameterGroupImpl { super(ContextParameterConstants.MAIN_GROUP_NAME); } - /** - * Gets the distributor parameters. - * - * @return the distributor parameters - */ - public DistributorParameters getDistributorParameters() { - return distributorParameters; - } - - /** - * Sets the distributor parameters. - * - * @param distributorParameters the distributor parameters - */ - public void setDistributorParameters(final DistributorParameters distributorParameters) { - this.distributorParameters = distributorParameters; - } - - /** - * Gets the schema parameters. - * - * @return the schema parameters - */ - public SchemaParameters getSchemaParameters() { - return schemaParameters; - } - - /** - * Sets the schema parameters. - * - * @param schemaParameters the schema parameters - */ - public void setSchemaParameters(final SchemaParameters schemaParameters) { - this.schemaParameters = schemaParameters; - } - - /** - * Gets the lock manager parameters. - * - * @return the lock manager parameters - */ - public LockManagerParameters getLockManagerParameters() { - return lockManagerParameters; - } - - /** - * Sets the lock manager parameters. - * - * @param lockManagerParameters the lock manager parameters - */ - public void setLockManagerParameters(final LockManagerParameters lockManagerParameters) { - this.lockManagerParameters = lockManagerParameters; - } - - /** - * Gets the persistor parameters. - * - * @return the persistor parameters - */ - public PersistorParameters getPersistorParameters() { - return persistorParameters; - } - - /** - * Sets the persistor parameters. - * - * @param persistorParameters the persistor parameters - */ - public void setPersistorParameters(final PersistorParameters persistorParameters) { - this.persistorParameters = persistorParameters; - } - @Override public String toString() { return "ContextParameters [name=" + getName() + ", distributorParameters=" + distributorParameters diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java index e1432e6c5..575a8c466 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java @@ -21,6 +21,8 @@ package org.onap.policy.apex.context.parameters; +import lombok.Getter; +import lombok.Setter; import org.onap.policy.apex.context.impl.distribution.jvmlocal.JvmLocalDistributor; import org.onap.policy.common.parameters.ParameterGroupImpl; import org.onap.policy.common.parameters.annotations.ClassName; @@ -34,6 +36,8 @@ import org.onap.policy.common.parameters.annotations.NotNull; * @author Liam Fallon (liam.fallon@ericsson.com) */ @NotNull +@Getter +@Setter public class DistributorParameters extends ParameterGroupImpl { /** The default distributor makes context albums available to all threads in a single JVM. */ public static final String DEFAULT_DISTRIBUTOR_PLUGIN_CLASS = JvmLocalDistributor.class.getName(); @@ -48,24 +52,6 @@ public class DistributorParameters extends ParameterGroupImpl { super(ContextParameterConstants.DISTRIBUTOR_GROUP_NAME); } - /** - * Gets the plugin class. - * - * @return the plugin class - */ - public String getPluginClass() { - return pluginClass; - } - - /** - * Sets the plugin class. - * - * @param pluginClass the plugin class - */ - public void setPluginClass(final String pluginClass) { - this.pluginClass = pluginClass; - } - @Override public String toString() { return "DistributorParameters [name=" + getName() + ", pluginClass=" + pluginClass + "]"; diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java index d49adf464..d1feae8b7 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java @@ -21,6 +21,8 @@ package org.onap.policy.apex.context.parameters; +import lombok.Getter; +import lombok.Setter; import org.onap.policy.apex.context.impl.locking.jvmlocal.JvmLocalLockManager; import org.onap.policy.common.parameters.ParameterGroupImpl; import org.onap.policy.common.parameters.annotations.ClassName; @@ -34,6 +36,8 @@ import org.onap.policy.common.parameters.annotations.NotNull; * @author Liam Fallon (liam.fallon@ericsson.com) */ @NotNull +@Getter +@Setter public class LockManagerParameters extends ParameterGroupImpl { /** * The default lock manager can lock context album instance across all threads in a single JVM. @@ -50,24 +54,6 @@ public class LockManagerParameters extends ParameterGroupImpl { super(ContextParameterConstants.LOCKING_GROUP_NAME); } - /** - * Gets the plugin class. - * - * @return the plugin class - */ - public String getPluginClass() { - return pluginClass; - } - - /** - * Sets the plugin class. - * - * @param pluginClass the plugin class - */ - public void setPluginClass(final String pluginClass) { - this.pluginClass = pluginClass; - } - @Override public String toString() { return "LockManagerParameters [name=" + getName() + ", pluginClass=" + pluginClass + "]"; diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/PersistorParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/PersistorParameters.java index 98865cd88..bdb093780 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/PersistorParameters.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/PersistorParameters.java @@ -21,6 +21,8 @@ package org.onap.policy.apex.context.parameters; +import lombok.Getter; +import lombok.Setter; import org.onap.policy.common.parameters.ParameterGroupImpl; import org.onap.policy.common.parameters.annotations.ClassName; import org.onap.policy.common.parameters.annotations.NotNull; @@ -39,6 +41,8 @@ import org.onap.policy.common.parameters.annotations.NotNull; * @author Liam Fallon (liam.fallon@ericsson.com) */ @NotNull +@Getter +@Setter public class PersistorParameters extends ParameterGroupImpl { /** The default persistor is a dummy persistor that stubs the Persistor interface. */ public static final String DEFAULT_PERSISTOR_PLUGIN_CLASS = @@ -60,33 +64,6 @@ public class PersistorParameters extends ParameterGroupImpl { super(ContextParameterConstants.PERSISTENCE_GROUP_NAME); } - /** - * Gets the plugin class. - * - * @return the plugin class - */ - public String getPluginClass() { - return pluginClass; - } - - /** - * Sets the plugin class. - * - * @param pluginClass the plugin class - */ - public void setPluginClass(final String pluginClass) { - this.pluginClass = pluginClass; - } - - /** - * Gets the flush period in milliseconds. - * - * @return the flush period - */ - public long getFlushPeriod() { - return flushPeriod; - } - /** * Sets the flush period in milliseconds. * diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/SchemaHelperParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/SchemaHelperParameters.java index 0c6d3592b..62feadd28 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/SchemaHelperParameters.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/SchemaHelperParameters.java @@ -21,6 +21,8 @@ package org.onap.policy.apex.context.parameters; +import lombok.Getter; +import lombok.Setter; import org.onap.policy.common.parameters.ParameterGroupImpl; import org.onap.policy.common.parameters.annotations.ClassName; import org.onap.policy.common.parameters.annotations.NotNull; @@ -32,34 +34,11 @@ import org.onap.policy.common.parameters.annotations.NotNull; * @author Liam Fallon (liam.fallon@ericsson.com) */ @NotNull +@Getter +@Setter public class SchemaHelperParameters extends ParameterGroupImpl { private @ClassName String schemaHelperPluginClass; - /** - * Constructor to create a schema helper parameters instance and register the instance with the parameter service. - */ - public SchemaHelperParameters() { - super(); - } - - /** - * Gets the schema helper plugin class. - * - * @return the schema helper plugin class - */ - public String getSchemaHelperPluginClass() { - return schemaHelperPluginClass; - } - - /** - * Sets the schema helper plugin class. - * - * @param pluginClass the schema helper plugin class - */ - public void setSchemaHelperPluginClass(final String pluginClass) { - schemaHelperPluginClass = pluginClass; - } - @Override public String toString() { return "SchemaHelperParameters [name=" + getName() + ", schemaHelperPluginClass=" + schemaHelperPluginClass diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/SchemaParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/SchemaParameters.java index a1dedc5c0..3d371c6f2 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/SchemaParameters.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/SchemaParameters.java @@ -23,6 +23,8 @@ package org.onap.policy.apex.context.parameters; import java.util.Map; import java.util.TreeMap; +import lombok.Getter; +import lombok.Setter; import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters; import org.onap.policy.common.parameters.ParameterGroupImpl; import org.onap.policy.common.parameters.annotations.NotNull; @@ -39,6 +41,8 @@ import org.onap.policy.common.parameters.annotations.Valid; * @author Liam Fallon (liam.fallon@ericsson.com) */ @NotNull +@Getter +@Setter public class SchemaParameters extends ParameterGroupImpl { /** The Java schema flavour is always available for use. */ public static final String DEFAULT_SCHEMA_FLAVOUR = "Java"; @@ -59,24 +63,6 @@ public class SchemaParameters extends ParameterGroupImpl { schemaHelperParameterMap.put(DEFAULT_SCHEMA_FLAVOUR, new JavaSchemaHelperParameters()); } - /** - * Gets a map of the schemas and schema helper parameters that are defined. - * - * @return the schema helper parameter map - */ - public Map getSchemaHelperParameterMap() { - return schemaHelperParameterMap; - } - - /** - * Sets the map of the schemas and schema helper parameters. - * - * @param schemaHelperParameterMap the schema helper parameter map - */ - public void setSchemaHelperParameterMap(final Map schemaHelperParameterMap) { - this.schemaHelperParameterMap = schemaHelperParameterMap; - } - /** * Gets the schema helper parameters for a given context schema flavour. * -- cgit 1.2.3-korg