aboutsummaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
Diffstat (limited to 'model')
-rw-r--r--model/pom.xml5
-rw-r--r--model/src/main/java/org/onap/policy/distribution/model/OptimizationPolicy.java95
2 files changed, 28 insertions, 72 deletions
diff --git a/model/pom.xml b/model/pom.xml
index 9cd53650..9e7e9f63 100644
--- a/model/pom.xml
+++ b/model/pom.xml
@@ -35,5 +35,10 @@
<artifactId>utils</artifactId>
<version>${policy.common.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
+ </dependency>
</dependencies>
</project>
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 2ca3c945..9a889eed 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
@@ -22,10 +22,22 @@ package org.onap.policy.distribution.model;
import java.util.Date;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import org.apache.commons.lang3.NotImplementedException;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
+
/**
* An optimization policy.
*/
-public class OptimizationPolicy implements Policy {
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = true)
+public class OptimizationPolicy extends ToscaEntity {
private static final String OPTIMIZATION = "Optimization";
private String policyName;
@@ -39,84 +51,23 @@ public class OptimizationPolicy implements Policy {
private String riskType;
@Override
- public String getPolicyName() {
+ public String getName() {
return policyName;
}
@Override
- public String getPolicyType() {
- return OPTIMIZATION;
- }
-
- public void setPolicyName(final String policyName) {
- this.policyName = policyName;
- }
-
- public String getPolicyDescription() {
- return policyDescription;
- }
-
- public void setPolicyDescription(final String policyDescription) {
- this.policyDescription = policyDescription;
- }
-
- public String getPolicyConfigType() {
- return getPolicyType();
- }
-
- public String getOnapName() {
- return onapName;
- }
-
- public void setOnapName(final String onapName) {
- this.onapName = onapName;
- }
-
- public String getConfigBody() {
- return configBody;
- }
-
- public void setConfigBody(final String configBody) {
- this.configBody = configBody;
+ public void setName(final String name) {
+ this.policyName = name;
}
- public String getConfigBodyType() {
- return configBodyType;
- }
-
- public void setConfigBodyType(final String configBodyType) {
- this.configBodyType = configBodyType;
- }
-
- public Date getTimetolive() {
- return timetolive;
- }
-
- public void setTimetolive(final Date timetolive) {
- this.timetolive = timetolive;
- }
-
- public String getGuard() {
- return guard;
- }
-
- public void setGuard(final String guard) {
- this.guard = guard;
- }
-
- public String getRiskLevel() {
- return riskLevel;
- }
-
- public void setRiskLevel(final String riskLevel) {
- this.riskLevel = riskLevel;
- }
-
- public String getRiskType() {
- return riskType;
+ @Override
+ public String getVersion() {
+ // Utilizing this method to return the policy type instead of version for the old model.
+ return OPTIMIZATION;
}
- public void setRiskType(final String riskType) {
- this.riskType = riskType;
+ @Override
+ public void setVersion(final String version) {
+ throw new NotImplementedException("Not supported");
}
}