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;
40 import org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation;
41 import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
44 public class SDNCConfigurationResources {
46 private GCTopologyOperationRequestMapper sdncRM;
49 * SDN-C call to assign configuration after it was created in A&AI
51 * @param serviceInstance
52 * @param requestContext
53 * @param vnrConfiguration
56 * @throws MapperException
57 * @throws BadResponseException
59 public GenericResourceApiGcTopologyOperationInformation assignVnrConfiguration(ServiceInstance serviceInstance,
60 RequestContext requestContext,
62 Configuration vnrConfiguration,
63 GenericVnf voiceVnf, String sdncRequestId, URI callbackUri)
64 throws MapperException, BadResponseException {
65 return sdncRM.assignOrActivateVnrReqMapper(
67 GenericResourceApiRequestActionEnumeration.CREATEGENERICCONFIGURATIONINSTANCE ,
68 serviceInstance , requestContext, customer, vnrConfiguration,voiceVnf,sdncRequestId,callbackUri);
72 * SDNC Call to Activate VNR Configuration
74 * @param serviceInstance
75 * @param requestContext
76 * @param vnrConfiguration
79 * @throws MapperException
80 * @throws BadResponseException
82 public GenericResourceApiGcTopologyOperationInformation activateVnrConfiguration(ServiceInstance serviceInstance,
83 RequestContext requestContext,
85 Configuration vnrConfiguration,
86 GenericVnf voiceVnf, String sdncRequestId, URI callbackUri)
87 throws MapperException, BadResponseException {
88 return sdncRM.assignOrActivateVnrReqMapper(
89 SDNCSvcAction.ACTIVATE,
90 GenericResourceApiRequestActionEnumeration.CREATEGENERICCONFIGURATIONINSTANCE,
91 serviceInstance , requestContext, customer, vnrConfiguration, voiceVnf,sdncRequestId,callbackUri);
95 * method to unAssign Vnr Configuration in SDNC
97 * @param serviceInstance
98 * @param requestContext
99 * @param vnrConfiguration
101 * @throws BadResponseException
102 * @throws MapperException
104 public GenericResourceApiGcTopologyOperationInformation unAssignVnrConfiguration(ServiceInstance serviceInstance, RequestContext requestContext,
105 Configuration vnrConfiguration, String sdncRequestId, URI callbackUri) throws BadResponseException, MapperException {
106 return sdncRM.deactivateOrUnassignVnrReqMapper
107 (SDNCSvcAction.UNASSIGN,serviceInstance, requestContext, vnrConfiguration,sdncRequestId,callbackUri);
111 * Deactivate VNR SDNC Call
112 * @param serviceInstance
113 * @param requestContext
114 * @param vnrConfiguration
115 * @throws BadResponseException
116 * @throws MapperException
118 public GenericResourceApiGcTopologyOperationInformation deactivateVnrConfiguration(ServiceInstance serviceInstance, RequestContext requestContext, Configuration vnrConfiguration, String sdncRequestId, URI callbackUri) throws BadResponseException, MapperException {
119 return sdncRM.deactivateOrUnassignVnrReqMapper(
120 SDNCSvcAction.DEACTIVATE,
121 serviceInstance , requestContext, vnrConfiguration,sdncRequestId,callbackUri);