From 71aacf6cf96b35020937aefc799122ab695f2a31 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 10 Aug 2018 18:16:21 -0400 Subject: update AAI response classes per API Several of the AAI response classes did not match the new AAI interface. Updated AaiGetVnfResponse and AaiGetVserverResponse and the classes they use to reflect the new API; other top-level classes were left untouched. Fix checkstyle errors. Change-Id: Ife5830c45ba8aece8d676a10f0fd8a9c9fe6cb66 Issue-ID: POLICY-964 Signed-off-by: Jim Hahn --- .../java/org/onap/policy/aai/AaiGetResponse.java | 61 +--------------------- .../org/onap/policy/aai/AaiGetVnfResponse.java | 57 +++++++++++++++++++- .../org/onap/policy/aai/AaiGetVserverResponse.java | 49 ++++------------- .../java/org/onap/policy/aai/AaiNqVServer.java | 14 ++++- .../org/onap/policy/aai/RelatedToProperty.java | 31 ++++++----- .../org/onap/policy/aai/RelatedToPropertyItem.java | 50 ------------------ .../java/org/onap/policy/aai/Relationship.java | 20 +++---- .../java/org/onap/policy/aai/RelationshipData.java | 31 +++++++---- .../org/onap/policy/aai/RelationshipDataItem.java | 50 ------------------ .../java/org/onap/policy/aai/RelationshipItem.java | 42 --------------- .../java/org/onap/policy/aai/RelationshipList.java | 14 ++--- 11 files changed, 135 insertions(+), 284 deletions(-) delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToPropertyItem.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipItem.java (limited to 'controlloop/common/model-impl/aai/src/main') diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java index e47d31912..e702db699 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java @@ -25,74 +25,15 @@ import com.google.gson.annotations.SerializedName; import java.io.Serializable; public class AaiGetResponse implements Serializable { - - /** - * define common fields for AAIGETVnfResponse and AAIGETVserverResponse. - */ - private static final long serialVersionUID = 7311418432051756161L; - - @SerializedName("in-maint") - private String inMaint; - - @SerializedName("is-closed-loop-disabled") - private String isClosedLoopDisabled; - - @SerializedName("model-invariant-id") - private String modelInvariantId; - - @SerializedName("resource-version") - private String resourceVersion; - - @SerializedName("relationship-list") - private RelationshipList relationshipList; + private static final long serialVersionUID = 7311418432051756162L; @SerializedName("requestError") private AaiNqRequestError requestError; - public String getInMaint() { - return inMaint; - } - - public String getIsClosedLoopDisabled() { - return isClosedLoopDisabled; - } - - public String getModelInvariantId() { - return modelInvariantId; - } - - public String getResourceVersion() { - return resourceVersion; - } - - public RelationshipList getRelationshipList() { - return relationshipList; - } - public AaiNqRequestError getRequestError() { return requestError; } - public void setInMaint(String inMaint) { - this.inMaint = inMaint; - } - - public void setIsClosedLoopDisabled(String isClosedLoopDisabled) { - this.isClosedLoopDisabled = isClosedLoopDisabled; - } - - public void setModelInvariantId(String modelInvariantId) { - this.modelInvariantId = modelInvariantId; - } - - public void setResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - } - - public void setRelationshipList(RelationshipList relationshipList) { - this.relationshipList = relationshipList; - } - public void setRequestError(AaiNqRequestError requestError) { this.requestError = requestError; } diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java index ccc0fa4c3..8db3a7619 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java @@ -26,7 +26,7 @@ import java.io.Serializable; public class AaiGetVnfResponse extends AaiGetResponse implements Serializable { - private static final long serialVersionUID = -6247505944905898870L; + private static final long serialVersionUID = -6247505944905898871L; @SerializedName("vnf-id") private String vnfId; @@ -43,6 +43,21 @@ public class AaiGetVnfResponse extends AaiGetResponse implements Serializable { @SerializedName("orchestration-status") private String orchestrationStatus; + @SerializedName("in-maint") + private boolean inMaint; + + @SerializedName("is-closed-loop-disabled") + private boolean isClosedLoopDisabled; + + @SerializedName("model-invariant-id") + private String modelInvariantId; + + @SerializedName("resource-version") + private String resourceVersion; + + @SerializedName("relationship-list") + private RelationshipList relationshipList; + public String getVnfId() { return vnfId; } @@ -63,6 +78,26 @@ public class AaiGetVnfResponse extends AaiGetResponse implements Serializable { return orchestrationStatus; } + public boolean getInMaint() { + return inMaint; + } + + public boolean getIsClosedLoopDisabled() { + return isClosedLoopDisabled; + } + + public String getModelInvariantId() { + return modelInvariantId; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public RelationshipList getRelationshipList() { + return relationshipList; + } + public void setVnfId(String vnfId) { this.vnfId = vnfId; } @@ -82,4 +117,24 @@ public class AaiGetVnfResponse extends AaiGetResponse implements Serializable { public void setOrchestrationStatus(String orchestrationStatus) { this.orchestrationStatus = orchestrationStatus; } + + public void setInMaint(boolean inMaint) { + this.inMaint = inMaint; + } + + public void setIsClosedLoopDisabled(boolean isClosedLoopDisabled) { + this.isClosedLoopDisabled = isClosedLoopDisabled; + } + + public void setModelInvariantId(String modelInvariantId) { + this.modelInvariantId = modelInvariantId; + } + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } } diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java index ca258a93c..a2d4b856a 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java @@ -23,52 +23,21 @@ package org.onap.policy.aai; import com.google.gson.annotations.SerializedName; import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; public class AaiGetVserverResponse extends AaiGetResponse implements Serializable { - private static final long serialVersionUID = -6247505944905898870L; + private static final long serialVersionUID = -6247505944905898871L; - @SerializedName("vserver-id") - private String vserverId; + @SerializedName("vserver") + private List vserver = new LinkedList<>(); - @SerializedName("vserver-name") - private String vserverName; - - @SerializedName("vserver-name2") - private String vserverName2; - - @SerializedName("vserver-selflink") - private String vserverSelflink; - - public String getVserverId() { - return vserverId; - } - - public String getVserverName() { - return vserverName; - } - - public String getVserverName2() { - return vserverName2; - } - - public String getVserverSelflink() { - return vserverSelflink; - } - - public void setVserverId(String vserverId) { - this.vserverId = vserverId; - } - - public void setVserverName(String vserverName) { - this.vserverName = vserverName; - } - - public void setVserverName2(String vserverName2) { - this.vserverName2 = vserverName2; + public List getVserver() { + return vserver; } - public void setVserverSelflink(String vserverSelflink) { - this.vserverSelflink = vserverSelflink; + public void setVserver(List vserver) { + this.vserver = vserver; } } diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java index 9ec86c12a..c624497f1 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 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. @@ -51,6 +51,9 @@ public class AaiNqVServer implements Serializable { @SerializedName("resource-version") private String resourceVersion; + @SerializedName("relationship-list") + private RelationshipList relationshipList; + public String getVserverId() { return vserverId; } @@ -83,6 +86,10 @@ public class AaiNqVServer implements Serializable { return resourceVersion; } + public RelationshipList getRelationshipList() { + return relationshipList; + } + public void setVserverId(String vserverId) { this.vserverId = vserverId; } @@ -115,5 +122,8 @@ public class AaiNqVServer implements Serializable { this.resourceVersion = resourceVersion; } + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } } diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java index ab6d0a6ee..ca126d12c 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 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. @@ -23,21 +23,28 @@ package org.onap.policy.aai; import com.google.gson.annotations.SerializedName; import java.io.Serializable; -import java.util.LinkedList; -import java.util.List; public class RelatedToProperty implements Serializable { - private static final long serialVersionUID = 2088088164920423658L; + private static final long serialVersionUID = 5644372985092588638L; - @SerializedName("related-to-property") - private List relatedTo = new LinkedList<>(); + @SerializedName("property-key") + private String propertyKey; + @SerializedName("property-value") + private String propertyValue; - public List getRelatedTo() { - return relatedTo; + public String getPropertyKey() { + return propertyKey; } - public void setRelatedTo(List relatedTo) { - this.relatedTo = relatedTo; + public String getPropertyValue() { + return propertyValue; + } + + public void setPropertyKey(String propertyKey) { + this.propertyKey = propertyKey; } -} + public void setPropertyValue(String propertyValue) { + this.propertyValue = propertyValue; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToPropertyItem.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToPropertyItem.java deleted file mode 100644 index ee7d108b5..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToPropertyItem.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017 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. - * 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. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.aai; - -import com.google.gson.annotations.SerializedName; - -import java.io.Serializable; - -public class RelatedToPropertyItem implements Serializable { - private static final long serialVersionUID = 5644372985092588637L; - - @SerializedName("property-key") - private String propertyKey; - @SerializedName("property-value") - private String propertyValue; - - public String getPropertyKey() { - return propertyKey; - } - - public String getPropertyValue() { - return propertyValue; - } - - public void setPropertyKey(String propertyKey) { - this.propertyKey = propertyKey; - } - - public void setPropertyValue(String propertyValue) { - this.propertyValue = propertyValue; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java index 732b645be..496129825 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 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. @@ -23,9 +23,11 @@ package org.onap.policy.aai; import com.google.gson.annotations.SerializedName; import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; public class Relationship implements Serializable { - private static final long serialVersionUID = -68508443869003054L; + private static final long serialVersionUID = -68508443869003055L; @SerializedName("related-to") private String relatedTo; @@ -34,10 +36,10 @@ public class Relationship implements Serializable { private String relatedLink; @SerializedName("relationship-data") - private RelationshipData relationshipData = new RelationshipData(); + private List relationshipData = new LinkedList<>(); @SerializedName("related-to-property") - private RelatedToProperty relatedToProperty = new RelatedToProperty(); + private List relatedToProperty = new LinkedList<>(); public String getRelatedTo() { return relatedTo; @@ -47,11 +49,11 @@ public class Relationship implements Serializable { return relatedLink; } - public RelationshipData getRelationshipData() { + public List getRelationshipData() { return relationshipData; } - public RelatedToProperty getRelatedToProperty() { + public List getRelatedToProperty() { return relatedToProperty; } @@ -63,11 +65,11 @@ public class Relationship implements Serializable { this.relatedLink = relatedLink; } - public void setRelationshipData(RelationshipData relationshipData) { + public void setRelationshipData(List relationshipData) { this.relationshipData = relationshipData; } - public void setRelatedToProperty(RelatedToProperty relatedToProperty) { + public void setRelatedToProperty(List relatedToProperty) { this.relatedToProperty = relatedToProperty; } } diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java index 454f9871a..24170803d 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 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. @@ -23,19 +23,28 @@ package org.onap.policy.aai; import com.google.gson.annotations.SerializedName; import java.io.Serializable; -import java.util.LinkedList; -import java.util.List; public class RelationshipData implements Serializable { - private static final long serialVersionUID = 6809180843309562121L; - @SerializedName("relationship-data") - private List relationshipDataList = new LinkedList<>(); + private static final long serialVersionUID = 550450041634939768L; - public List getRelationshipData() { - return relationshipDataList; + @SerializedName("relationship-key") + private String relationshipKey; + @SerializedName("relationship-value") + private String relationshipValue; + + public String getRelationshipKey() { + return relationshipKey; + } + + public String getRelationshipValue() { + return relationshipValue; + } + + public void setRelationshipKey(String relationshipKey) { + this.relationshipKey = relationshipKey; } - public void setRelationshipData(List relationshipData) { - this.relationshipDataList = relationshipData; + public void setRelationshipValue(String relationshipValue) { + this.relationshipValue = relationshipValue; } } diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java deleted file mode 100644 index bab45d486..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017 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. - * 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. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.aai; - -import com.google.gson.annotations.SerializedName; - -import java.io.Serializable; - -public class RelationshipDataItem implements Serializable { - private static final long serialVersionUID = 550450041634939767L; - - @SerializedName("relationship-key") - private String relationshipKey; - @SerializedName("relationship-value") - private String relationshipValue; - - public String getRelationshipKey() { - return relationshipKey; - } - - public String getRelationshipValue() { - return relationshipValue; - } - - public void setRelationshipKey(String relationshipKey) { - this.relationshipKey = relationshipKey; - } - - public void setRelationshipValue(String relationshipValue) { - this.relationshipValue = relationshipValue; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipItem.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipItem.java deleted file mode 100644 index 179785717..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipItem.java +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017 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. - * 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. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.aai; - -import com.google.gson.annotations.SerializedName; - -import java.io.Serializable; -import java.util.LinkedList; -import java.util.List; - -public class RelationshipItem implements Serializable { - private static final long serialVersionUID = 1543404460741069628L; - - @SerializedName("related-to-property") - private List relatedToProperty = new LinkedList<>(); - - public List getRelatedToProperty() { - return relatedToProperty; - } - - public void setRelatedToProperty(List relatedToProperty) { - this.relatedToProperty = relatedToProperty; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java index 347676820..8db1c7a39 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 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. @@ -27,17 +27,17 @@ import java.util.LinkedList; import java.util.List; public class RelationshipList implements Serializable { - private static final long serialVersionUID = 6115655704973981989L; + private static final long serialVersionUID = 6115655704973981990L; - @SerializedName("relationship-list") + @SerializedName("relationship") private List relationships = new LinkedList<>(); - public List getRelationshipList() { + public List getRelationships() { return relationships; } - public void setRelationshipList(List relationshipList) { - this.relationships = relationshipList; + public void setRelationships(List relationships) { + this.relationships = relationships; } -- cgit 1.2.3-korg