final var jsonbean = RestUtils.getJsonParameters(jsonString, BeanContextAlbum.class);
ApexApiResult result = session.getApexModelEdited().createContextAlbum(jsonbean.getName(),
- jsonbean.getVersion(), jsonbean.getScope(), Boolean.toString(jsonbean.getWriteable()),
+ jsonbean.getVersion(), jsonbean.getScope(), Boolean.toString(jsonbean.isWriteable()),
jsonbean.getItemSchema().getName(), jsonbean.getItemSchema().getVersion(), jsonbean.getUuid(),
jsonbean.getDescription());
final var jsonbean = RestUtils.getJsonParameters(jsonString, BeanContextAlbum.class);
ApexApiResult result = session.getApexModelEdited().updateContextAlbum(jsonbean.getName(),
- jsonbean.getVersion(), jsonbean.getScope(), Boolean.toString(jsonbean.getWriteable()),
+ jsonbean.getVersion(), jsonbean.getScope(), Boolean.toString(jsonbean.isWriteable()),
jsonbean.getItemSchema().getName(), jsonbean.getItemSchema().getVersion(), jsonbean.getUuid(),
jsonbean.getDescription());
final ApexApiResult createParResult = session.getApexModelEdited().createEventPar(jsonbean.getName(),
jsonbean.getVersion(), parameterEntry.getKey(), parameterEntry.getValue().getName(),
- parameterEntry.getValue().getVersion(), parameterEntry.getValue().getOptional());
+ parameterEntry.getValue().getVersion(), parameterEntry.getValue().isOptional());
if (createParResult.isNok()) {
result.setResult(createParResult.getResult());
result.addMessage("Failed to add event parameter information for parameter \"" + parameterEntry.getKey()
} else {
ApexApiResult fieldCreationResult = session.getApexModelEdited().createTaskInputField(
jsonbean.getName(), jsonbean.getVersion(), fieldEntry.getKey(), fieldEntry.getValue().getName(),
- fieldEntry.getValue().getVersion(), fieldEntry.getValue().getOptional());
+ fieldEntry.getValue().getVersion(), fieldEntry.getValue().isOptional());
if (fieldCreationResult.isNok()) {
result.setResult(fieldCreationResult.getResult());
} else {
ApexApiResult fieldCreationResult = session.getApexModelEdited().createTaskOutputField(
jsonbean.getName(), jsonbean.getVersion(), fieldEntry.getKey(), fieldEntry.getValue().getName(),
- fieldEntry.getValue().getVersion(), fieldEntry.getValue().getOptional());
+ fieldEntry.getValue().getVersion(), fieldEntry.getValue().isOptional());
if (fieldCreationResult.isNok()) {
result.setResult(fieldCreationResult.getResult());
result.addMessage("Failed to add task output field information for field \"" + fieldEntry.getKey()
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
package org.onap.policy.gui.editors.apex.rest.handling.bean;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
/**
* The ContextAlbum Bean.
*/
@XmlType
+@Getter
+@ToString
public class BeanContextAlbum extends BeanBase {
private String name = null;
private String version = null;
private String description = null;
private BeanKeyRef itemSchema = null;
private boolean writeable;
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Gets the scope.
- *
- * @return the scope
- */
- public String getScope() {
- return scope;
- }
-
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the item schema.
- *
- * @return the item schema
- */
- public BeanKeyRef getItemSchema() {
- return itemSchema;
- }
-
- /**
- * Gets the writeable.
- *
- * @return the writeable
- */
- public boolean getWriteable() {
- return writeable;
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "ContextAlbum [name=" + name + ", version=" + version + ", scope=" + scope + ", uuid=" + uuid
- + ", description=" + description + ", itemSchema=" + itemSchema + ", writeable=" + writeable + "]";
- }
}
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
import java.util.Map;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
/**
* The Event Bean.
*/
@XmlType
+@Getter
+@ToString
public class BeanEvent extends BeanBase {
private String name = null;
private String version = null;
private String description = null;
private Map<String, BeanField> parameters = null;
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Gets the name space.
- *
- * @return the name space
- */
- public String getNameSpace() {
- return nameSpace;
- }
-
- /**
- * Gets the source.
- *
- * @return the source
- */
- public String getSource() {
- return source;
- }
-
- /**
- * Gets the target.
- *
- * @return the target
- */
- public String getTarget() {
- return target;
- }
-
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the parameters.
- *
- * @return the parameters
- */
- public Map<String, BeanField> getParameters() {
- return parameters;
- }
-
/**
* Gets the parameter.
*
}
return null;
}
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "Event [name=" + name + ", version=" + version + ", nameSpace=" + nameSpace + ", source=" + source
- + ", target=" + target + ", uuid=" + uuid + ", description=" + description + ", parameters="
- + getParameters() + "]";
- }
-
}
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
package org.onap.policy.gui.editors.apex.rest.handling.bean;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
/**
* The Field Bean.
*/
@XmlType
+@Getter
+@ToString
public class BeanField extends BeanKeyRef {
private boolean optional = true;
private String localName = null;
-
- /**
- * Gets the local name for this field.
- *
- * @return the local name for this field.
- */
- public String getLocalName() {
- return localName;
- }
-
- /**
- * Gets the optional flag.
- *
- * @return the optional flag
- */
- public boolean getOptional() {
- return optional;
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "Field [localName=" + getLocalName() + ", name=" + getName() + ", version=" + getVersion()
- + ", optional=" + getOptional() + "]";
- }
-
}
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
package org.onap.policy.gui.editors.apex.rest.handling.bean;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
/**
* The Key Reference Bean.
*/
@XmlType
+@Getter
+@ToString
public class BeanKeyRef extends BeanBase {
private String name = null;
private String version = null;
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "KeyRef [name=" + name + ", version=" + version + "]";
- }
-
}
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
package org.onap.policy.gui.editors.apex.rest.handling.bean;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
/**
* The Logic Bean.
*/
@XmlType
+@Getter
+@ToString
public class BeanLogic extends BeanBase {
private String logic = null;
private String logicFlavour = null;
-
- /**
- * Gets the logic flavour.
- *
- * @return the logic flavour
- */
- public String getLogicFlavour() {
- return logicFlavour;
- }
-
- /**
- * Gets the logic.
- *
- * @return the logic
- */
- public String getLogic() {
- return logic;
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "Logic [logicFlavour=" + logicFlavour + ", logic=" + logic + "]";
- }
}
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
import java.util.Map;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
/**
* The Policy Bean.
*/
@XmlType
+@Getter
+@ToString
public class BeanPolicy extends BeanBase {
private String name = null;
private String version = null;
private String firstState = null;
private String template = null;
private Map<String, BeanState> states = null;
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the first state.
- *
- * @return the first state
- */
- public String getFirstState() {
- return firstState;
- }
-
- /**
- * Gets the template.
- *
- * @return the template
- */
- public String getTemplate() {
- return template;
- }
-
- /**
- * Gets the states.
- *
- * @return the states
- */
- public Map<String, BeanState> getStates() {
- return states;
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "Policy [name=" + name + ", version=" + version + ", uuid=" + uuid + ", description=" + description
- + ", firstState=" + firstState + ", template=" + template + ", states=" + states + "]";
- }
-
}
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
import java.util.Arrays;
import java.util.Map;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.Setter;
/**
* The State Bean.
*/
@XmlType
+@Getter
public class BeanState extends BeanBase {
private String name = null;
private BeanKeyRef trigger = null;
+ @Setter
private BeanKeyRef defaultTask = null;
private BeanKeyRef[] contexts = null;
private BeanLogic taskSelectionLogic = null;
private Map<String, BeanLogic> finalizers = null;
private Map<String, BeanStateOutput> stateOutputs = null;
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the trigger.
- *
- * @return the trigger
- */
- public BeanKeyRef getTrigger() {
- return trigger;
- }
-
- /**
- * Gets the contexts.
- *
- * @return the contexts
- */
- public BeanKeyRef[] getContexts() {
- return contexts;
- }
-
- /**
- * Gets the task selection logic.
- *
- * @return the task selection logic
- */
- public BeanLogic getTaskSelectionLogic() {
- return taskSelectionLogic;
- }
-
- /**
- * Gets the tasks.
- *
- * @return the tasks
- */
- public Map<String, BeanStateTaskRef> getTasks() {
- return tasks;
- }
-
- /**
- * Gets the finalizers.
- *
- * @return the finalizers
- */
- public Map<String, BeanLogic> getFinalizers() {
- return finalizers;
- }
-
- /**
- * Gets the state outputs.
- *
- * @return the state outputs
- */
- public Map<String, BeanStateOutput> getStateOutputs() {
- return stateOutputs;
- }
-
- /**
- * Gets the default task.
- *
- * @return the default task
- */
- public BeanKeyRef getDefaultTask() {
- return defaultTask;
- }
-
- /**
- * Sets the default task.
- *
- * @param defaultTask the new default task
- */
- public void setDefaultTask(final BeanKeyRef defaultTask) {
- this.defaultTask = defaultTask;
- }
-
/**
* {@inheritDoc}.
*/
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
package org.onap.policy.gui.editors.apex.rest.handling.bean;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
/**
* The StateOutput Bean.
*/
@XmlType
+@Getter
+@ToString
public class BeanStateOutput extends BeanBase {
private BeanKeyRef event = null;
private String nextState = null;
-
- /**
- * Gets the event.
- *
- * @return the event
- */
- public BeanKeyRef getEvent() {
- return event;
- }
-
- /**
- * Gets the next state.
- *
- * @return the next state
- */
- public String getNextState() {
- return nextState;
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "StateOutput [event=" + event + ", nextState=" + nextState + "]";
- }
-
}
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
package org.onap.policy.gui.editors.apex.rest.handling.bean;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
/**
* The State Task Reference Bean.
*/
@XmlType
+@Getter
+@ToString
public class BeanStateTaskRef extends BeanBase {
private BeanKeyRef task = null;
private String outputType = null;
private String outputName = null;
-
- /**
- * Gets the task.
- *
- * @return the task
- */
- public BeanKeyRef getTask() {
- return task;
- }
-
- /**
- * Gets the output type.
- *
- * @return the output type
- */
- public String getOutputType() {
- return outputType;
- }
-
- /**
- * Gets the output name.
- *
- * @return the output name
- */
- public String getOutputName() {
- return outputName;
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "StateTaskRef [task=" + task + ", outputType=" + outputType + ", outputName=" + outputName + "]";
- }
-
}
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
import java.util.Arrays;
import java.util.Map;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
/**
* The Task Bean.
*/
@XmlType
+@Getter
public class BeanTask extends BeanBase {
private String name = null;
private String version = null;
private Map<String, BeanTaskParameter> parameters = null;
private BeanKeyRef[] contexts = null;
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the task logic.
- *
- * @return the task logic
- */
- public BeanLogic getTaskLogic() {
- return taskLogic;
- }
-
- /**
- * Gets the input fields.
- *
- * @return the input fields
- */
- public Map<String, BeanField> getInputFields() {
- return inputFields;
- }
-
- /**
- * Gets the output fields.
- *
- * @return the output fields
- */
- public Map<String, BeanField> getOutputFields() {
- return outputFields;
- }
-
- /**
- * Gets the parameters.
- *
- * @return the parameters
- */
- public Map<String, BeanTaskParameter> getParameters() {
- return parameters;
- }
-
- /**
- * Gets the contexts.
- *
- * @return the contexts
- */
- public BeanKeyRef[] getContexts() {
- return contexts;
- }
-
/**
* {@inheritDoc}.
*/
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
package org.onap.policy.gui.editors.apex.rest.handling.bean;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
/**
* The Task Parameter Bean.
*/
@XmlType
+@Getter
+@ToString
public class BeanTaskParameter extends BeanBase {
private String parameterName = null;
private String defaultValue = null;
-
- /**
- * Gets the parameter name.
- *
- * @return the parameter name
- */
- public String getParameterName() {
- return parameterName;
- }
-
- /**
- * Gets the default value.
- *
- * @return the default value
- */
- public String getDefaultValue() {
- return defaultValue;
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "TaskParameter [parameterName=" + parameterName + ", defaultValue=" + defaultValue + "]";
- }
-
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2021 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.
final var apexModel = restSession.getApexModel();
assertThat(apexApiResult.isOk()).isTrue();
assertThat(original).isNull();
+ assertThat(apexModelEdited).isNotNull();
assertThat(apexModel).isNotNull();
}
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 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.
package org.onap.policy.gui.editors.apex.rest.handling.bean;
import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
/**
* The Event Bean.
@XmlType
public class DummyBeanBase extends BeanBase {
private String name = null;
+ @Getter
private String version = null;
private String field1 = null;
private int field2 = 0;
return field1;
}
- public String getVersion() {
- return version;
- }
-
public int getField2() {
field3 = field2;
return field3;
pdpMonitoringServer = new PdpMonitoringServer(parameters);
// Add a shutdown hook to shut down the servlet services when the process is exiting
- Runtime.getRuntime().addShutdownHook(new Thread(new PdpServicesShutdownHook()));
+ Runtime.getRuntime().addShutdownHook(new Thread(this::shutdown));
state = ServicesState.RUNNING;
LOGGER.info(PDP_MONITORING_PREFIX + "{}) shutting down", this);
}
- /**
- * This class is a shutdown hook for the Pdp services command.
- */
- private class PdpServicesShutdownHook implements Runnable {
- /**
- * {@inheritDoc}.
- */
- @Override
- public void run() {
- shutdown();
- }
- }
-
/**
* Main method, main entry point for command.
*
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
* A list of values that uses a FIFO sliding window of a fixed size.
*/
@EqualsAndHashCode(callSuper = true)
+ @AllArgsConstructor
public class SlidingWindowList<V> extends LinkedList<V> {
private static final long serialVersionUID = -7187277916025957447L;
private final int maxEntries;
- public SlidingWindowList(final int maxEntries) {
- this.maxEntries = maxEntries;
- }
-
@Override
public boolean add(final V elm) {
if (this.size() > (maxEntries - 1)) {
* A class used to storing a single data entry for an engine.
*/
@Getter
+ @AllArgsConstructor
public class Counter {
private final long timestamp;
private final long value;
-
- public Counter(final long timestamp, final long value) {
- this.timestamp = timestamp;
- this.value = value;
- }
}
}