aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/main
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-12-05 19:08:54 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-05 19:08:54 +0000
commit35726250e078b57ebe6ea4e53b4b8ccd56573e50 (patch)
tree9dd38886e940ae494534be19da15126707417423 /mso-catalog-db/src/main
parent03b31bd484e2a46da210f0b2d31b1d5447b41952 (diff)
parent6adb4ab50bd5c2e32ea0b57fe5a3ba5b7238e57a (diff)
Merge "Add Cloud Owner"
Diffstat (limited to 'mso-catalog-db/src/main')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java18
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java12
2 files changed, 28 insertions, 2 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java
index 0df176c3f8..a7ce2da70d 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java
@@ -83,6 +83,10 @@ public class NorthBoundRequest implements Serializable {
@Column(name = "MAX_API_VERSION")
private Double maxApiVersion;
+ @BusinessKey
+ @Column(name = "CLOUD_OWNER")
+ private String cloudOwner;
+
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest")
private List<OrchestrationFlow> orchestrationFlowList;
@@ -90,7 +94,8 @@ public class NorthBoundRequest implements Serializable {
public String toString() {
return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope)
.append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow)
- .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion).toString();
+ .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion)
+ .append("cloudOwner",cloudOwner).toString();
}
@Override
@@ -102,13 +107,14 @@ public class NorthBoundRequest implements Serializable {
return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope)
.append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow)
.append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion)
+ .append(cloudOwner, castOther.cloudOwner)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow)
- .append(minApiVersion).append(maxApiVersion).toHashCode();
+ .append(minApiVersion).append(maxApiVersion).append(cloudOwner).toHashCode();
}
public Integer getId() {
@@ -174,6 +180,14 @@ public class NorthBoundRequest implements Serializable {
public void setMaxApiVersion(Double maxApiVersion) {
this.maxApiVersion = maxApiVersion;
}
+
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
@LinkedResource
public List<OrchestrationFlow> getOrchestrationFlowList() {
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
index 4f070e71c9..51c55bdfce 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
@@ -118,6 +118,7 @@ public class CatalogDbClient {
private static final String TARGET_ACTION = "targetAction";
private static final String REQUEST_SCOPE = "requestScope";
private static final String IS_ALACARTE = "isALaCarte";
+ private static final String CLOUD_OWNER = "cloudOwner";
private static final String FLOW_NAME = "flowName";
private static final String SERVICE_TYPE = "serviceType";
private static final String VNF_TYPE = "vnfType";
@@ -151,6 +152,7 @@ public class CatalogDbClient {
private String findVnfcInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID";
private String findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID";
private String findOneByActionAndRequestScopeAndIsAlacarte = "/findOneByActionAndRequestScopeAndIsAlacarte";
+ private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner";
private String findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = "/findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep";
private String findByClliAndCloudVersion = "/findByClliAndCloudVersion";
@@ -248,6 +250,7 @@ public class CatalogDbClient {
findVnfcInstanceGroupCustomizationByModelCustomizationUUID = endpoint + VNFC_INSTANCE_GROUP_CUSTOMIZATION + SEARCH + findVnfcInstanceGroupCustomizationByModelCustomizationUUID;
findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = endpoint + COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION + SEARCH + findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID;
findOneByActionAndRequestScopeAndIsAlacarte = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarte;
+ findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner;
findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = endpoint + RAINY_DAY_HANDLER_MACRO + SEARCH + findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep;
findByClliAndCloudVersion = endpoint + CLOUD_SITE + SEARCH + findByClliAndCloudVersion;
@@ -477,6 +480,15 @@ public class CatalogDbClient {
.queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName)
.queryParam(IS_ALACARTE, aLaCarte).build());
}
+
+ public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(String requestAction,
+ String resourceName, boolean aLaCarte, String cloudOwner) {
+ return this.getSingleResource(northBoundRequestClient, getUri(UriBuilder
+ .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner)
+ .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName)
+ .queryParam(IS_ALACARTE, aLaCarte)
+ .queryParam(CLOUD_OWNER, cloudOwner).build().toString()));
+ }
public RainyDayHandlerStatus getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
String flowName, String serviceType, String vnfType, String errorCode, String workStep) {