+ public static class Builder{
+ private VspMergeDao vspMergeDao;
+ private OrchestrationTemplateDao orchestrationTemplateDao;
+ private OrchestrationTemplateCandidateManager orchestrationTemplateCandidateManager;
+ private VendorSoftwareProductInfoDao vspInfoDao;
+ private VendorLicenseFacade vendorLicenseFacade;
+ private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao;
+ private EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao;
+ private VendorLicenseArtifactsService licenseArtifactsService;
+ private InformationArtifactGenerator informationArtifactGenerator;
+ private PackageInfoDao packageInfoDao;
+ private DeploymentFlavorDao deploymentFlavorDao;
+ private ComponentDao componentDao;
+ private ComponentDependencyModelDao componentDependencyModelDao;
+ private NicDao nicDao;
+ private ComputeDao computeDao;
+ private ImageDao imageDao;
+ private ManualVspToscaManager manualVspToscaManager;
+ private UniqueValueDao uniqueValueDao;
+ private CandidateService candidateService;
+
+ public Builder vspMerge(VspMergeDao vspMergeDao){
+ this.vspMergeDao = vspMergeDao;
+ return this;
+ }
+
+ public Builder orchestrationTemplate(OrchestrationTemplateDao orchestrationTemplateDao) {
+ this.orchestrationTemplateDao = orchestrationTemplateDao;
+ return this;
+ }
+
+ public Builder orchestrationTemplateCandidateManager(OrchestrationTemplateCandidateManager orchestrationTemplateCandidateManager) {
+ this.orchestrationTemplateCandidateManager = orchestrationTemplateCandidateManager;
+ return this;
+ }
+
+ public Builder vspInfo(VendorSoftwareProductInfoDao vspInfoDao) {
+ this.vspInfoDao = vspInfoDao;
+ return this;
+ }
+
+ public Builder vendorLicenseFacade(VendorLicenseFacade vendorLicenseFacade) {
+ this.vendorLicenseFacade = vendorLicenseFacade;
+ return this;
+ }
+
+ public Builder serviceModel(ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao) {
+ this.serviceModelDao = serviceModelDao;
+ return this;
+ }
+
+ public Builder enrichedServiceModel(EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao) {
+ this.enrichedServiceModelDao = enrichedServiceModelDao;
+ return this;
+ }
+
+ public Builder licenseArtifactsService(VendorLicenseArtifactsService licenseArtifactsService) {
+ this.licenseArtifactsService = licenseArtifactsService;
+ return this;
+ }
+
+ public Builder informationArtifactGenerator(InformationArtifactGenerator informationArtifactGenerator) {
+ this.informationArtifactGenerator = informationArtifactGenerator;
+ return this;
+ }
+
+ public Builder packageInfo(PackageInfoDao packageInfoDao) {
+ this.packageInfoDao = packageInfoDao;
+ return this;
+ }
+
+ public Builder deploymentFlavor(DeploymentFlavorDao deploymentFlavorDao) {
+ this.deploymentFlavorDao = deploymentFlavorDao;
+ return this;
+ }
+
+ public Builder component(ComponentDao componentDao) {
+ this.componentDao = componentDao;
+ return this;
+ }
+
+ public Builder componentDependencyModel(ComponentDependencyModelDao componentDependencyModelDao) {
+ this.componentDependencyModelDao = componentDependencyModelDao;
+ return this;
+ }
+
+ public Builder nic(NicDao nicDao) {
+ this.nicDao = nicDao;
+ return this;
+ }
+
+ public Builder compute(ComputeDao computeDao) {
+ this.computeDao = computeDao;
+ return this;
+ }
+
+ public Builder image(ImageDao imageDao) {
+ this.imageDao = imageDao;
+ return this;
+ }
+
+ public Builder manualVspToscaManager(ManualVspToscaManager manualVspToscaManager) {
+ this.manualVspToscaManager = manualVspToscaManager;
+ return this;
+ }
+
+ public Builder uniqueValue(UniqueValueDao uniqueValueDao) {
+ this.uniqueValueDao = uniqueValueDao;
+ return this;
+ }
+
+ public Builder candidateService(CandidateService candidateService) {
+ this.candidateService = candidateService;
+ return this;
+ }
+
+ private void registerToVersioning() {
+ if(serviceModelDao != null) {
+ serviceModelDao.registerVersioning(
+ VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
+ }
+ if(enrichedServiceModelDao != null) {
+ enrichedServiceModelDao.registerVersioning(
+ VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
+ }
+ }
+
+ public VendorSoftwareProductManager build(){
+ VendorSoftwareProductManagerImpl vendorSoftwareProductManager = new VendorSoftwareProductManagerImpl();
+ vendorSoftwareProductManager.vspMergeDao = this.vspMergeDao;
+ vendorSoftwareProductManager.orchestrationTemplateDao = this.orchestrationTemplateDao;
+ vendorSoftwareProductManager.orchestrationTemplateCandidateManager = this.orchestrationTemplateCandidateManager;
+ vendorSoftwareProductManager.vspInfoDao = this.vspInfoDao;
+ vendorSoftwareProductManager.vendorLicenseFacade = this.vendorLicenseFacade;
+ vendorSoftwareProductManager.serviceModelDao = this.serviceModelDao;
+ vendorSoftwareProductManager.enrichedServiceModelDao = this.enrichedServiceModelDao;
+ vendorSoftwareProductManager.licenseArtifactsService = this.licenseArtifactsService;
+ vendorSoftwareProductManager.informationArtifactGenerator = this.informationArtifactGenerator;
+ vendorSoftwareProductManager.packageInfoDao = this.packageInfoDao;
+ vendorSoftwareProductManager.deploymentFlavorDao = this.deploymentFlavorDao;
+ vendorSoftwareProductManager.componentDao = this.componentDao;
+ vendorSoftwareProductManager.componentDependencyModelDao = this.componentDependencyModelDao;
+ vendorSoftwareProductManager.nicDao = this.nicDao;
+ vendorSoftwareProductManager.computeDao = this.computeDao;
+ vendorSoftwareProductManager.imageDao = this.imageDao;
+ vendorSoftwareProductManager.manualVspToscaManager = this.manualVspToscaManager;
+ vendorSoftwareProductManager.uniqueValueUtil = new UniqueValueUtil(this.uniqueValueDao);
+ vendorSoftwareProductManager.candidateService = candidateService;
+ this.registerToVersioning();
+ return vendorSoftwareProductManager;
+ }
+ }
+