Respect owning-entity-id when searching instances by Subscriber
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / ServiceInstanceSearchResult.java
index 2665313..f750279 100644 (file)
@@ -22,9 +22,11 @@ package org.onap.vid.model;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import org.apache.commons.lang3.StringUtils;
+import org.onap.vid.roles.WithPermissionPropertiesOwningEntity;
 import org.onap.vid.roles.WithPermissionPropertiesSubscriberAndServiceType;
 
-public class ServiceInstanceSearchResult implements WithPermissionPropertiesSubscriberAndServiceType {
+public class ServiceInstanceSearchResult
+       implements WithPermissionPropertiesSubscriberAndServiceType, WithPermissionPropertiesOwningEntity {
 
        private final String SUBSCRIBER_ID_FRONTEND_ALIAS = "globalCustomerId";
 
@@ -42,14 +44,16 @@ public class ServiceInstanceSearchResult implements WithPermissionPropertiesSubs
 
        private String aaiModelVersionId;
 
+       private String owningEntityId;
+
        private boolean isPermitted;
 
        public ServiceInstanceSearchResult(){
        }
        
        public ServiceInstanceSearchResult(String serviceInstanceId, String subscriberId, String serviceType,
-                                                                          String serviceInstanceName, String subscriberName, String aaiModelInvariantId,
-                                                                          String aaiModelVersionId, boolean isPermitted) {
+               String serviceInstanceName, String subscriberName, String aaiModelInvariantId,
+               String aaiModelVersionId, String owningEntityId, boolean isPermitted) {
                this.serviceInstanceId = serviceInstanceId;
                this.subscriberId = subscriberId;
                this.serviceType = serviceType;
@@ -57,6 +61,7 @@ public class ServiceInstanceSearchResult implements WithPermissionPropertiesSubs
                this.subscriberName = subscriberName;
                this.aaiModelInvariantId = aaiModelInvariantId;
                this.aaiModelVersionId = aaiModelVersionId;
+               this.owningEntityId = owningEntityId;
                this.isPermitted = isPermitted;
        }
 
@@ -119,6 +124,15 @@ public class ServiceInstanceSearchResult implements WithPermissionPropertiesSubs
                this.aaiModelVersionId = aaiModelVersionId;
        }
 
+       @Override
+       public String getOwningEntityId() {
+               return owningEntityId;
+       }
+
+       public void setOwningEntityId(String owningEntityId) {
+               this.owningEntityId = owningEntityId;
+       }
+
        public boolean getIsPermitted() {
                return isPermitted;
        }