737e9eeb37da295488f3408901105a0b305bf7ec
[so.git] / bpmn / so-bpmn-tasks / src / main / java / org / onap / so / client / orchestration / VnfAdapterVolumeGroupResources.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Modifications Copyright (c) 2019 Samsung
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.so.client.orchestration;
24
25 import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest;
26 import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest;
27 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
28 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
29 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
30 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
31 import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
32 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
33 import org.onap.so.client.adapter.vnf.VnfVolumeAdapterClientImpl;
34 import org.onap.so.client.adapter.vnf.mapper.VnfAdapterObjectMapper;
35 import org.slf4j.Logger;
36 import org.slf4j.LoggerFactory;
37 import org.springframework.beans.factory.annotation.Autowired;
38 import org.springframework.stereotype.Component;
39
40 @Component
41 public class VnfAdapterVolumeGroupResources {
42         private static final Logger logger = LoggerFactory.getLogger(VnfAdapterVolumeGroupResources.class);
43
44         @Autowired
45         private VnfAdapterObjectMapper vnfAdapterObjectMapper;
46         
47         @Autowired
48         private VnfVolumeAdapterClientImpl vnfVolumeAdapterClient;
49         
50         public CreateVolumeGroupRequest createVolumeGroupRequest(RequestContext requestContext, CloudRegion cloudRegion, OrchestrationContext orchestrationContext, ServiceInstance serviceInstance, GenericVnf genericVnf, VolumeGroup volumeGroup, String sdncVfModuleQueryResponse) throws Exception {
51                 return vnfAdapterObjectMapper.createVolumeGroupRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, genericVnf, volumeGroup, sdncVfModuleQueryResponse);
52         }
53         
54         public DeleteVolumeGroupRequest deleteVolumeGroupRequest(RequestContext requestContext, CloudRegion cloudRegion, ServiceInstance serviceInstance, VolumeGroup volumeGroup) throws Exception {
55                 return vnfAdapterObjectMapper.deleteVolumeGroupRequestMapper(requestContext, cloudRegion, serviceInstance, volumeGroup);                
56         }
57 }