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.onap.so.client.orchestration;
24 import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
25 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
26 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
27 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
28 import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
29 import org.onap.so.client.exception.BadResponseException;
30 import org.onap.so.client.exception.MapperException;
31 import org.onap.so.client.sdnc.SDNCClient;
32 import org.onap.so.client.sdnc.beans.SDNCSvcAction;
33 import org.onap.so.client.sdnc.endpoint.SDNCTopology;
34 import org.onap.so.client.sdnc.mapper.GCTopologyOperationRequestMapper;
35 import org.springframework.beans.factory.annotation.Autowired;
36 import org.springframework.stereotype.Component;
38 import org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation;
39 import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
42 public class SDNCConfigurationResources {
44 private GCTopologyOperationRequestMapper sdncRM;
47 * SDN-C call to assign configuration after it was created in A&AI
49 * @param serviceInstance
50 * @param requestContext
51 * @param vnrConfiguration
54 * @throws MapperException
55 * @throws BadResponseException
57 public GenericResourceApiGcTopologyOperationInformation assignVnrConfiguration(ServiceInstance serviceInstance,
58 RequestContext requestContext, Customer customer, Configuration vnrConfiguration, GenericVnf voiceVnf,
59 String sdncRequestId, URI callbackUri) throws MapperException, BadResponseException {
60 return sdncRM.assignOrActivateVnrReqMapper(SDNCSvcAction.ASSIGN,
61 GenericResourceApiRequestActionEnumeration.CREATEGENERICCONFIGURATIONINSTANCE, serviceInstance,
62 requestContext, customer, vnrConfiguration, voiceVnf, sdncRequestId, callbackUri);
66 * SDNC Call to Activate VNR Configuration
68 * @param serviceInstance
69 * @param requestContext
70 * @param vnrConfiguration
73 * @throws MapperException
74 * @throws BadResponseException
76 public GenericResourceApiGcTopologyOperationInformation activateVnrConfiguration(ServiceInstance serviceInstance,
77 RequestContext requestContext, Customer customer, Configuration vnrConfiguration, GenericVnf voiceVnf,
78 String sdncRequestId, URI callbackUri) throws MapperException, BadResponseException {
79 return sdncRM.assignOrActivateVnrReqMapper(SDNCSvcAction.ACTIVATE,
80 GenericResourceApiRequestActionEnumeration.CREATEGENERICCONFIGURATIONINSTANCE, serviceInstance,
81 requestContext, customer, vnrConfiguration, voiceVnf, sdncRequestId, callbackUri);
85 * method to unAssign Vnr Configuration in SDNC
87 * @param serviceInstance
88 * @param requestContext
89 * @param vnrConfiguration
91 * @throws BadResponseException
92 * @throws MapperException
94 public GenericResourceApiGcTopologyOperationInformation unAssignVnrConfiguration(ServiceInstance serviceInstance,
95 RequestContext requestContext, Configuration vnrConfiguration, String sdncRequestId, URI callbackUri)
96 throws BadResponseException, MapperException {
97 return sdncRM.deactivateOrUnassignVnrReqMapper(SDNCSvcAction.UNASSIGN, serviceInstance, requestContext,
98 vnrConfiguration, sdncRequestId, callbackUri);
102 * Deactivate VNR SDNC Call
104 * @param serviceInstance
105 * @param requestContext
106 * @param vnrConfiguration
107 * @throws BadResponseException
108 * @throws MapperException
110 public GenericResourceApiGcTopologyOperationInformation deactivateVnrConfiguration(ServiceInstance serviceInstance,
111 RequestContext requestContext, Configuration vnrConfiguration, String sdncRequestId, URI callbackUri)
112 throws BadResponseException, MapperException {
113 return sdncRM.deactivateOrUnassignVnrReqMapper(SDNCSvcAction.DEACTIVATE, serviceInstance, requestContext,
114 vnrConfiguration, sdncRequestId, callbackUri);