aboutsummaryrefslogtreecommitdiffstats
path: root/model/src
diff options
context:
space:
mode:
authorramverma <ram.krishna.verma@ericsson.com>2018-09-13 16:31:35 +0100
committerramverma <ram.krishna.verma@ericsson.com>2018-09-13 22:06:26 +0100
commite80efa0dbe903e976f5b2799144658c7ba02e534 (patch)
tree231204269e12123ea3577679bcf91de2a39500e9 /model/src
parent31def9f82514182e6761fac5ecae70333155aabc (diff)
Adding policy decoder to extract file from csar
* Adding decoder configuration parameters infrastructure to support plugin based architecture. Adding a new policy decoder after this will be just creating a new decoder class and its corresponding parameter class. * Adding a new decoder which extracts policy file from given csar. It is written in a generic way to extract file for any pdp like apex, drools. * Adding configuration parameters for the new decoder. The policy file name and policy type is passed as parameter to the decoder. * Fixing few broken package declaration in pdpx decoder tests. * Adding test cases for all code changes. Change-Id: I95e68cebce0f9747ca63b090f9b9116ce8836939 Issue-ID: POLICY-1101 Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
Diffstat (limited to 'model/src')
-rw-r--r--model/src/main/java/org/onap/policy/distribution/model/PolicyAsString.java (renamed from model/src/main/java/org/onap/policy/distribution/model/ApexPdpPolicy.java)29
1 files changed, 15 insertions, 14 deletions
diff --git a/model/src/main/java/org/onap/policy/distribution/model/ApexPdpPolicy.java b/model/src/main/java/org/onap/policy/distribution/model/PolicyAsString.java
index a8f45764..1600d8f7 100644
--- a/model/src/main/java/org/onap/policy/distribution/model/ApexPdpPolicy.java
+++ b/model/src/main/java/org/onap/policy/distribution/model/PolicyAsString.java
@@ -20,35 +20,36 @@
package org.onap.policy.distribution.model;
-import java.io.InputStream;
-
/**
- * This class represents an apex-pdp policy which can be decoded by a relevant {@link PolicyDecoder}.
+ * This class represents a policy which can be decoded by a relevant {@link PolicyDecoder}.
*
* @author Ram Krishna Verma (ram.krishna.verma@ericsson.com)
*/
-public class ApexPdpPolicy implements Policy {
+public class PolicyAsString implements Policy {
private String policyName;
- private InputStream policyInputStream;
+ private String policyType;
+ private String policy;
/**
- * Constructor for creating instance of {@link ApexPdpPolicy}.
+ * Constructor for creating instance of {@link PolicyAsString}.
*
* @param policyName the policy file name
- * @param policyInputStream the input stream
+ * @param policyType the policy type
+ * @param policy the policy
*/
- public ApexPdpPolicy(final String policyName, final InputStream policyInputStream) {
+ public PolicyAsString(final String policyName, final String policyType, final String policy) {
this.policyName = policyName;
- this.policyInputStream = policyInputStream;
+ this.policyType = policyType;
+ this.policy = policy;
}
/**
- * Returns the policyInputStream of this ApexPdpPolicy instance.
+ * Returns the policy of this {@link PolicyAsString} instance.
*
- * @return the policyInputStream
+ * @return the policy
*/
- public InputStream getPolicyInputStream() {
- return policyInputStream;
+ public String getPolicy() {
+ return policy;
}
/**
@@ -64,6 +65,6 @@ public class ApexPdpPolicy implements Policy {
*/
@Override
public String getPolicyType() {
- return "Method not supported";
+ return policyType;
}
}