diff options
Diffstat (limited to 'ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/model/inventory/ServiceTypeRequest.java')
-rw-r--r-- | ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/model/inventory/ServiceTypeRequest.java | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/model/inventory/ServiceTypeRequest.java b/ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/model/inventory/ServiceTypeRequest.java new file mode 100644 index 0000000..42dd018 --- /dev/null +++ b/ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/model/inventory/ServiceTypeRequest.java @@ -0,0 +1,115 @@ +package org.onap.ccsdk.dashboard.model.inventory; + +import java.util.Collection; +import java.util.Optional; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ServiceTypeRequest { + + /** Owner of the Service Type */ + public String owner; + /** Name of the Service Type */ + public String typeName; + /** Version number of the Service Type */ + public Integer typeVersion; + /** String representation of a Cloudify blueprint with unbound variables */ + public String blueprintTemplate; + /** controller application name */ + public String application; + /** onboarding component name */ + public String component; + /** + * Collection of service ids used to associate with the Service Type. + * Service Types with this property as null or empty means they apply for every service id. + */ + public Collection<String> serviceIds; + /** Collection of vnfTypes associated with the Service Type */ + public Collection<String> vnfTypes; + /** + * Collection of service locations that are used to associate with the Service Type. + * Service Types with this property as null or empty means they apply for every service location. + */ + public Collection<String> serviceLocations; + /** + * Id of the service this Service Type is associated with. + * Value source is from ASDC's notification event's field 'serviceInvariantUUID'." + * */ + public Optional<String> asdcServiceId; + /** + * Id of the vf/vnf instance this Service Type is associated with. + * Value source is from ASDC's notification event's field 'resourceInvariantUUID'." + */ + public Optional<String> asdcResourceId; + /** URL to the ASDC Service Model */ + public Optional<String> asdcServiceURL; + + @JsonCreator + public ServiceTypeRequest (@JsonProperty("owner") String owner, + @JsonProperty("typeName") String typeName, + @JsonProperty("typeVersion") Integer typeVersion, + @JsonProperty("blueprintTemplate") String blueprintTemplate, + @JsonProperty("application") String application, + @JsonProperty("component") String component, + @JsonProperty("serviceIds") Collection<String> serviceIds, + @JsonProperty("vnfTypes") Collection<String> vnfTypes, + @JsonProperty("serviceLocations") Collection<String> serviceLocations, + @JsonProperty("asdcServiceId") String asdcServiceId, + @JsonProperty("asdcResourceId") String asdcResourceId, + @JsonProperty("asdcServiceURL") String asdcServiceURL) { + this(owner, typeName, typeVersion, blueprintTemplate, + application, component, + serviceIds, vnfTypes, serviceLocations, + Optional.ofNullable(asdcServiceId), + Optional.ofNullable(asdcResourceId), + Optional.ofNullable(asdcServiceURL)); + } + + public ServiceTypeRequest(String owner, + String typeName, + Integer typeVersion, + String blueprintTemplate, + String application, + String component, + Collection<String> serviceIds, + Collection<String> vnfTypes, + Collection<String> serviceLocations, + Optional<String> asdcServiceId, + Optional<String> asdcResourceId, + Optional<String> asdcServiceURL) { + this.owner = owner; + this.typeName = typeName; + this.typeVersion = typeVersion; + this.blueprintTemplate = blueprintTemplate; + this.application = application; + this.component = component; + this.serviceIds = serviceIds; + this.vnfTypes = vnfTypes; + this.serviceLocations = serviceLocations; + this.asdcServiceId = asdcServiceId; + this.asdcResourceId = asdcResourceId; + this.asdcServiceURL = asdcServiceURL; + } + + public static ServiceTypeRequest from(ServiceType serviceType) { + return new ServiceTypeRequest( + serviceType.getOwner(), + serviceType.getTypeName(), + serviceType.getTypeVersion(), + serviceType.getBlueprintTemplate(), + serviceType.getApplication(), + serviceType.getComponent(), + serviceType.getServiceIds(), + serviceType.getVnfTypes(), + serviceType.getServiceLocations(), + serviceType.getAsdcServiceId(), + serviceType.getAsdcResourceId(), + serviceType.getAsdcServiceURL() + ); + } + + public String getBlueprintTemplate() { + return this.blueprintTemplate; + } +} |