aboutsummaryrefslogtreecommitdiffstats
path: root/applications/guard/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-07-14 16:47:14 -0400
committerJim Hahn <jrh3@att.com>2021-07-14 17:25:45 -0400
commit85bf9c859768611cf1cc9ab38cf8f75ec33fc0ee (patch)
tree9f2a9aca6a9f8ce9365e524da3143f291bd65447 /applications/guard/src
parent6803c3b370560217215be30514396f75be780a0f (diff)
Use lombok in xacml-pdp
Also: - changed a few fields to private/protected. - swwapped out gson for coder Issue-ID: POLICY-3400 Change-Id: I9a4dba939b77078f78583ada00af182b1a7d95c5 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'applications/guard/src')
-rw-r--r--applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationGuardTranslator.java6
-rw-r--r--applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java6
-rw-r--r--applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java5
3 files changed, 6 insertions, 11 deletions
diff --git a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationGuardTranslator.java b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationGuardTranslator.java
index 90f56a90..162b0626 100644
--- a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationGuardTranslator.java
+++ b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationGuardTranslator.java
@@ -34,6 +34,7 @@ import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
import java.util.UUID;
+import lombok.NoArgsConstructor;
import org.apache.commons.io.IOUtils;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardYamlCoder;
@@ -46,14 +47,11 @@ import org.onap.policy.pdp.xacml.application.common.ToscaPolicyTranslator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@NoArgsConstructor
public class CoordinationGuardTranslator implements ToscaPolicyTranslator {
private static final Logger LOGGER = LoggerFactory.getLogger(CoordinationGuardTranslator.class);
- public CoordinationGuardTranslator() {
- super();
- }
-
@Override
public Object convertPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException {
LOGGER.debug("Using CoordinationGuardTranslator.convertPolicy");
diff --git a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java
index 8a77449c..58fe00b7 100644
--- a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java
+++ b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java
@@ -33,6 +33,7 @@ import java.time.OffsetTime;
import java.time.ZoneOffset;
import java.util.Map;
import lombok.Getter;
+import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.onap.policy.models.decisions.concepts.DecisionRequest;
@@ -41,6 +42,7 @@ import org.onap.policy.pdp.xacml.application.common.ToscaPolicyConversionExcepti
@Getter
@Setter
@ToString
+@NoArgsConstructor
@XACMLRequest(ReturnPolicyIdList = true)
public class GuardPolicyRequest {
private static final String STR_GUARD = "guard";
@@ -109,10 +111,6 @@ public class GuardPolicyRequest {
public static final String PREFIX_RESOURCE_ATTRIBUTE_ID = "urn:org:onap:guard:target:";
- public GuardPolicyRequest() {
- super();
- }
-
/**
* Parses the DecisionRequest into a StdMetadataPolicyRequest.
*
diff --git a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java
index df5fe43e..3aae5fc4 100644
--- a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java
+++ b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java
@@ -39,6 +39,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import lombok.Getter;
+import lombok.NoArgsConstructor;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType;
@@ -67,6 +68,7 @@ import org.onap.policy.pdp.xacml.application.common.operationshistory.CountRecen
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@NoArgsConstructor
public class GuardTranslator implements ToscaPolicyTranslator {
private static final Logger LOGGER = LoggerFactory.getLogger(GuardTranslator.class);
@@ -118,9 +120,6 @@ public class GuardTranslator implements ToscaPolicyTranslator {
//
private static final String VARIABLE_TIMEINRANGE = "timeInRange";
- public GuardTranslator() {
- super();
- }
/**
* Convert the policy.