2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.tosca.datatypes;
23 import org.openecomp.core.utilities.file.FileContentHandler;
24 import org.openecomp.sdc.datatypes.model.AsdcModel;
25 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
26 import org.openecomp.sdc.tosca.services.DataModelUtil;
28 import java.util.Collections;
32 * Tosca service model.
34 public class ToscaServiceModel implements AsdcModel {
35 private FileContentHandler artifactFiles;
36 private Map<String, ServiceTemplate> serviceTemplates;
37 private String entryDefinitionServiceTemplate;
39 public ToscaServiceModel() {
43 * Instantiates a new Tosca service model.
45 * @param artifactFiles the artifact files
46 * @param serviceTemplates the service templates
47 * @param entryDefinitionServiceTemplate the entry definition service template
49 public ToscaServiceModel(FileContentHandler artifactFiles,
50 Map<String, ServiceTemplate> serviceTemplates,
51 String entryDefinitionServiceTemplate) {
52 this.artifactFiles = artifactFiles;
53 this.serviceTemplates = serviceTemplates;
54 this.entryDefinitionServiceTemplate = entryDefinitionServiceTemplate;
59 * Gets artifact files.
61 * @return the artifact files
63 public FileContentHandler getArtifactFiles() {
67 public void setArtifactFiles(FileContentHandler artifactFiles) {
68 this.artifactFiles = artifactFiles;
72 * Gets service templates.
74 * @return the service templates
76 public Map<String, ServiceTemplate> getServiceTemplates() {
77 return Collections.unmodifiableMap(serviceTemplates);
81 * Sets service templates.
83 * @param serviceTemplates the service templates
85 public void setServiceTemplates(Map<String, ServiceTemplate> serviceTemplates) {
86 this.serviceTemplates = serviceTemplates;
90 * Gets entry definition service template.
92 * @return the entry definition service template
94 public String getEntryDefinitionServiceTemplate() {
95 return entryDefinitionServiceTemplate;
99 * Sets entry definition service template.
101 * @param entryDefinitionServiceTemplate the entry definition service template
103 public void setEntryDefinitionServiceTemplate(String entryDefinitionServiceTemplate) {
104 this.entryDefinitionServiceTemplate = entryDefinitionServiceTemplate;
108 * Gets cloned service model.
110 * @param toscaServiceModel the tosca service model
111 * @return the cloned service model
113 public static ToscaServiceModel getClonedServiceModel(ToscaServiceModel toscaServiceModel) {
114 return ToscaServiceModel.class.cast(DataModelUtil.getClonedObject(toscaServiceModel));