push addional code
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / vendor-software-products-rest / vendor-software-products-rest-services / src / main / java / org / openecomp / sdcrests / vsp / rest / services / ProcessesImpl.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.sdcrests.vsp.rest.services;
22
23 import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.GENERAL_COMPONENT_ID;
24
25 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
26 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
27 import org.openecomp.sdcrests.vsp.rest.ComponentProcesses;
28 import org.openecomp.sdcrests.vsp.rest.Processes;
29 import org.springframework.beans.factory.annotation.Autowired;
30 import org.springframework.context.annotation.Scope;
31 import org.springframework.stereotype.Service;
32
33 import javax.inject.Named;
34 import javax.ws.rs.core.Response;
35
36 @Named
37 @Service("processes")
38 @Scope(value = "prototype")
39 public class ProcessesImpl implements Processes {
40
41   @Autowired
42   private ComponentProcesses componentProcesses;
43
44   @Override
45   public Response list(String vspId, String version, String user) {
46     return componentProcesses.list(vspId, GENERAL_COMPONENT_ID, version, user);
47   }
48
49   @Override
50   public Response deleteList(String vspId, String user) {
51     return componentProcesses.deleteList(vspId, GENERAL_COMPONENT_ID, user);
52   }
53
54   @Override
55   public Response create(ProcessRequestDto request, String vspId, String user) {
56     return componentProcesses.create(request, vspId, GENERAL_COMPONENT_ID, user);
57   }
58
59   @Override
60   public Response get(String vspId, String processId, String version, String user) {
61     return componentProcesses.get(vspId, GENERAL_COMPONENT_ID, processId, version, user);
62   }
63
64   @Override
65   public Response delete(String vspId, String processId, String user) {
66     return componentProcesses.delete(vspId, GENERAL_COMPONENT_ID, processId, user);
67   }
68
69   @Override
70   public Response update(ProcessRequestDto request, String vspId, String processId, String user) {
71     return componentProcesses.update(request, vspId, GENERAL_COMPONENT_ID, processId, user);
72   }
73
74   @Override
75   public Response getUploadedFile(String vspId, String processId, String version, String user) {
76     return componentProcesses
77         .getUploadedFile(vspId, GENERAL_COMPONENT_ID, processId, version, user);
78   }
79
80   @Override
81   public Response deleteUploadedFile(String vspId, String processId, String user) {
82     return componentProcesses.deleteUploadedFile(vspId, GENERAL_COMPONENT_ID, processId, user);
83   }
84
85   @Override
86   public Response uploadFile(Attachment attachment, String vspId, String processId, String user) {
87     return componentProcesses.uploadFile(attachment, vspId, GENERAL_COMPONENT_ID, processId, user);
88   }
89 }