3a03b1f73bbabababc670e4267cc2dac3b38a1c6
[sdc.git] /
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  * Modifications copyright (c) 2019 Nokia
20  * ================================================================================
21  */
22
23 package org.openecomp.sdcrests.vsp.rest.services;
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   private final ComponentProcesses componentProcesses;
42
43   @Autowired
44   public ProcessesImpl(ComponentProcesses componentProcesses) {
45     this.componentProcesses = componentProcesses;
46   }
47
48   @Override
49   public Response list(String vspId, String versionId, String user) {
50     return componentProcesses.list(vspId, versionId, null, user);
51   }
52
53   @Override
54   public Response deleteList(String vspId, String versionId, String user) {
55     return componentProcesses.deleteList(vspId, versionId, null, user);
56   }
57
58   @Override
59   public Response create(ProcessRequestDto request, String vspId, String versionId, String user) {
60     return componentProcesses.create(request, vspId, versionId, null, user);
61   }
62
63   @Override
64   public Response get(String vspId, String versionId, String processId, String user) {
65     return componentProcesses.get(vspId, versionId, null, processId, user);
66   }
67
68   @Override
69   public Response delete(String vspId, String versionId, String processId, String user) {
70     return componentProcesses.delete(vspId, versionId, null, processId, user);
71   }
72
73   @Override
74   public Response update(ProcessRequestDto request, String vspId, String versionId,
75                          String processId, String user) {
76     return componentProcesses.update(request, vspId, versionId, null, processId, user);
77   }
78
79   @Override
80   public Response getUploadedFile(String vspId, String versionId, String processId, String user) {
81     return componentProcesses.getUploadedFile(vspId, versionId, null, processId, user);
82   }
83
84   @Override
85   public Response deleteUploadedFile(String vspId, String versionId, String processId,
86                                      String user) {
87     return componentProcesses.deleteUploadedFile(vspId, versionId, null, processId, user);
88   }
89
90   @Override
91   public Response uploadFile(Attachment attachment, String vspId, String versionId,
92                              String processId, String user) {
93     return componentProcesses.uploadFile(attachment, vspId, versionId, null, processId, user);
94   }
95 }