diff options
Diffstat (limited to 'model')
-rw-r--r-- | model/src/main/java/org/onap/policy/distribution/model/OptimizationPolicy.java | 29 | ||||
-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 |
2 files changed, 30 insertions, 28 deletions
diff --git a/model/src/main/java/org/onap/policy/distribution/model/OptimizationPolicy.java b/model/src/main/java/org/onap/policy/distribution/model/OptimizationPolicy.java index 797ea4b9..971077cc 100644 --- a/model/src/main/java/org/onap/policy/distribution/model/OptimizationPolicy.java +++ b/model/src/main/java/org/onap/policy/distribution/model/OptimizationPolicy.java @@ -5,24 +5,25 @@ * 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.distribution.model; import java.util.Date; /** - * An optimization policy + * An optimization policy. */ public class OptimizationPolicy implements Policy { @@ -48,7 +49,7 @@ public class OptimizationPolicy implements Policy { return OPTIMIZATION; } - public void setPolicyName(String policyName) { + public void setPolicyName(final String policyName) { this.policyName = policyName; } @@ -56,7 +57,7 @@ public class OptimizationPolicy implements Policy { return policyDescription; } - public void setPolicyDescription(String policyDescription) { + public void setPolicyDescription(final String policyDescription) { this.policyDescription = policyDescription; } @@ -64,7 +65,7 @@ public class OptimizationPolicy implements Policy { return policyConfigType; } - public void setPolicyConfigType(String policyConfigType) { + public void setPolicyConfigType(final String policyConfigType) { this.policyConfigType = policyConfigType; } @@ -72,7 +73,7 @@ public class OptimizationPolicy implements Policy { return onapName; } - public void setOnapName(String onapName) { + public void setOnapName(final String onapName) { this.onapName = onapName; } @@ -80,7 +81,7 @@ public class OptimizationPolicy implements Policy { return configBody; } - public void setConfigBody(String configBody) { + public void setConfigBody(final String configBody) { this.configBody = configBody; } @@ -88,7 +89,7 @@ public class OptimizationPolicy implements Policy { return configBodyType; } - public void setConfigBodyType(String configBodyType) { + public void setConfigBodyType(final String configBodyType) { this.configBodyType = configBodyType; } @@ -96,7 +97,7 @@ public class OptimizationPolicy implements Policy { return timetolive; } - public void setTimetolive(Date timetolive) { + public void setTimetolive(final Date timetolive) { this.timetolive = timetolive; } @@ -104,7 +105,7 @@ public class OptimizationPolicy implements Policy { return guard; } - public void setGuard(String guard) { + public void setGuard(final String guard) { this.guard = guard; } @@ -112,7 +113,7 @@ public class OptimizationPolicy implements Policy { return riskLevel; } - public void setRiskLevel(String riskLevel) { + public void setRiskLevel(final String riskLevel) { this.riskLevel = riskLevel; } @@ -120,7 +121,7 @@ public class OptimizationPolicy implements Policy { return riskType; } - public void setRiskType(String riskType) { + public void setRiskType(final String riskType) { this.riskType = riskType; } } 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; } } |