From f6a81de0fd84186d499c39fe5f2d75c20cb0e301 Mon Sep 17 00:00:00 2001 From: mmis Date: Thu, 22 Mar 2018 16:36:47 +0000 Subject: Removed checkstyle warnings Removed checkstyle warnings from policy/drools-applications/controlloop/common/model-impl/aai including renaming classes: AAI* -> Aai* PNF* -> Pnf* and renaming some methods in those classes Issue-ID: POLICY-705 Change-Id: I2d59a668728aa58a2c9fbe78c44e924e6cfb4531 Signed-off-by: mmis --- .../java/org/onap/policy/aai/AAIGETResponse.java | 100 --------- .../org/onap/policy/aai/AAIGETVnfResponse.java | 85 -------- .../org/onap/policy/aai/AAIGETVserverResponse.java | 74 ------- .../main/java/org/onap/policy/aai/AAIManager.java | 228 -------------------- .../java/org/onap/policy/aai/AAINQCloudRegion.java | 85 -------- .../org/onap/policy/aai/AAINQExtraProperties.java | 42 ---- .../org/onap/policy/aai/AAINQExtraProperty.java | 60 ------ .../java/org/onap/policy/aai/AAINQGenericVNF.java | 217 ------------------- .../org/onap/policy/aai/AAINQInstanceFilters.java | 47 ---- .../policy/aai/AAINQInventoryResponseItem.java | 129 ----------- .../policy/aai/AAINQInventoryResponseItems.java | 42 ---- .../java/org/onap/policy/aai/AAINQNamedQuery.java | 41 ---- .../org/onap/policy/aai/AAINQQueryParameters.java | 40 ---- .../java/org/onap/policy/aai/AAINQRequest.java | 51 ----- .../org/onap/policy/aai/AAINQRequestError.java | 40 ---- .../java/org/onap/policy/aai/AAINQResponse.java | 54 ----- .../org/onap/policy/aai/AAINQResponseWrapper.java | 55 ----- .../org/onap/policy/aai/AAINQServiceExcept.java | 50 ----- .../org/onap/policy/aai/AAINQServiceInstance.java | 117 ---------- .../main/java/org/onap/policy/aai/AAINQTenant.java | 64 ------ .../java/org/onap/policy/aai/AAINQVServer.java | 119 ----------- .../java/org/onap/policy/aai/AAINQVfModule.java | 172 --------------- .../java/org/onap/policy/aai/AaiGetResponse.java | 100 +++++++++ .../org/onap/policy/aai/AaiGetVnfResponse.java | 85 ++++++++ .../org/onap/policy/aai/AaiGetVserverResponse.java | 74 +++++++ .../main/java/org/onap/policy/aai/AaiManager.java | 237 +++++++++++++++++++++ .../java/org/onap/policy/aai/AaiNqCloudRegion.java | 85 ++++++++ .../org/onap/policy/aai/AaiNqExtraProperties.java | 42 ++++ .../org/onap/policy/aai/AaiNqExtraProperty.java | 59 +++++ .../java/org/onap/policy/aai/AaiNqGenericVnf.java | 217 +++++++++++++++++++ .../org/onap/policy/aai/AaiNqInstanceFilters.java | 44 ++++ .../policy/aai/AaiNqInventoryResponseItem.java | 129 +++++++++++ .../policy/aai/AaiNqInventoryResponseItems.java | 42 ++++ .../java/org/onap/policy/aai/AaiNqNamedQuery.java | 41 ++++ .../org/onap/policy/aai/AaiNqQueryParameters.java | 40 ++++ .../java/org/onap/policy/aai/AaiNqRequest.java | 51 +++++ .../org/onap/policy/aai/AaiNqRequestError.java | 40 ++++ .../java/org/onap/policy/aai/AaiNqResponse.java | 53 +++++ .../org/onap/policy/aai/AaiNqResponseWrapper.java | 52 +++++ .../org/onap/policy/aai/AaiNqServiceExcept.java | 50 +++++ .../org/onap/policy/aai/AaiNqServiceInstance.java | 117 ++++++++++ .../main/java/org/onap/policy/aai/AaiNqTenant.java | 64 ++++++ .../java/org/onap/policy/aai/AaiNqVServer.java | 119 +++++++++++ .../java/org/onap/policy/aai/AaiNqVfModule.java | 172 +++++++++++++++ .../aai/src/main/java/org/onap/policy/aai/PNF.java | 84 -------- .../main/java/org/onap/policy/aai/PNFInstance.java | 126 ----------- .../src/main/java/org/onap/policy/aai/PNFType.java | 37 ---- .../aai/src/main/java/org/onap/policy/aai/Pnf.java | 91 ++++++++ .../main/java/org/onap/policy/aai/PnfInstance.java | 137 ++++++++++++ .../src/main/java/org/onap/policy/aai/PnfType.java | 36 ++++ .../org/onap/policy/aai/RelatedToProperty.java | 24 +-- .../org/onap/policy/aai/RelatedToPropertyItem.java | 46 ++-- .../java/org/onap/policy/aai/Relationship.java | 94 ++++---- .../java/org/onap/policy/aai/RelationshipData.java | 24 +-- .../org/onap/policy/aai/RelationshipDataItem.java | 46 ++-- .../java/org/onap/policy/aai/RelationshipItem.java | 26 +-- .../java/org/onap/policy/aai/RelationshipList.java | 28 +-- .../org/onap/policy/aai/util/AAIException.java | 48 ----- .../org/onap/policy/aai/util/AaiException.java | 47 ++++ .../org/onap/policy/aai/util/Serialization.java | 10 +- 60 files changed, 2375 insertions(+), 2354 deletions(-) delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETResponse.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVnfResponse.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVserverResponse.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIManager.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQCloudRegion.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperties.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperty.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQGenericVNF.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInstanceFilters.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItem.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItems.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQNamedQuery.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQQueryParameters.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequest.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequestError.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponse.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponseWrapper.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceExcept.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceInstance.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQTenant.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVServer.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVfModule.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqCloudRegion.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqExtraProperties.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqExtraProperty.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqGenericVnf.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInstanceFilters.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInventoryResponseItem.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInventoryResponseItems.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqNamedQuery.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqQueryParameters.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqRequest.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqRequestError.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqResponse.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqResponseWrapper.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqServiceExcept.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqServiceInstance.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqTenant.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVfModule.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNF.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNFInstance.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNFType.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Pnf.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PnfInstance.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PnfType.java delete mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/AAIException.java create mode 100644 controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/AaiException.java (limited to 'controlloop/common/model-impl/aai/src/main/java/org') 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 deleted file mode 100644 index ef205cfea..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETResponse.java +++ /dev/null @@ -1,100 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -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; - - @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 deleted file mode 100644 index a67963698..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVnfResponse.java +++ /dev/null @@ -1,85 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAIGETVnfResponse extends AAIGETResponse implements Serializable { - - private static final long serialVersionUID = -6247505944905898870L; - - @SerializedName("vnf-id") - private String vnfID; - - @SerializedName("vnf-name") - private String vnfName; - - @SerializedName("vnf-type") - private String vnfType; - - @SerializedName("service-id") - private String serviceId; - - @SerializedName("orchestration-status") - private String orchestrationStatus; - - public String getVnfID() { - return vnfID; - } - - public String getVnfName() { - return vnfName; - } - - public String getVnfType() { - return vnfType; - } - - public String getServiceId() { - return serviceId; - } - - public String getOrchestrationStatus() { - return orchestrationStatus; - } - - public void setVnfID(String vnfID) { - this.vnfID = vnfID; - } - - public void setVnfName(String vnfName) { - this.vnfName = vnfName; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - public void setOrchestrationStatus(String orchestrationStatus) { - this.orchestrationStatus = orchestrationStatus; - } -} \ No newline at end of file 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 deleted file mode 100644 index 05dffc1dd..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIGETVserverResponse.java +++ /dev/null @@ -1,74 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAIGETVserverResponse extends AAIGETResponse implements Serializable { - - private static final long serialVersionUID = -6247505944905898870L; - - @SerializedName("vserver-id") - private String vserverID; - - @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 void setVserverSelflink(String vserverSelflink) { - this.vserverSelflink = vserverSelflink; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIManager.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIManager.java deleted file mode 100644 index 53d32b056..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAIManager.java +++ /dev/null @@ -1,228 +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 java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.onap.policy.aai.util.Serialization; -import org.onap.policy.rest.RESTManager; -import org.onap.policy.rest.RESTManager.Pair; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.gson.JsonSyntaxException; - -/** - * This class handles communication towards and responses from A&AI for this module. - */ -public final class AAIManager { - - /** The Constant LINE_SEPARATOR. */ - private static final String LINE_SEPARATOR = System.lineSeparator(); - - /** The Constant logger. */ - private static final Logger logger = LoggerFactory.getLogger(AAIManager.class); - - /** The Constant netLogger. */ - private static final Logger netLogger = LoggerFactory.getLogger(org.onap.policy.drools.event.comm.Topic.NETWORK_LOGGER); - - /** The rest manager. */ - // The REST manager used for processing REST calls for this AAI manager - private final RESTManager restManager; - - /** - * Constructor, create the AAI manager with the specified REST manager. - * - * @param restManager the rest manager to use for REST calls - */ - public AAIManager(final RESTManager restManager) { - this.restManager = restManager; - } - - /** - * Post a query to A&AI. - * - * @param url the A&AI URL - * @param username the user name for authentication - * @param password the password for authentication - * @param request the request to issue towards A&AI - * @param requestID the UUID of the request - * @return the response from A&AI - */ - public AAINQResponse postQuery(String url, String username, String password, AAINQRequest request, UUID requestID) { - - Map headers = createHeaders(requestID); - - url = url + "/aai/search/named-query"; - - logger.debug("RESTManager.post before"); - String requestJson = Serialization.gsonPretty.toJson(request); - netLogger.info("[OUT|{}|{}|]{}{}", "AAI", url, LINE_SEPARATOR, requestJson); - Pair httpDetails = restManager.post(url, username, password, headers, "application/json", requestJson); - logger.debug("RESTManager.post after"); - - if (httpDetails == null) { - logger.info("AAI POST Null Response to {}", url); - return null; - } - - int httpResponseCode = httpDetails.a; - - logger.info(url); - logger.info("{}", httpResponseCode); - logger.info(httpDetails.b); - - if (httpDetails.b != null) { - return composeResponse(httpDetails, url, AAINQResponse.class); - } - return null; - } - - /** - * Perform a GET request for a particular virtual server towards A&AI. - * - * @param urlGet the A&AI URL - * @param username the user name for authentication - * @param password the password for authentication - * @param requestID the UUID of the request - * @param key the key of the virtual server - * @return the response for the virtual server from A&AI - */ - public AAIGETVserverResponse getQueryByVserverName(String urlGet, String username, String password, UUID requestID, String key) { - return getQuery(urlGet, username, password, requestID, key, AAIGETVserverResponse.class); - } - - /** - * Perform a GET request for a particular VNF by VNF ID towards A&AI. - * - * @param urlGet the A&AI URL - * @param username the user name for authentication - * @param password the password for authentication - * @param requestID the UUID of the request - * @param key the ID of the VNF - * @return the response for the virtual server from A&AI - */ - public AAIGETVnfResponse getQueryByVnfID(String urlGet, String username, String password, UUID requestID, String key) { - return getQuery(urlGet, username, password, requestID, key, AAIGETVnfResponse.class); - } - - /** - * Perform a GET request for a particular VNF by VNF name towards A&AI. - * - * @param urlGet the A&AI URL - * @param username the user name for authentication - * @param password the password for authentication - * @param requestID the UUID of the request - * @param key the name of the VNF - * @return the response for the virtual server from A&AI - */ - public AAIGETVnfResponse getQueryByVnfName(String urlGet, String username, String password, UUID requestID, String key) { - return getQuery(urlGet, username, password, requestID, key, AAIGETVnfResponse.class); - } - - /** - * Perform a GET query for a particular entity towards A&AI. - * - * @param the generic type for the response - * @param urlGet the A&AI URL - * @param username the user name for authentication - * @param password the password for authentication - * @param requestID the UUID of the request - * @param key the name of the VNF - * @param classOfT the class of the response to return - * @return the response for the virtual server from A&AI - */ - private T getQuery(final String url, final String username, final String password, final UUID requestID, final String key, final Class classOfResponse) { - - Map headers = createHeaders(requestID); - - String urlGet = url + key; - - int attemptsLeft = 3; - - while(attemptsLeft-- > 0){ - netLogger.info("[OUT|{}|{}|]", "AAI", urlGet); - Pair httpDetailsGet = restManager.get(urlGet, username, password, headers); - if (httpDetailsGet == null) { - logger.info("AAI GET Null Response to {}", urlGet); - return null; - } - - int httpResponseCode = httpDetailsGet.a; - - logger.info(urlGet); - logger.info("{}", httpResponseCode); - logger.info(httpDetailsGet.b); - - if (httpResponseCode == 200) { - T responseGet = composeResponse(httpDetailsGet, urlGet, classOfResponse); - if (responseGet != null) { - return responseGet; - } - } - try { - Thread.sleep(1000); - } catch (InterruptedException e) { Thread.currentThread().interrupt(); } - - } - - return null; - } - - /** - * Create the headers for the HTTP request. - * - * @param requestID the request ID to insert in the headers - * @return the HTTP headers - */ - private Map createHeaders(final UUID requestID) { - Map headers = new HashMap<>(); - - headers.put("X-FromAppId", "POLICY"); - headers.put("X-TransactionId", requestID.toString()); - headers.put("Accept", "application/json"); - - return headers; - } - - /** - * This method uses Google's GSON to create a response object from a JSON string. - * - * @param the generic type - * @param httpDetails the HTTP response - * @param url the URL from which the response came - * @param classOfResponse The response class - * @return an instance of the response class - * @throws JsonSyntaxException on GSON errors instantiating the response - */ - private T composeResponse(final Pair httpDetails, final String url, final Class classOfResponse) { - try { - T response = Serialization.gsonPretty.fromJson(httpDetails.b, classOfResponse); - netLogger.info("[IN|{}|{}|]{}{}", "AAI", url, LINE_SEPARATOR, httpDetails.b); - return response; - } catch (JsonSyntaxException e) { - logger.error("postQuery threw: ", e); - return null; - } - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQCloudRegion.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQCloudRegion.java deleted file mode 100644 index e7a8f19c3..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQCloudRegion.java +++ /dev/null @@ -1,85 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQCloudRegion implements Serializable { - - private static final long serialVersionUID = -897231529157222683L; - - @SerializedName("cloud-owner") - private String cloudOwner; - - @SerializedName("cloud-region-id") - private String cloudRegionId; - - @SerializedName("cloud-region-version") - private String cloudRegionVersion; - - @SerializedName("complex-name") - private String complexName; - - @SerializedName("resource-version") - private String resourceVersion; - - public String getCloudOwner() { - return cloudOwner; - } - - public String getCloudRegionId() { - return cloudRegionId; - } - - public String getCloudRegionVersion() { - return cloudRegionVersion; - } - - public String getComplexName() { - return complexName; - } - - public String getResourceVersion() { - return resourceVersion; - } - - public void setCloudOwner(String cloudOwner) { - this.cloudOwner = cloudOwner; - } - - public void setCloudRegionId(String cloudRegionId) { - this.cloudRegionId = cloudRegionId; - } - - public void setCloudRegionVersion(String cloudRegionVersion) { - this.cloudRegionVersion = cloudRegionVersion; - } - - public void setComplexName(String complexName) { - this.complexName = complexName; - } - - public void setResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperties.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperties.java deleted file mode 100644 index 2322ef2f9..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperties.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 java.io.Serializable; -import java.util.LinkedList; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - -public class AAINQExtraProperties implements Serializable { - private static final long serialVersionUID = 4109625574744702319L; - - @SerializedName("extra-property") - private List extraProperty = new LinkedList<>(); - - public List getExtraProperty() { - return extraProperty; - } - - public void setExtraProperty(List extraProperty) { - this.extraProperty = extraProperty; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperty.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperty.java deleted file mode 100644 index 5761a543b..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQExtraProperty.java +++ /dev/null @@ -1,60 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQExtraProperty implements Serializable { - - private static final long serialVersionUID = -3861240617222397736L; - - @SerializedName("property-name") - private String propertyName; - - @SerializedName("property-value") - private String propertyValue; - - public AAINQExtraProperty() { - } - - public AAINQExtraProperty(String propertyName, String propertyValue) { - this.propertyName = propertyName; - this.propertyValue = propertyValue; - } - - public String getPropertyName() { - return propertyName; - } - - public String getPropertyValue() { - return propertyValue; - } - - public void setPropertyName(String propertyName) { - this.propertyName = propertyName; - } - - public void setPropertyValue(String propertyValue) { - this.propertyValue = propertyValue; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQGenericVNF.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQGenericVNF.java deleted file mode 100644 index 62903a083..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQGenericVNF.java +++ /dev/null @@ -1,217 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQGenericVNF implements Serializable { - - private static final long serialVersionUID = 834322706248060559L; - - @SerializedName("vnf-id") - private String vnfID; - - @SerializedName("vnf-name") - private String vnfName; - - @SerializedName("vnf-name2") - private String vnfName2; - - @SerializedName("vnf-type") - private String vnfType; - - @SerializedName("service-id") - private String serviceId; - - @SerializedName("prov-status") - private String provStatus; - - @SerializedName("operational-state") - private String operationalState; - - @SerializedName("ipv4-oam-address") - private String ipv4OamAddress; - - @SerializedName("ipv4-loopback0-address") - private String ipv4Loopback0Address; - - @SerializedName("in-maint") - private Boolean inMaint; - - @SerializedName("is-closed-loop-disabled") - private Boolean isClosedLoopDisabled; - - @SerializedName("resource-version") - private String resourceVersion; - - @SerializedName("encrypted-access-flag") - private Boolean encrypedAccessFlag; - - @SerializedName("persona-model-id") - private String personaModelId; - - @SerializedName("persona-model-version") - private String personaModelVersion; - - @SerializedName("model-invariant-id") - private String modelInvariantId; - - @SerializedName("model-version-id") - private String modelVersionId; - - public String getVnfID() { - return vnfID; - } - - public String getVnfName() { - return vnfName; - } - - public String getVnfName2() { - return vnfName2; - } - - public String getVnfType() { - return vnfType; - } - - public String getServiceId() { - return serviceId; - } - - public String getProvStatus() { - return provStatus; - } - - public String getOperationalState() { - return operationalState; - } - - public String getIpv4OamAddress() { - return ipv4OamAddress; - } - - public String getIpv4Loopback0Address() { - return ipv4Loopback0Address; - } - - public Boolean getInMaint() { - return inMaint; - } - - public Boolean getIsClosedLoopDisabled() { - return isClosedLoopDisabled; - } - - public String getResourceVersion() { - return resourceVersion; - } - - public Boolean getEncrypedAccessFlag() { - return encrypedAccessFlag; - } - - public String getPersonaModelId() { - return personaModelId; - } - - public String getPersonaModelVersion() { - return personaModelVersion; - } - - public String getModelInvariantId() { - return modelInvariantId; - } - - public String getModelVersionId() { - return modelVersionId; - } - - public void setVnfID(String vnfID) { - this.vnfID = vnfID; - } - - public void setVnfName(String vnfName) { - this.vnfName = vnfName; - } - - public void setVnfName2(String vnfName2) { - this.vnfName2 = vnfName2; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - public void setProvStatus(String provStatus) { - this.provStatus = provStatus; - } - - public void setOperationalState(String operationalState) { - this.operationalState = operationalState; - } - - public void setIpv4OamAddress(String ipv4OamAddress) { - this.ipv4OamAddress = ipv4OamAddress; - } - - public void setIpv4Loopback0Address(String ipv4Loopback0Address) { - this.ipv4Loopback0Address = ipv4Loopback0Address; - } - - public void setInMaint(Boolean inMaint) { - this.inMaint = inMaint; - } - - public void setIsClosedLoopDisabled(Boolean isClosedLoopDisabled) { - this.isClosedLoopDisabled = isClosedLoopDisabled; - } - - public void setResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - } - - public void setEncrypedAccessFlag(Boolean encrypedAccessFlag) { - this.encrypedAccessFlag = encrypedAccessFlag; - } - - public void setPersonaModelId(String personaModelId) { - this.personaModelId = personaModelId; - } - - public void setPersonaModelVersion(String personaModelVersion) { - this.personaModelVersion = personaModelVersion; - } - - public void setModelInvariantId(String modelInvariantId) { - this.modelInvariantId = modelInvariantId; - } - - public void setModelVersionId(String modelVersionId) { - this.modelVersionId = modelVersionId; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInstanceFilters.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInstanceFilters.java deleted file mode 100644 index 24b833f25..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInstanceFilters.java +++ /dev/null @@ -1,47 +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 java.io.Serializable; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - -public class AAINQInstanceFilters implements Serializable { - - /** - * - */ - private static final long serialVersionUID = 8993824591338121185L; - - @SerializedName("instance-filter") - private List>> instanceFilter = new LinkedList<>(); - - public List>> getInstanceFilter() { - return instanceFilter; - } - - public void setInstanceFilter(List>> instanceFilter) { - this.instanceFilter = instanceFilter; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItem.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItem.java deleted file mode 100644 index e9a387eff..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItem.java +++ /dev/null @@ -1,129 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQInventoryResponseItem implements Serializable { - - private static final long serialVersionUID = 7142072567154675183L; - - @SerializedName("model-name") - private String modelName; - - @SerializedName("vf-module") - private AAINQVfModule vfModule; - - @SerializedName("service-instance") - private AAINQServiceInstance serviceInstance; - - @SerializedName("vserver") - private AAINQVServer vserver; - - @SerializedName("tenant") - private AAINQTenant tenant; - - @SerializedName("cloud-region") - private AAINQCloudRegion cloudRegion; - - @SerializedName("generic-vnf") - private AAINQGenericVNF genericVNF; - - @SerializedName("extra-properties") - private AAINQExtraProperties extraProperties; - - @SerializedName("inventory-response-items") - private AAINQInventoryResponseItems items; - - public String getModelName() { - return modelName; - } - - public AAINQVfModule getVfModule() { - return vfModule; - } - - public AAINQServiceInstance getServiceInstance() { - return serviceInstance; - } - - public AAINQVServer getVserver() { - return vserver; - } - - public AAINQTenant getTenant() { - return tenant; - } - - public AAINQCloudRegion getCloudRegion() { - return cloudRegion; - } - - public AAINQGenericVNF getGenericVNF() { - return genericVNF; - } - - public AAINQExtraProperties getExtraProperties() { - return extraProperties; - } - - public AAINQInventoryResponseItems getItems() { - return items; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public void setVfModule(AAINQVfModule vfModule) { - this.vfModule = vfModule; - } - - public void setServiceInstance(AAINQServiceInstance serviceInstance) { - this.serviceInstance = serviceInstance; - } - - public void setVserver(AAINQVServer vserver) { - this.vserver = vserver; - } - - public void setTenant(AAINQTenant tenant) { - this.tenant = tenant; - } - - public void setCloudRegion(AAINQCloudRegion cloudRegion) { - this.cloudRegion = cloudRegion; - } - - public void setGenericVNF(AAINQGenericVNF genericVNF) { - this.genericVNF = genericVNF; - } - - public void setExtraProperties(AAINQExtraProperties extraProperties) { - this.extraProperties = extraProperties; - } - - public void setItems(AAINQInventoryResponseItems items) { - this.items = items; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItems.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItems.java deleted file mode 100644 index e05bcccb4..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQInventoryResponseItems.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 java.io.Serializable; -import java.util.LinkedList; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - -public class AAINQInventoryResponseItems implements Serializable { - private static final long serialVersionUID = 7602807659381179004L; - - @SerializedName("inventory-response-item") - private List inventoryResponseItems = new LinkedList<>(); - - public List getInventoryResponseItems() { - return inventoryResponseItems; - } - - public void setInventoryResponseItems(List inventoryResponseItems) { - this.inventoryResponseItems = inventoryResponseItems; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQNamedQuery.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQNamedQuery.java deleted file mode 100644 index 4dddbbe4a..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQNamedQuery.java +++ /dev/null @@ -1,41 +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 java.io.Serializable; -import java.util.UUID; - -import com.google.gson.annotations.SerializedName; - -public class AAINQNamedQuery implements Serializable { - private static final long serialVersionUID = -3277980060302645333L; - - @SerializedName("named-query-uuid") - private UUID namedQueryUUID; - - public UUID getNamedQueryUUID() { - return namedQueryUUID; - } - - public void setNamedQueryUUID(UUID namedQueryUUID) { - this.namedQueryUUID = namedQueryUUID; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQQueryParameters.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQQueryParameters.java deleted file mode 100644 index 3843676aa..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQQueryParameters.java +++ /dev/null @@ -1,40 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQQueryParameters implements Serializable { - private static final long serialVersionUID = -4291227193197126982L; - - @SerializedName("named-query") - private AAINQNamedQuery namedQuery; - - public AAINQNamedQuery getNamedQuery() { - return namedQuery; - } - - public void setNamedQuery(AAINQNamedQuery namedQuery) { - this.namedQuery = namedQuery; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequest.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequest.java deleted file mode 100644 index db7317168..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequest.java +++ /dev/null @@ -1,51 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQRequest implements Serializable { - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("query-parameters") - private AAINQQueryParameters queryParameters; - - @SerializedName("instance-filters") - private AAINQInstanceFilters instanceFilters; - - public AAINQQueryParameters getQueryParameters() { - return queryParameters; - } - - public AAINQInstanceFilters getInstanceFilters() { - return instanceFilters; - } - - public void setQueryParameters(AAINQQueryParameters queryParameters) { - this.queryParameters = queryParameters; - } - - public void setInstanceFilters(AAINQInstanceFilters instanceFilters) { - this.instanceFilters = instanceFilters; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequestError.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequestError.java deleted file mode 100644 index 2ebf1c2e3..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQRequestError.java +++ /dev/null @@ -1,40 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQRequestError implements Serializable { - private static final long serialVersionUID = -7742674155387022932L; - - @SerializedName("serviceException") - private AAINQServiceExcept serviceExcept; - - public AAINQServiceExcept getServiceExcept() { - return serviceExcept; - } - - public void setServiceExcept(AAINQServiceExcept serviceExcept) { - this.serviceExcept = serviceExcept; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponse.java deleted file mode 100644 index a6e8715c4..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponse.java +++ /dev/null @@ -1,54 +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 java.io.Serializable; -import java.util.LinkedList; -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import org.onap.policy.aai.AAINQInventoryResponseItem; - -public class AAINQResponse implements Serializable { - private static final long serialVersionUID = 8411407444051746101L; - - @SerializedName("inventory-response-item") - private List inventoryResponseItems = new LinkedList<>(); - - @SerializedName("requestError") - private AAINQRequestError requestError; - - public List getInventoryResponseItems() { - return inventoryResponseItems; - } - - public AAINQRequestError getRequestError() { - return requestError; - } - - public void setRequestError(AAINQRequestError requestError) { - this.requestError = requestError; - } - - public void setInventoryResponseItems(List inventoryResponseItems) { - this.inventoryResponseItems = inventoryResponseItems; - } -} \ No newline at end of file diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponseWrapper.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponseWrapper.java deleted file mode 100644 index e8d1620de..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQResponseWrapper.java +++ /dev/null @@ -1,55 +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 java.util.UUID; - -import org.onap.policy.aai.AAINQResponse; - -public class AAINQResponseWrapper { - - private UUID requestID; - private AAINQResponse aainqresponse; - - public AAINQResponseWrapper() { - } - - public AAINQResponseWrapper(UUID requestID, AAINQResponse aainqresponse){ - this.requestID = requestID; - this.aainqresponse = aainqresponse; - } - - public UUID getRequestID() { - return requestID; - } - - public void setRequestID(UUID requestID) { - this.requestID = requestID; - } - - public AAINQResponse getAainqresponse() { - return aainqresponse; - } - - public void setAainqresponse(AAINQResponse aainqresponse) { - this.aainqresponse = aainqresponse; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceExcept.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceExcept.java deleted file mode 100644 index 12fb1a0c4..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceExcept.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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQServiceExcept implements Serializable { - private static final long serialVersionUID = 2858343404484338546L; - - @SerializedName("messageId") - private String messageId; - - @SerializedName("text") - private String text; - - @SerializedName("variables") - private String[] variables; - - public String getMessageId() { - return messageId; - } - - public String getText() { - return text; - } - - public String[] getVariables() { - return variables; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceInstance.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceInstance.java deleted file mode 100644 index 3ae366ea5..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQServiceInstance.java +++ /dev/null @@ -1,117 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQServiceInstance implements Serializable { - private static final long serialVersionUID = -8000944396593889586L; - - @SerializedName("service-instance-id") - private String serviceInstanceID; - - @SerializedName("service-instance-name") - private String serviceInstanceName; - - @SerializedName("persona-model-id") - private String personaModelId; - - @SerializedName("persona-model-version") - private String personaModelVersion; - - @SerializedName("service-instance-location-id") - private String serviceInstanceLocationId; - - @SerializedName("resource-version") - private String resourceVersion; - - @SerializedName("model-invariant-id") - private String modelInvariantId; - - @SerializedName("model-version-id") - private String modelVersionId; - - public String getServiceInstanceID() { - return serviceInstanceID; - } - - public String getServiceInstanceName() { - return serviceInstanceName; - } - - public String getPersonaModelId() { - return personaModelId; - } - - public String getPersonaModelVersion() { - return personaModelVersion; - } - - public String getServiceInstanceLocationId() { - return serviceInstanceLocationId; - } - - public String getResourceVersion() { - return resourceVersion; - } - - public String getModelInvariantId() { - return modelInvariantId; - } - - public String getModelVersionId() { - return modelVersionId; - } - - public void setServiceInstanceID(String serviceInstanceID) { - this.serviceInstanceID = serviceInstanceID; - } - - public void setServiceInstanceName(String serviceInstanceName) { - this.serviceInstanceName = serviceInstanceName; - } - - public void setPersonaModelId(String personaModelId) { - this.personaModelId = personaModelId; - } - - public void setPersonaModelVersion(String personaModelVersion) { - this.personaModelVersion = personaModelVersion; - } - - public void setServiceInstanceLocationId(String serviceInstanceLocationId) { - this.serviceInstanceLocationId = serviceInstanceLocationId; - } - - public void setResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - } - - public void setModelInvariantId(String modelInvariantId) { - this.modelInvariantId = modelInvariantId; - } - - public void setModelVersionId(String modelVersionId) { - this.modelVersionId = modelVersionId; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQTenant.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQTenant.java deleted file mode 100644 index a370b7ddb..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQTenant.java +++ /dev/null @@ -1,64 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQTenant implements Serializable { - private static final long serialVersionUID = 4702784101671984364L; - - @SerializedName("tenant-id") - private String tenantId; - - @SerializedName("tenant-name") - private String tenantName; - - @SerializedName("resource-version") - private String resourceVersion; - - public String getTenantId() { - return tenantId; - } - - public String getTenantName() { - return tenantName; - } - - public String getResourceVersion() { - return resourceVersion; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } - - public void setResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - } - - -} 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 deleted file mode 100644 index 180ac3680..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVServer.java +++ /dev/null @@ -1,119 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQVServer implements Serializable { - private static final long serialVersionUID = -6718526692734215643L; - - @SerializedName("vserver-id") - private String vserverId; - - @SerializedName("vserver-name") - private String vserverName; - - @SerializedName("vserver-name2") - private String vserverName2; - - @SerializedName("prov-status") - private String provStatus; - - @SerializedName("vserver-selflink") - private String vserverSelflink; - - @SerializedName("in-maint") - private Boolean inMaint; - - @SerializedName("is-closed-loop-disabled") - private Boolean isClosedLoopDisabled; - - @SerializedName("resource-version") - private String resourceVersion; - - public String getVserverId() { - return vserverId; - } - - public String getVserverName() { - return vserverName; - } - - public String getVserverName2() { - return vserverName2; - } - - public String getProvStatus() { - return provStatus; - } - - public String getVserverSelflink() { - return vserverSelflink; - } - - public Boolean getInMaint() { - return inMaint; - } - - public Boolean getIsClosedLoopDisabled() { - return isClosedLoopDisabled; - } - - public String getResourceVersion() { - return resourceVersion; - } - - 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 void setProvStatus(String provStatus) { - this.provStatus = provStatus; - } - - public void setVserverSelflink(String vserverSelflink) { - this.vserverSelflink = vserverSelflink; - } - - public void setInMaint(Boolean inMaint) { - this.inMaint = inMaint; - } - - public void setIsClosedLoopDisabled(Boolean isClosedLoopDisabled) { - this.isClosedLoopDisabled = isClosedLoopDisabled; - } - - public void setResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - } - - -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVfModule.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVfModule.java deleted file mode 100644 index 97c794f07..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQVfModule.java +++ /dev/null @@ -1,172 +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 java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class AAINQVfModule implements Serializable { - private static final long serialVersionUID = 8019133081429638231L; - - @SerializedName("vf-module-id") - private String vfModuleId; - - @SerializedName("vf-module-name") - private String vfModuleName; - - @SerializedName("heat-stack-id") - private String heatStackId; - - @SerializedName("orchestration-status") - private String orchestrationStatus; - - @SerializedName("is-base-vf-module") - private Boolean isBaseVfModule; - - @SerializedName("resource-version") - private String resourceVersion; - - @SerializedName("persona-model-id") - private String personaModelId; - - @SerializedName("persona-model-version") - private String personaModelVersion; - - @SerializedName("widget-model-id") - private String widgetModelId; - - @SerializedName("widget-model-version") - private String widgetModelVersion; - - @SerializedName("contrail-service-instance-fqdn") - private String contrailServiceInstanceFqdn; - - @SerializedName("model-invariant-id") - private String modelInvariantId; - - @SerializedName("model-version-id") - private String modelVersionId; - - public String getVfModuleId() { - return vfModuleId; - } - - public String getVfModuleName() { - return vfModuleName; - } - - public String getHeatStackId() { - return heatStackId; - } - - public String getOrchestrationStatus() { - return orchestrationStatus; - } - - public Boolean getIsBaseVfModule() { - return isBaseVfModule; - } - - public String getResourceVersion() { - return resourceVersion; - } - - public String getPersonaModelId() { - return personaModelId; - } - - public String getPersonaModelVersion() { - return personaModelVersion; - } - - public String getWidgetModelId() { - return widgetModelId; - } - - public String getWidgetModelVersion() { - return widgetModelVersion; - } - - public String getContrailServiceInstanceFqdn() { - return contrailServiceInstanceFqdn; - } - - public String getModelInvariantId() { - return modelInvariantId; - } - - public String getModelVersionId() { - return modelVersionId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public void setVfModuleName(String vfModuleName) { - this.vfModuleName = vfModuleName; - } - - public void setHeatStackId(String heatStackId) { - this.heatStackId = heatStackId; - } - - public void setOrchestrationStatus(String orchestrationStatus) { - this.orchestrationStatus = orchestrationStatus; - } - - public void setIsBaseVfModule(Boolean isBaseVfModule) { - this.isBaseVfModule = isBaseVfModule; - } - - public void setResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - } - - public void setPersonaModelId(String personaModelId) { - this.personaModelId = personaModelId; - } - - public void setPersonaModelVersion(String personaModelVersion) { - this.personaModelVersion = personaModelVersion; - } - - public void setWidgetModelId(String widgetModelId) { - this.widgetModelId = widgetModelId; - } - - public void setWidgetModelVersion(String widgetModelVersion) { - this.widgetModelVersion = widgetModelVersion; - } - - public void setContrailServiceInstanceFqdn(String contrailServiceInstanceFqdn) { - this.contrailServiceInstanceFqdn = contrailServiceInstanceFqdn; - } - - public void setModelInvariantId(String modelInvariantId) { - this.modelInvariantId = modelInvariantId; - } - - public void setModelVersionId(String modelVersionId) { - this.modelVersionId = modelVersionId; - } -} 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 new file mode 100644 index 000000000..e47d31912 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java @@ -0,0 +1,100 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 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; + + @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 new file mode 100644 index 000000000..ccc0fa4c3 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiGetVnfResponse extends AaiGetResponse implements Serializable { + + private static final long serialVersionUID = -6247505944905898870L; + + @SerializedName("vnf-id") + private String vnfId; + + @SerializedName("vnf-name") + private String vnfName; + + @SerializedName("vnf-type") + private String vnfType; + + @SerializedName("service-id") + private String serviceId; + + @SerializedName("orchestration-status") + private String orchestrationStatus; + + public String getVnfId() { + return vnfId; + } + + public String getVnfName() { + return vnfName; + } + + public String getVnfType() { + return vnfType; + } + + public String getServiceId() { + return serviceId; + } + + public String getOrchestrationStatus() { + return orchestrationStatus; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public void setVnfName(String vnfName) { + this.vnfName = vnfName; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + + public void setOrchestrationStatus(String orchestrationStatus) { + this.orchestrationStatus = orchestrationStatus; + } +} 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 new file mode 100644 index 000000000..ca258a93c --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiGetVserverResponse extends AaiGetResponse implements Serializable { + + private static final long serialVersionUID = -6247505944905898870L; + + @SerializedName("vserver-id") + private String vserverId; + + @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 void setVserverSelflink(String vserverSelflink) { + this.vserverSelflink = vserverSelflink; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java new file mode 100644 index 000000000..4aa231cb8 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java @@ -0,0 +1,237 @@ +/*- + * ============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.JsonSyntaxException; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.onap.policy.aai.util.Serialization; +import org.onap.policy.rest.RESTManager; +import org.onap.policy.rest.RESTManager.Pair; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This class handles communication towards and responses from A&AI for this module. + */ +public final class AaiManager { + + /** The Constant LINE_SEPARATOR. */ + private static final String LINE_SEPARATOR = System.lineSeparator(); + + /** The Constant logger. */ + private static final Logger logger = LoggerFactory.getLogger(AaiManager.class); + + /** The Constant netLogger. */ + private static final Logger netLogger = + LoggerFactory.getLogger(org.onap.policy.drools.event.comm.Topic.NETWORK_LOGGER); + + /** The rest manager. */ + // The REST manager used for processing REST calls for this AAI manager + private final RESTManager restManager; + + /** + * Constructor, create the AAI manager with the specified REST manager. + * + * @param restManager the rest manager to use for REST calls + */ + public AaiManager(final RESTManager restManager) { + this.restManager = restManager; + } + + /** + * Post a query to A&AI. + * + * @param url the A&AI URL + * @param username the user name for authentication + * @param password the password for authentication + * @param request the request to issue towards A&AI + * @param requestId the UUID of the request + * @return the response from A&AI + */ + public AaiNqResponse postQuery(String url, String username, String password, AaiNqRequest request, UUID requestId) { + + final Map headers = createHeaders(requestId); + + url = url + "/aai/search/named-query"; + + logger.debug("RESTManager.post before"); + String requestJson = Serialization.gsonPretty.toJson(request); + netLogger.info("[OUT|{}|{}|]{}{}", "AAI", url, LINE_SEPARATOR, requestJson); + Pair httpDetails = + restManager.post(url, username, password, headers, "application/json", requestJson); + logger.debug("RESTManager.post after"); + + if (httpDetails == null) { + logger.info("AAI POST Null Response to {}", url); + return null; + } + + int httpResponseCode = httpDetails.a; + + logger.info(url); + logger.info("{}", httpResponseCode); + logger.info(httpDetails.b); + + if (httpDetails.b != null) { + return composeResponse(httpDetails, url, AaiNqResponse.class); + } + return null; + } + + /** + * Perform a GET request for a particular virtual server towards A&AI. + * + * @param urlGet the A&AI URL + * @param username the user name for authentication + * @param password the password for authentication + * @param requestId the UUID of the request + * @param key the key of the virtual server + * @return the response for the virtual server from A&AI + */ + public AaiGetVserverResponse getQueryByVserverName(String urlGet, String username, String password, UUID requestId, + String key) { + return getQuery(urlGet, username, password, requestId, key, AaiGetVserverResponse.class); + } + + /** + * Perform a GET request for a particular VNF by VNF ID towards A&AI. + * + * @param urlGet the A&AI URL + * @param username the user name for authentication + * @param password the password for authentication + * @param requestId the UUID of the request + * @param key the ID of the VNF + * @return the response for the virtual server from A&AI + */ + public AaiGetVnfResponse getQueryByVnfId(String urlGet, String username, String password, UUID requestId, + String key) { + return getQuery(urlGet, username, password, requestId, key, AaiGetVnfResponse.class); + } + + /** + * Perform a GET request for a particular VNF by VNF name towards A&AI. + * + * @param urlGet the A&AI URL + * @param username the user name for authentication + * @param password the password for authentication + * @param requestId the UUID of the request + * @param key the name of the VNF + * @return the response for the virtual server from A&AI + */ + public AaiGetVnfResponse getQueryByVnfName(String urlGet, String username, String password, UUID requestId, + String key) { + return getQuery(urlGet, username, password, requestId, key, AaiGetVnfResponse.class); + } + + /** + * Perform a GET query for a particular entity towards A&AI. + * + * @param the generic type for the response + * @param urlGet the A&AI URL + * @param username the user name for authentication + * @param password the password for authentication + * @param requestId the UUID of the request + * @param key the name of the VNF + * @param classOfT the class of the response to return + * @return the response for the virtual server from A&AI + */ + private T getQuery(final String url, final String username, final String password, final UUID requestId, + final String key, final Class classOfResponse) { + + Map headers = createHeaders(requestId); + + String urlGet = url + key; + + int attemptsLeft = 3; + + while (attemptsLeft-- > 0) { + netLogger.info("[OUT|{}|{}|]", "AAI", urlGet); + Pair httpDetailsGet = restManager.get(urlGet, username, password, headers); + if (httpDetailsGet == null) { + logger.info("AAI GET Null Response to {}", urlGet); + return null; + } + + int httpResponseCode = httpDetailsGet.a; + + logger.info(urlGet); + logger.info("{}", httpResponseCode); + logger.info(httpDetailsGet.b); + + if (httpResponseCode == 200) { + T responseGet = composeResponse(httpDetailsGet, urlGet, classOfResponse); + if (responseGet != null) { + return responseGet; + } + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + + } + + return null; + } + + /** + * Create the headers for the HTTP request. + * + * @param requestId the request ID to insert in the headers + * @return the HTTP headers + */ + private Map createHeaders(final UUID requestId) { + Map headers = new HashMap<>(); + + headers.put("X-FromAppId", "POLICY"); + headers.put("X-TransactionId", requestId.toString()); + headers.put("Accept", "application/json"); + + return headers; + } + + /** + * This method uses Google's GSON to create a response object from a JSON string. + * + * @param the generic type + * @param httpDetails the HTTP response + * @param url the URL from which the response came + * @param classOfResponse The response class + * @return an instance of the response class + * @throws JsonSyntaxException on GSON errors instantiating the response + */ + private T composeResponse(final Pair httpDetails, final String url, + final Class classOfResponse) { + try { + T response = Serialization.gsonPretty.fromJson(httpDetails.b, classOfResponse); + netLogger.info("[IN|{}|{}|]{}{}", "AAI", url, LINE_SEPARATOR, httpDetails.b); + return response; + } catch (JsonSyntaxException e) { + logger.error("postQuery threw: ", e); + return null; + } + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqCloudRegion.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqCloudRegion.java new file mode 100644 index 000000000..b0715bc7a --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqCloudRegion.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqCloudRegion implements Serializable { + + private static final long serialVersionUID = -897231529157222683L; + + @SerializedName("cloud-owner") + private String cloudOwner; + + @SerializedName("cloud-region-id") + private String cloudRegionId; + + @SerializedName("cloud-region-version") + private String cloudRegionVersion; + + @SerializedName("complex-name") + private String complexName; + + @SerializedName("resource-version") + private String resourceVersion; + + public String getCloudOwner() { + return cloudOwner; + } + + public String getCloudRegionId() { + return cloudRegionId; + } + + public String getCloudRegionVersion() { + return cloudRegionVersion; + } + + public String getComplexName() { + return complexName; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public void setCloudOwner(String cloudOwner) { + this.cloudOwner = cloudOwner; + } + + public void setCloudRegionId(String cloudRegionId) { + this.cloudRegionId = cloudRegionId; + } + + public void setCloudRegionVersion(String cloudRegionVersion) { + this.cloudRegionVersion = cloudRegionVersion; + } + + public void setComplexName(String complexName) { + this.complexName = complexName; + } + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqExtraProperties.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqExtraProperties.java new file mode 100644 index 000000000..abe779f32 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqExtraProperties.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqExtraProperties implements Serializable { + private static final long serialVersionUID = 4109625574744702319L; + + @SerializedName("extra-property") + private List extraProperty = new LinkedList<>(); + + public List getExtraProperty() { + return extraProperty; + } + + public void setExtraProperty(List extraProperty) { + this.extraProperty = extraProperty; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqExtraProperty.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqExtraProperty.java new file mode 100644 index 000000000..d63fe1f08 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqExtraProperty.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqExtraProperty implements Serializable { + + private static final long serialVersionUID = -3861240617222397736L; + + @SerializedName("property-name") + private String propertyName; + + @SerializedName("property-value") + private String propertyValue; + + public AaiNqExtraProperty() {} + + public AaiNqExtraProperty(String propertyName, String propertyValue) { + this.propertyName = propertyName; + this.propertyValue = propertyValue; + } + + public String getPropertyName() { + return propertyName; + } + + public String getPropertyValue() { + return propertyValue; + } + + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + } + + public void setPropertyValue(String propertyValue) { + this.propertyValue = propertyValue; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqGenericVnf.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqGenericVnf.java new file mode 100644 index 000000000..342fefbec --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqGenericVnf.java @@ -0,0 +1,217 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqGenericVnf implements Serializable { + + private static final long serialVersionUID = 834322706248060559L; + + @SerializedName("vnf-id") + private String vnfId; + + @SerializedName("vnf-name") + private String vnfName; + + @SerializedName("vnf-name2") + private String vnfName2; + + @SerializedName("vnf-type") + private String vnfType; + + @SerializedName("service-id") + private String serviceId; + + @SerializedName("prov-status") + private String provStatus; + + @SerializedName("operational-state") + private String operationalState; + + @SerializedName("ipv4-oam-address") + private String ipv4OamAddress; + + @SerializedName("ipv4-loopback0-address") + private String ipv4Loopback0Address; + + @SerializedName("in-maint") + private Boolean inMaint; + + @SerializedName("is-closed-loop-disabled") + private Boolean isClosedLoopDisabled; + + @SerializedName("resource-version") + private String resourceVersion; + + @SerializedName("encrypted-access-flag") + private Boolean encrypedAccessFlag; + + @SerializedName("persona-model-id") + private String personaModelId; + + @SerializedName("persona-model-version") + private String personaModelVersion; + + @SerializedName("model-invariant-id") + private String modelInvariantId; + + @SerializedName("model-version-id") + private String modelVersionId; + + public String getVnfId() { + return vnfId; + } + + public String getVnfName() { + return vnfName; + } + + public String getVnfName2() { + return vnfName2; + } + + public String getVnfType() { + return vnfType; + } + + public String getServiceId() { + return serviceId; + } + + public String getProvStatus() { + return provStatus; + } + + public String getOperationalState() { + return operationalState; + } + + public String getIpv4OamAddress() { + return ipv4OamAddress; + } + + public String getIpv4Loopback0Address() { + return ipv4Loopback0Address; + } + + public Boolean getInMaint() { + return inMaint; + } + + public Boolean getIsClosedLoopDisabled() { + return isClosedLoopDisabled; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public Boolean getEncrypedAccessFlag() { + return encrypedAccessFlag; + } + + public String getPersonaModelId() { + return personaModelId; + } + + public String getPersonaModelVersion() { + return personaModelVersion; + } + + public String getModelInvariantId() { + return modelInvariantId; + } + + public String getModelVersionId() { + return modelVersionId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public void setVnfName(String vnfName) { + this.vnfName = vnfName; + } + + public void setVnfName2(String vnfName2) { + this.vnfName2 = vnfName2; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + + public void setProvStatus(String provStatus) { + this.provStatus = provStatus; + } + + public void setOperationalState(String operationalState) { + this.operationalState = operationalState; + } + + public void setIpv4OamAddress(String ipv4OamAddress) { + this.ipv4OamAddress = ipv4OamAddress; + } + + public void setIpv4Loopback0Address(String ipv4Loopback0Address) { + this.ipv4Loopback0Address = ipv4Loopback0Address; + } + + public void setInMaint(Boolean inMaint) { + this.inMaint = inMaint; + } + + public void setIsClosedLoopDisabled(Boolean isClosedLoopDisabled) { + this.isClosedLoopDisabled = isClosedLoopDisabled; + } + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + public void setEncrypedAccessFlag(Boolean encrypedAccessFlag) { + this.encrypedAccessFlag = encrypedAccessFlag; + } + + public void setPersonaModelId(String personaModelId) { + this.personaModelId = personaModelId; + } + + public void setPersonaModelVersion(String personaModelVersion) { + this.personaModelVersion = personaModelVersion; + } + + public void setModelInvariantId(String modelInvariantId) { + this.modelInvariantId = modelInvariantId; + } + + public void setModelVersionId(String modelVersionId) { + this.modelVersionId = modelVersionId; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInstanceFilters.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInstanceFilters.java new file mode 100644 index 000000000..21cd87f82 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInstanceFilters.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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; +import java.util.Map; + +public class AaiNqInstanceFilters implements Serializable { + + private static final long serialVersionUID = 8993824591338121185L; + + @SerializedName("instance-filter") + private List>> instanceFilter = new LinkedList<>(); + + public List>> getInstanceFilter() { + return instanceFilter; + } + + public void setInstanceFilter(List>> instanceFilter) { + this.instanceFilter = instanceFilter; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInventoryResponseItem.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInventoryResponseItem.java new file mode 100644 index 000000000..53ec65fff --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInventoryResponseItem.java @@ -0,0 +1,129 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqInventoryResponseItem implements Serializable { + + private static final long serialVersionUID = 7142072567154675183L; + + @SerializedName("model-name") + private String modelName; + + @SerializedName("vf-module") + private AaiNqVfModule vfModule; + + @SerializedName("service-instance") + private AaiNqServiceInstance serviceInstance; + + @SerializedName("vserver") + private AaiNqVServer vserver; + + @SerializedName("tenant") + private AaiNqTenant tenant; + + @SerializedName("cloud-region") + private AaiNqCloudRegion cloudRegion; + + @SerializedName("generic-vnf") + private AaiNqGenericVnf genericVnf; + + @SerializedName("extra-properties") + private AaiNqExtraProperties extraProperties; + + @SerializedName("inventory-response-items") + private AaiNqInventoryResponseItems items; + + public String getModelName() { + return modelName; + } + + public AaiNqVfModule getVfModule() { + return vfModule; + } + + public AaiNqServiceInstance getServiceInstance() { + return serviceInstance; + } + + public AaiNqVServer getVserver() { + return vserver; + } + + public AaiNqTenant getTenant() { + return tenant; + } + + public AaiNqCloudRegion getCloudRegion() { + return cloudRegion; + } + + public AaiNqGenericVnf getGenericVnf() { + return genericVnf; + } + + public AaiNqExtraProperties getExtraProperties() { + return extraProperties; + } + + public AaiNqInventoryResponseItems getItems() { + return items; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public void setVfModule(AaiNqVfModule vfModule) { + this.vfModule = vfModule; + } + + public void setServiceInstance(AaiNqServiceInstance serviceInstance) { + this.serviceInstance = serviceInstance; + } + + public void setVserver(AaiNqVServer vserver) { + this.vserver = vserver; + } + + public void setTenant(AaiNqTenant tenant) { + this.tenant = tenant; + } + + public void setCloudRegion(AaiNqCloudRegion cloudRegion) { + this.cloudRegion = cloudRegion; + } + + public void setGenericVnf(AaiNqGenericVnf genericVnf) { + this.genericVnf = genericVnf; + } + + public void setExtraProperties(AaiNqExtraProperties extraProperties) { + this.extraProperties = extraProperties; + } + + public void setItems(AaiNqInventoryResponseItems items) { + this.items = items; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInventoryResponseItems.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInventoryResponseItems.java new file mode 100644 index 000000000..3ebbc1644 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqInventoryResponseItems.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqInventoryResponseItems implements Serializable { + private static final long serialVersionUID = 7602807659381179004L; + + @SerializedName("inventory-response-item") + private List inventoryResponseItems = new LinkedList<>(); + + public List getInventoryResponseItems() { + return inventoryResponseItems; + } + + public void setInventoryResponseItems(List inventoryResponseItems) { + this.inventoryResponseItems = inventoryResponseItems; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqNamedQuery.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqNamedQuery.java new file mode 100644 index 000000000..1d18eb857 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqNamedQuery.java @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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.UUID; + +public class AaiNqNamedQuery implements Serializable { + private static final long serialVersionUID = -3277980060302645333L; + + @SerializedName("named-query-uuid") + private UUID namedQueryUuid; + + public UUID getNamedQueryUuid() { + return namedQueryUuid; + } + + public void setNamedQueryUuid(UUID namedQueryUuid) { + this.namedQueryUuid = namedQueryUuid; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqQueryParameters.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqQueryParameters.java new file mode 100644 index 000000000..438e5b269 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqQueryParameters.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqQueryParameters implements Serializable { + private static final long serialVersionUID = -4291227193197126982L; + + @SerializedName("named-query") + private AaiNqNamedQuery namedQuery; + + public AaiNqNamedQuery getNamedQuery() { + return namedQuery; + } + + public void setNamedQuery(AaiNqNamedQuery namedQuery) { + this.namedQuery = namedQuery; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqRequest.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqRequest.java new file mode 100644 index 000000000..9e60ed1a6 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqRequest.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqRequest implements Serializable { + private static final long serialVersionUID = -3283942659786236032L; + + @SerializedName("query-parameters") + private AaiNqQueryParameters queryParameters; + + @SerializedName("instance-filters") + private AaiNqInstanceFilters instanceFilters; + + public AaiNqQueryParameters getQueryParameters() { + return queryParameters; + } + + public AaiNqInstanceFilters getInstanceFilters() { + return instanceFilters; + } + + public void setQueryParameters(AaiNqQueryParameters queryParameters) { + this.queryParameters = queryParameters; + } + + public void setInstanceFilters(AaiNqInstanceFilters instanceFilters) { + this.instanceFilters = instanceFilters; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqRequestError.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqRequestError.java new file mode 100644 index 000000000..4a7ce504b --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqRequestError.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqRequestError implements Serializable { + private static final long serialVersionUID = -7742674155387022932L; + + @SerializedName("serviceException") + private AaiNqServiceExcept serviceExcept; + + public AaiNqServiceExcept getServiceExcept() { + return serviceExcept; + } + + public void setServiceExcept(AaiNqServiceExcept serviceExcept) { + this.serviceExcept = serviceExcept; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqResponse.java new file mode 100644 index 000000000..36eb0c299 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqResponse.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqResponse implements Serializable { + private static final long serialVersionUID = 8411407444051746101L; + + @SerializedName("inventory-response-item") + private List inventoryResponseItems = new LinkedList<>(); + + @SerializedName("requestError") + private AaiNqRequestError requestError; + + public List getInventoryResponseItems() { + return inventoryResponseItems; + } + + public AaiNqRequestError getRequestError() { + return requestError; + } + + public void setRequestError(AaiNqRequestError requestError) { + this.requestError = requestError; + } + + public void setInventoryResponseItems(List inventoryResponseItems) { + this.inventoryResponseItems = inventoryResponseItems; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqResponseWrapper.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqResponseWrapper.java new file mode 100644 index 000000000..a04d6768a --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqResponseWrapper.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 java.util.UUID; + +public class AaiNqResponseWrapper { + + private UUID requestId; + private AaiNqResponse aaiNqResponse; + + public AaiNqResponseWrapper() {} + + public AaiNqResponseWrapper(UUID requestId, AaiNqResponse aaiNqResponse) { + this.requestId = requestId; + this.aaiNqResponse = aaiNqResponse; + } + + public UUID getRequestId() { + return requestId; + } + + public void setRequestId(UUID requestId) { + this.requestId = requestId; + } + + public AaiNqResponse getAaiNqResponse() { + return aaiNqResponse; + } + + public void setAaiNqResponse(AaiNqResponse aaiNqResponse) { + this.aaiNqResponse = aaiNqResponse; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqServiceExcept.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqServiceExcept.java new file mode 100644 index 000000000..77ac46d3d --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqServiceExcept.java @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqServiceExcept implements Serializable { + private static final long serialVersionUID = 2858343404484338546L; + + @SerializedName("messageId") + private String messageId; + + @SerializedName("text") + private String text; + + @SerializedName("variables") + private String[] variables; + + public String getMessageId() { + return messageId; + } + + public String getText() { + return text; + } + + public String[] getVariables() { + return variables; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqServiceInstance.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqServiceInstance.java new file mode 100644 index 000000000..a3aa65920 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqServiceInstance.java @@ -0,0 +1,117 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 AaiNqServiceInstance implements Serializable { + private static final long serialVersionUID = -8000944396593889586L; + + @SerializedName("service-instance-id") + private String serviceInstanceId; + + @SerializedName("service-instance-name") + private String serviceInstanceName; + + @SerializedName("persona-model-id") + private String personaModelId; + + @SerializedName("persona-model-version") + private String personaModelVersion; + + @SerializedName("service-instance-location-id") + private String serviceInstanceLocationId; + + @SerializedName("resource-version") + private String resourceVersion; + + @SerializedName("model-invariant-id") + private String modelInvariantId; + + @SerializedName("model-version-id") + private String modelVersionId; + + public String getServiceInstanceId() { + return serviceInstanceId; + } + + public String getServiceInstanceName() { + return serviceInstanceName; + } + + public String getPersonaModelId() { + return personaModelId; + } + + public String getPersonaModelVersion() { + return personaModelVersion; + } + + public String getServiceInstanceLocationId() { + return serviceInstanceLocationId; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public String getModelInvariantId() { + return modelInvariantId; + } + + public String getModelVersionId() { + return modelVersionId; + } + + public void setServiceInstanceId(String serviceInstanceId) { + this.serviceInstanceId = serviceInstanceId; + } + + public void setServiceInstanceName(String serviceInstanceName) { + this.serviceInstanceName = serviceInstanceName; + } + + public void setPersonaModelId(String personaModelId) { + this.personaModelId = personaModelId; + } + + public void setPersonaModelVersion(String personaModelVersion) { + this.personaModelVersion = personaModelVersion; + } + + public void setServiceInstanceLocationId(String serviceInstanceLocationId) { + this.serviceInstanceLocationId = serviceInstanceLocationId; + } + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + public void setModelInvariantId(String modelInvariantId) { + this.modelInvariantId = modelInvariantId; + } + + public void setModelVersionId(String modelVersionId) { + this.modelVersionId = modelVersionId; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqTenant.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqTenant.java new file mode 100644 index 000000000..c8c6d106f --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqTenant.java @@ -0,0 +1,64 @@ +/*- + * ============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 AaiNqTenant implements Serializable { + private static final long serialVersionUID = 4702784101671984364L; + + @SerializedName("tenant-id") + private String tenantId; + + @SerializedName("tenant-name") + private String tenantName; + + @SerializedName("resource-version") + private String resourceVersion; + + public String getTenantId() { + return tenantId; + } + + public String getTenantName() { + return tenantName; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + +} 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 new file mode 100644 index 000000000..9ec86c12a --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java @@ -0,0 +1,119 @@ +/*- + * ============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 AaiNqVServer implements Serializable { + private static final long serialVersionUID = -6718526692734215643L; + + @SerializedName("vserver-id") + private String vserverId; + + @SerializedName("vserver-name") + private String vserverName; + + @SerializedName("vserver-name2") + private String vserverName2; + + @SerializedName("prov-status") + private String provStatus; + + @SerializedName("vserver-selflink") + private String vserverSelflink; + + @SerializedName("in-maint") + private Boolean inMaint; + + @SerializedName("is-closed-loop-disabled") + private Boolean isClosedLoopDisabled; + + @SerializedName("resource-version") + private String resourceVersion; + + public String getVserverId() { + return vserverId; + } + + public String getVserverName() { + return vserverName; + } + + public String getVserverName2() { + return vserverName2; + } + + public String getProvStatus() { + return provStatus; + } + + public String getVserverSelflink() { + return vserverSelflink; + } + + public Boolean getInMaint() { + return inMaint; + } + + public Boolean getIsClosedLoopDisabled() { + return isClosedLoopDisabled; + } + + public String getResourceVersion() { + return resourceVersion; + } + + 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 void setProvStatus(String provStatus) { + this.provStatus = provStatus; + } + + public void setVserverSelflink(String vserverSelflink) { + this.vserverSelflink = vserverSelflink; + } + + public void setInMaint(Boolean inMaint) { + this.inMaint = inMaint; + } + + public void setIsClosedLoopDisabled(Boolean isClosedLoopDisabled) { + this.isClosedLoopDisabled = isClosedLoopDisabled; + } + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVfModule.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVfModule.java new file mode 100644 index 000000000..923092a25 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVfModule.java @@ -0,0 +1,172 @@ +/*- + * ============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 AaiNqVfModule implements Serializable { + private static final long serialVersionUID = 8019133081429638231L; + + @SerializedName("vf-module-id") + private String vfModuleId; + + @SerializedName("vf-module-name") + private String vfModuleName; + + @SerializedName("heat-stack-id") + private String heatStackId; + + @SerializedName("orchestration-status") + private String orchestrationStatus; + + @SerializedName("is-base-vf-module") + private Boolean isBaseVfModule; + + @SerializedName("resource-version") + private String resourceVersion; + + @SerializedName("persona-model-id") + private String personaModelId; + + @SerializedName("persona-model-version") + private String personaModelVersion; + + @SerializedName("widget-model-id") + private String widgetModelId; + + @SerializedName("widget-model-version") + private String widgetModelVersion; + + @SerializedName("contrail-service-instance-fqdn") + private String contrailServiceInstanceFqdn; + + @SerializedName("model-invariant-id") + private String modelInvariantId; + + @SerializedName("model-version-id") + private String modelVersionId; + + public String getVfModuleId() { + return vfModuleId; + } + + public String getVfModuleName() { + return vfModuleName; + } + + public String getHeatStackId() { + return heatStackId; + } + + public String getOrchestrationStatus() { + return orchestrationStatus; + } + + public Boolean getIsBaseVfModule() { + return isBaseVfModule; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public String getPersonaModelId() { + return personaModelId; + } + + public String getPersonaModelVersion() { + return personaModelVersion; + } + + public String getWidgetModelId() { + return widgetModelId; + } + + public String getWidgetModelVersion() { + return widgetModelVersion; + } + + public String getContrailServiceInstanceFqdn() { + return contrailServiceInstanceFqdn; + } + + public String getModelInvariantId() { + return modelInvariantId; + } + + public String getModelVersionId() { + return modelVersionId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public void setVfModuleName(String vfModuleName) { + this.vfModuleName = vfModuleName; + } + + public void setHeatStackId(String heatStackId) { + this.heatStackId = heatStackId; + } + + public void setOrchestrationStatus(String orchestrationStatus) { + this.orchestrationStatus = orchestrationStatus; + } + + public void setIsBaseVfModule(Boolean isBaseVfModule) { + this.isBaseVfModule = isBaseVfModule; + } + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + public void setPersonaModelId(String personaModelId) { + this.personaModelId = personaModelId; + } + + public void setPersonaModelVersion(String personaModelVersion) { + this.personaModelVersion = personaModelVersion; + } + + public void setWidgetModelId(String widgetModelId) { + this.widgetModelId = widgetModelId; + } + + public void setWidgetModelVersion(String widgetModelVersion) { + this.widgetModelVersion = widgetModelVersion; + } + + public void setContrailServiceInstanceFqdn(String contrailServiceInstanceFqdn) { + this.contrailServiceInstanceFqdn = contrailServiceInstanceFqdn; + } + + public void setModelInvariantId(String modelInvariantId) { + this.modelInvariantId = modelInvariantId; + } + + public void setModelVersionId(String modelVersionId) { + this.modelVersionId = modelVersionId; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNF.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNF.java deleted file mode 100644 index 934fb1edc..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNF.java +++ /dev/null @@ -1,84 +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 java.io.Serializable; - -public class PNF implements Serializable { - private static final long serialVersionUID = -3535108358668248501L; - - private String pnfName; - private PNFType pnfType; - - public PNF() { - - } - - public PNF(PNF pnf) { - this.pnfName = pnf.pnfName; - this.pnfType = pnf.pnfType; - } - - public String getPNFName() { - return pnfName; - } - - public void setPNFName(String pNFName) { - pnfName = pNFName; - } - - public PNFType getPNFType() { - return pnfType; - } - - public void setPNFType(PNFType pNFType) { - pnfType = pNFType; - } - - @Override - public String toString() { - return "PNF [PNFName=" + pnfName + ", PNFType=" + pnfType + "]"; - } - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((pnfName == null) ? 0 : pnfName.hashCode()); - result = prime * result + ((pnfType == null) ? 0 : pnfType.hashCode()); - return result; - } - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - PNF other = (PNF) obj; - if (pnfName == null) { - if (other.pnfName != null) - return false; - } else if (!pnfName.equals(other.pnfName)) - return false; - return pnfType == other.pnfType; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNFInstance.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNFInstance.java deleted file mode 100644 index 159e5cb28..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNFInstance.java +++ /dev/null @@ -1,126 +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 java.io.Serializable; - -public class PNFInstance implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3694152433472165034L; - - private String pnfName; - private String pnfInstanceName; - private PNFType pnfType; - private String pnfSerial; - - public PNFInstance() { - - } - - public PNFInstance(PNFInstance instance) { - if (instance == null) { - return; - } - this.pnfName = instance.pnfName; - this.pnfInstanceName = instance.pnfInstanceName; - this.pnfType = instance.pnfType; - this.pnfSerial = instance.pnfSerial; - } - - public String getPNFName() { - return pnfName; - } - - public void setPNFName(String pNFName) { - pnfName = pNFName; - } - - public String getPNFInstanceName() { - return pnfInstanceName; - } - - public void setPNFInstanceName(String pNFInstanceName) { - pnfInstanceName = pNFInstanceName; - } - - public PNFType getPNFType() { - return pnfType; - } - - public void setPNFType(PNFType pNFType) { - pnfType = pNFType; - } - - public String getPNFSerial() { - return pnfSerial; - } - - public void setPNFSerial(String pNFSerial) { - pnfSerial = pNFSerial; - } - - @Override - public String toString() { - return "PNFInstance [PNFName=" + pnfName + ", PNFInstanceName=" + pnfInstanceName + ", PNFType=" + pnfType - + ", PNFSerial=" + pnfSerial + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((pnfInstanceName == null) ? 0 : pnfInstanceName.hashCode()); - result = prime * result + ((pnfName == null) ? 0 : pnfName.hashCode()); - result = prime * result + ((pnfSerial == null) ? 0 : pnfSerial.hashCode()); - result = prime * result + ((pnfType == null) ? 0 : pnfType.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - PNFInstance other = (PNFInstance) obj; - if (pnfInstanceName == null) { - if (other.pnfInstanceName != null) - return false; - } else if (!pnfInstanceName.equals(other.pnfInstanceName)) - return false; - if (pnfName == null) { - if (other.pnfName != null) - return false; - } else if (!pnfName.equals(other.pnfName)) - return false; - if (pnfSerial == null) { - if (other.pnfSerial != null) - return false; - } else if (!pnfSerial.equals(other.pnfSerial)) - return false; - return pnfType == other.pnfType; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNFType.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNFType.java deleted file mode 100644 index 5774b364f..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PNFType.java +++ /dev/null @@ -1,37 +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; - -public enum PNFType { - ENODEB("eNodeB"), - PSERVER("pserver"); - - private String type; - - private PNFType(String type) { - this.type = type; - } - - @Override - public String toString() { - return this.type; - } -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Pnf.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Pnf.java new file mode 100644 index 000000000..2ef0bde46 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Pnf.java @@ -0,0 +1,91 @@ +/*- + * ============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 java.io.Serializable; + +public class Pnf implements Serializable { + private static final long serialVersionUID = -3535108358668248501L; + + private String pnfName; + private PnfType pnfType; + + public Pnf() { + + } + + public Pnf(Pnf pnf) { + this.pnfName = pnf.pnfName; + this.pnfType = pnf.pnfType; + } + + public String getPnfName() { + return pnfName; + } + + public void setPnfName(String pnfName) { + this.pnfName = pnfName; + } + + public PnfType getPnfType() { + return pnfType; + } + + public void setPnfType(PnfType pnfType) { + this.pnfType = pnfType; + } + + @Override + public String toString() { + return "PNF [PNFName=" + pnfName + ", PNFType=" + pnfType + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((pnfName == null) ? 0 : pnfName.hashCode()); + result = prime * result + ((pnfType == null) ? 0 : pnfType.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + Pnf other = (Pnf) obj; + if (pnfName == null) { + if (other.pnfName != null) { + return false; + } + } else if (!pnfName.equals(other.pnfName)) { + return false; + } + return pnfType == other.pnfType; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PnfInstance.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PnfInstance.java new file mode 100644 index 000000000..9d9e26c2c --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PnfInstance.java @@ -0,0 +1,137 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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 java.io.Serializable; + +public class PnfInstance implements Serializable { + + private static final long serialVersionUID = -3694152433472165034L; + + private String pnfName; + private String pnfInstanceName; + private PnfType pnfType; + private String pnfSerial; + + public PnfInstance() { + + } + + /** + * Create an instance from a given instance. + * + * @param instance the instance + */ + public PnfInstance(PnfInstance instance) { + if (instance == null) { + return; + } + this.pnfName = instance.pnfName; + this.pnfInstanceName = instance.pnfInstanceName; + this.pnfType = instance.pnfType; + this.pnfSerial = instance.pnfSerial; + } + + public String getPnfName() { + return pnfName; + } + + public void setPnfName(String pnfName) { + this.pnfName = pnfName; + } + + public String getPnfInstanceName() { + return pnfInstanceName; + } + + public void setPnfInstanceName(String pnfInstanceName) { + this.pnfInstanceName = pnfInstanceName; + } + + public PnfType getPnfType() { + return pnfType; + } + + public void setPnfType(PnfType pnfType) { + this.pnfType = pnfType; + } + + public String getPnfSerial() { + return pnfSerial; + } + + public void setPnfSerial(String pnfSerial) { + this.pnfSerial = pnfSerial; + } + + @Override + public String toString() { + return "PNFInstance [PNFName=" + pnfName + ", PNFInstanceName=" + pnfInstanceName + ", PNFType=" + pnfType + + ", PNFSerial=" + pnfSerial + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((pnfInstanceName == null) ? 0 : pnfInstanceName.hashCode()); + result = prime * result + ((pnfName == null) ? 0 : pnfName.hashCode()); + result = prime * result + ((pnfSerial == null) ? 0 : pnfSerial.hashCode()); + result = prime * result + ((pnfType == null) ? 0 : pnfType.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + PnfInstance other = (PnfInstance) obj; + if (pnfInstanceName == null) { + if (other.pnfInstanceName != null) { + return false; + } + } else if (!pnfInstanceName.equals(other.pnfInstanceName)) { + return false; + } + if (pnfName == null) { + if (other.pnfName != null) { + return false; + } + } else if (!pnfName.equals(other.pnfName)) { + return false; + } + if (pnfSerial == null) { + if (other.pnfSerial != null) { + return false; + } + } else if (!pnfSerial.equals(other.pnfSerial)) { + return false; + } + return pnfType == other.pnfType; + } +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PnfType.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PnfType.java new file mode 100644 index 000000000..29dd2690c --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/PnfType.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * aai + * ================================================================================ + * 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. + * 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; + +public enum PnfType { + ENODEB("eNodeB"), PSERVER("pserver"); + + private String type; + + private PnfType(String type) { + this.type = type; + } + + @Override + public String toString() { + return this.type; + } +} 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 a55c04138..ab6d0a6ee 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 @@ -20,24 +20,24 @@ package org.onap.policy.aai; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.util.LinkedList; import java.util.List; -import com.google.gson.annotations.SerializedName; - public class RelatedToProperty implements Serializable { - private static final long serialVersionUID = 2088088164920423658L; + private static final long serialVersionUID = 2088088164920423658L; + + @SerializedName("related-to-property") + private List relatedTo = new LinkedList<>(); - @SerializedName("related-to-property") - private List relatedTo = new LinkedList<>(); + public List getRelatedTo() { + return relatedTo; + } - public List getRelatedTo() { - return relatedTo; - } - public void setRelatedTo(List relatedTo) { - this.relatedTo = relatedTo; - } + public void setRelatedTo(List relatedTo) { + this.relatedTo = relatedTo; + } } - \ No newline at end of file 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 index e23f45c11..ee7d108b5 100644 --- 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 @@ -20,29 +20,31 @@ package org.onap.policy.aai; -import java.io.Serializable; - 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; - } + 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 ba5d596ea..732b645be 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 @@ -20,54 +20,54 @@ package org.onap.policy.aai; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class Relationship implements Serializable { - private static final long serialVersionUID = -68508443869003054L; - - @SerializedName("related-to") - private String relatedTo; - - @SerializedName("related-link") - private String relatedLink; - - @SerializedName("relationship-data") - private RelationshipData relationshipData = new RelationshipData(); - - @SerializedName("related-to-property") - private RelatedToProperty relatedToProperty = new RelatedToProperty(); - - public String getRelatedTo() { - return relatedTo; - } - - public String getRelatedLink() { - return relatedLink; - } - - public RelationshipData getRelationshipData() { - return relationshipData; - } - - public RelatedToProperty getRelatedToProperty() { - return relatedToProperty; - } - - public void setRelatedTo(String relatedTo) { - this.relatedTo = relatedTo; - } - - public void setRelatedLink(String relatedLink) { - this.relatedLink = relatedLink; - } - - public void setRelationshipData(RelationshipData relationshipData) { - this.relationshipData = relationshipData; - } - - public void setRelatedToProperty(RelatedToProperty relatedToProperty) { - this.relatedToProperty = relatedToProperty; - } + private static final long serialVersionUID = -68508443869003054L; + + @SerializedName("related-to") + private String relatedTo; + + @SerializedName("related-link") + private String relatedLink; + + @SerializedName("relationship-data") + private RelationshipData relationshipData = new RelationshipData(); + + @SerializedName("related-to-property") + private RelatedToProperty relatedToProperty = new RelatedToProperty(); + + public String getRelatedTo() { + return relatedTo; + } + + public String getRelatedLink() { + return relatedLink; + } + + public RelationshipData getRelationshipData() { + return relationshipData; + } + + public RelatedToProperty getRelatedToProperty() { + return relatedToProperty; + } + + public void setRelatedTo(String relatedTo) { + this.relatedTo = relatedTo; + } + + public void setRelatedLink(String relatedLink) { + this.relatedLink = relatedLink; + } + + public void setRelationshipData(RelationshipData relationshipData) { + this.relationshipData = relationshipData; + } + + public void setRelatedToProperty(RelatedToProperty 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 be9e8bfda..454f9871a 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 @@ -20,22 +20,22 @@ package org.onap.policy.aai; -import java.util.List; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.util.LinkedList; - -import com.google.gson.annotations.SerializedName; +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 = 6809180843309562121L; + @SerializedName("relationship-data") + private List relationshipDataList = new LinkedList<>(); - public List getRelationshipData() { - return relationshipDataList; - } + public List getRelationshipData() { + return relationshipDataList; + } - public void setRelationshipData(List relationshipData) { - this.relationshipDataList = relationshipData; - } + public void setRelationshipData(List relationshipData) { + this.relationshipDataList = relationshipData; + } } 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 index eb3a6c85b..bab45d486 100644 --- 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 @@ -20,29 +20,31 @@ package org.onap.policy.aai; -import java.io.Serializable; - 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; - } + 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 index 681574f47..179785717 100644 --- 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 @@ -20,23 +20,23 @@ package org.onap.policy.aai; -import java.util.List; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.util.LinkedList; - -import com.google.gson.annotations.SerializedName; +import java.util.List; public class RelationshipItem implements Serializable { - private static final long serialVersionUID = 1543404460741069628L; - - @SerializedName("related-to-property") - private List relatedToProperty = new LinkedList<>(); + private static final long serialVersionUID = 1543404460741069628L; + + @SerializedName("related-to-property") + private List relatedToProperty = new LinkedList<>(); - public List getRelatedToProperty() { - return relatedToProperty; - } + public List getRelatedToProperty() { + return relatedToProperty; + } - public void setRelatedToProperty(List relatedToProperty) { - this.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/RelationshipList.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java index d181f131e..347676820 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 @@ -21,22 +21,24 @@ package org.onap.policy.aai; import com.google.gson.annotations.SerializedName; + import java.io.Serializable; -import java.util.List; -import java.util.LinkedList; +import java.util.LinkedList; +import java.util.List; public class RelationshipList implements Serializable { - private static final long serialVersionUID = 6115655704973981989L; + private static final long serialVersionUID = 6115655704973981989L; - @SerializedName("relationship-list") + @SerializedName("relationship-list") private List relationships = new LinkedList<>(); - - public List getRelationshipList() { - return relationships; - } - public void setRelationshipList(List relationshipList) { - this.relationships = relationshipList; - } - - + + public List getRelationshipList() { + return relationships; + } + + public void setRelationshipList(List relationshipList) { + this.relationships = relationshipList; + } + + } diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/AAIException.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/AAIException.java deleted file mode 100644 index 7e65ece22..000000000 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/AAIException.java +++ /dev/null @@ -1,48 +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.util; - -public class AAIException extends Exception { - - private static final long serialVersionUID = 9220983727706207465L; - - public AAIException() { - super(); - } - - public AAIException(String message, Throwable cause, boolean enableSuppression, - boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } - - public AAIException(String message, Throwable cause) { - super(message, cause); - } - - public AAIException(String message) { - super(message); - } - - public AAIException(Throwable cause) { - super(cause); - } - -} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/AaiException.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/AaiException.java new file mode 100644 index 000000000..45ddac431 --- /dev/null +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/AaiException.java @@ -0,0 +1,47 @@ +/*- + * ============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.util; + +public class AaiException extends Exception { + + private static final long serialVersionUID = 9220983727706207465L; + + public AaiException() { + super(); + } + + public AaiException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } + + public AaiException(String message, Throwable cause) { + super(message, cause); + } + + public AaiException(String message) { + super(message); + } + + public AaiException(Throwable cause) { + super(cause); + } + +} diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java index 934700993..2c8263467 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java @@ -25,11 +25,9 @@ import com.google.gson.GsonBuilder; public final class Serialization { - private Serialization(){ - } + private Serialization() {} - public static final Gson gsonPretty = new GsonBuilder().disableHtmlEscaping() - .setPrettyPrinting() -// .registerTypeAdapter(AAIQueryParameters.class, new notificationTypeAdapter()) - .create(); + public static final Gson gsonPretty = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting() + // .registerTypeAdapter(AAIQueryParameters.class, new notificationTypeAdapter()) + .create(); } -- cgit 1.2.3-korg