2  * ============LICENSE_START=======================================================
 
   4  * ================================================================================
 
   5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 
   6  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
 
   7  * ================================================================================
 
   8  * Modifications Copyright (C) 2018 IBM.
 
   9  * Modifications Copyright (c) 2019 Samsung
 
  10  * ================================================================================
 
  11  * Licensed under the Apache License, Version 2.0 (the "License");
 
  12  * you may not use this file except in compliance with the License.
 
  13  * You may obtain a copy of the License at
 
  15  *      http://www.apache.org/licenses/LICENSE-2.0
 
  17  * Unless required by applicable law or agreed to in writing, software
 
  18  * distributed under the License is distributed on an "AS IS" BASIS,
 
  19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  20  * See the License for the specific language governing permissions and
 
  21  * limitations under the License.
 
  22  * ============LICENSE_END=========================================================
 
  25 package org.onap.so.adapters.network;
 
  28 import java.net.MalformedURLException;
 
  30 import java.security.GeneralSecurityException;
 
  31 import java.util.Collections;
 
  32 import java.util.HashMap;
 
  33 import java.util.List;
 
  35 import javax.jws.WebService;
 
  36 import javax.xml.bind.DatatypeConverter;
 
  37 import javax.xml.namespace.QName;
 
  38 import javax.xml.ws.BindingProvider;
 
  39 import javax.xml.ws.Holder;
 
  40 import javax.xml.ws.handler.MessageContext;
 
  41 import org.onap.so.adapters.network.async.client.CreateNetworkNotification;
 
  42 import org.onap.so.adapters.network.async.client.MsoExceptionCategory;
 
  43 import org.onap.so.adapters.network.async.client.NetworkAdapterNotify;
 
  44 import org.onap.so.adapters.network.async.client.NetworkAdapterNotify_Service;
 
  45 import org.onap.so.adapters.network.async.client.QueryNetworkNotification;
 
  46 import org.onap.so.adapters.network.async.client.UpdateNetworkNotification;
 
  47 import org.onap.so.adapters.network.exceptions.NetworkException;
 
  48 import org.onap.so.entity.MsoRequest;
 
  49 import org.onap.logging.filter.base.ErrorCode;
 
  50 import org.onap.so.logger.LoggingAnchor;
 
  51 import org.onap.so.logger.MessageEnum;
 
  52 import org.onap.so.openstack.beans.NetworkRollback;
 
  53 import org.onap.so.openstack.beans.NetworkStatus;
 
  54 import org.onap.so.openstack.beans.Subnet;
 
  55 import org.onap.so.utils.CryptoUtils;
 
  56 import org.slf4j.Logger;
 
  57 import org.slf4j.LoggerFactory;
 
  58 import org.springframework.beans.factory.annotation.Autowired;
 
  59 import org.springframework.core.env.Environment;
 
  60 import org.springframework.stereotype.Component;
 
  63 @WebService(serviceName = "NetworkAdapterAsync",
 
  64         endpointInterface = "org.onap.so.adapters.network.MsoNetworkAdapterAsync",
 
  65         targetNamespace = "http://org.onap.so/networkA")
 
  66 public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
 
  68     private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterAsyncImpl.class);
 
  70     private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.network.bpelauth";
 
  71     private static final String ENCRYPTION_KEY_PROP = "mso.msoKey";
 
  72     private static final String NETWORK_EXCEPTION_MSG = "Got a NetworkException on createNetwork: ";
 
  73     private static final String CREATE_NETWORK_ERROR_LOGMSG = "{} {} Error sending createNetwork notification {} ";
 
  74     private static final String FAULT_INFO_ERROR_LOGMSG = "{} {} Exception - fault info ";
 
  75     private static final String SHARED = "shared";
 
  76     private static final String EXTERNAL = "external";
 
  79     private Environment environment;
 
  82     private MsoNetworkAdapter networkAdapter;
 
  85      * Health Check web method. Does nothing but return to show the adapter is deployed.
 
  88     public void healthCheckA() {
 
  89         logger.debug("Health check call in Network Adapter");
 
  93      * This is the "Create Network" web service implementation. It will create a new Network of the requested type in
 
  94      * the specified cloud and tenant. The tenant must exist at the time this service is called.
 
  96      * If a network with the same name already exists, this can be considered a success or failure, depending on the
 
  97      * value of the 'failIfExists' parameter.
 
  99      * There will be a pre-defined set of network types defined in the MSO Catalog. All such networks will have a
 
 100      * similar configuration, based on the allowable Openstack networking definitions. This includes basic networks,
 
 101      * provider networks (with a single VLAN), and multi-provider networks (one or more VLANs)
 
 103      * Initially, all provider networks must be "vlan" type, and multiple segments in a multi-provider network must be
 
 104      * multiple VLANs on the same physical network.
 
 106      * This service supports two modes of Network creation/update: - via Heat Templates - via Neutron API The network
 
 107      * orchestration mode for each network type is declared in its catalog definition. All Heat-based templates must
 
 108      * support some subset of the same input parameters: network_name, physical_network, vlan(s).
 
 110      * The method returns the network ID and a NetworkRollback object. This latter object can be passed as-is to the
 
 111      * rollbackNetwork operation to undo everything that was created. This is useful if a network is successfully
 
 112      * created but the orchestration fails on a subsequent operation.
 
 115     public void createNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
 
 116             String networkName, String physicalNetworkName, List<Integer> vlans, Boolean failIfExists, Boolean backout,
 
 117             List<Subnet> subnets, Map<String, String> networkParams, String messageId, MsoRequest msoRequest,
 
 118             String notificationUrl) {
 
 120         logger.debug("Async Create Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId);
 
 122         // Use the synchronous method to perform the actual Create
 
 125         // Synchronous Web Service Outputs
 
 126         Holder<String> networkId = new Holder<>();
 
 127         Holder<String> neutronNetworkId = new Holder<>();
 
 128         Holder<NetworkRollback> networkRollback = new Holder<>();
 
 129         Holder<Map<String, String>> subnetIdMap = new Holder<>();
 
 131         HashMap<String, String> params = (HashMap<String, String>) networkParams;
 
 133             params = new HashMap<>();
 
 134         String shared = null;
 
 135         String external = null;
 
 136         if (params.containsKey(SHARED))
 
 137             shared = params.get(SHARED);
 
 138         if (params.containsKey(EXTERNAL))
 
 139             external = params.get(EXTERNAL);
 
 142             networkAdapter.createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName,
 
 143                     physicalNetworkName, vlans, shared, external, failIfExists, backout, subnets, params, msoRequest,
 
 144                     networkId, neutronNetworkId, subnetIdMap, networkRollback);
 
 145         } catch (NetworkException e) {
 
 146             logger.debug(NETWORK_EXCEPTION_MSG, e);
 
 147             MsoExceptionCategory exCat = null;
 
 150                 eMsg = e.getFaultInfo().getMessage();
 
 151                 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
 
 152             } catch (Exception e1) {
 
 153                 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
 
 156             // Build and send Asynchronous error response
 
 158                 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
 
 159                 notifyPort.createNetworkNotification(messageId, false, exCat, eMsg, null, null, null, null);
 
 160             } catch (Exception e1) {
 
 161                 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
 
 162                         ErrorCode.DataError.getValue(), e1.getMessage(), e1);
 
 167         logger.debug("Async Create Network:Name {} physicalNetworkName:{}", networkName, physicalNetworkName);
 
 168         // Build and send Asynchronous response
 
 170             NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
 
 171             notifyPort.createNetworkNotification(messageId, true, null, null, networkId.value, neutronNetworkId.value,
 
 172                     copyCreateSubnetIdMap(subnetIdMap), copyNrb(networkRollback));
 
 173         } catch (Exception e) {
 
 174             logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
 
 175                     ErrorCode.DataError.getValue(), e.getMessage(), e);
 
 182      * This is the "Update Network" web service implementation. It will update an existing Network of the requested type
 
 183      * in the specified cloud and tenant. The typical use will be to replace the VLANs with the supplied list (to add or
 
 184      * remove a VLAN), but other properties may be updated as well.
 
 186      * There will be a pre-defined set of network types defined in the MSO Catalog. All such networks will have a
 
 187      * similar configuration, based on the allowable Openstack networking definitions. This includes basic networks,
 
 188      * provider networks (with a single VLAN), and multi-provider networks (one or more VLANs).
 
 190      * Initially, all provider networks must currently be "vlan" type, and multi-provider networks must be multiple
 
 191      * VLANs on the same physical network.
 
 193      * This service supports two modes of Network update: - via Heat Templates - via Neutron API The network
 
 194      * orchestration mode for each network type is declared in its catalog definition. All Heat-based templates must
 
 195      * support some subset of the same input parameters: network_name, physical_network, vlan, segments.
 
 197      * The method returns a NetworkRollback object. This object can be passed as-is to the rollbackNetwork operation to
 
 198      * undo everything that was updated. This is useful if a network is successfully updated but orchestration fails on
 
 199      * a subsequent operation.
 
 202     public void updateNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
 
 203             String networkId, String networkName, String physicalNetworkName, List<Integer> vlans, List<Subnet> subnets,
 
 204             Map<String, String> networkParams, String messageId, MsoRequest msoRequest, String notificationUrl) {
 
 206         logger.debug("Async Update Network: {} of type {} in {}/{}", networkId, networkType, cloudSiteId, tenantId);
 
 208         // Use the synchronous method to perform the actual Create
 
 211         // Synchronous Web Service Outputs
 
 212         Holder<NetworkRollback> networkRollback = new Holder<>();
 
 213         Holder<Map<String, String>> subnetIdMap = new Holder<>();
 
 215         HashMap<String, String> params = (HashMap<String, String>) networkParams;
 
 217             params = new HashMap<>();
 
 218         String shared = null;
 
 219         String external = null;
 
 220         if (params.containsKey(SHARED))
 
 221             shared = params.get(SHARED);
 
 222         if (params.containsKey(EXTERNAL))
 
 223             external = params.get(EXTERNAL);
 
 226             networkAdapter.updateNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId,
 
 227                     networkName, physicalNetworkName, vlans, shared, external, subnets, params, msoRequest, subnetIdMap,
 
 229         } catch (NetworkException e) {
 
 230             logger.debug("Got a NetworkException on updateNetwork: ", e);
 
 231             MsoExceptionCategory exCat = null;
 
 234                 eMsg = e.getFaultInfo().getMessage();
 
 235                 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
 
 236             } catch (Exception e1) {
 
 237                 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
 
 240             // Build and send Asynchronous error response
 
 242                 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
 
 243                 notifyPort.updateNetworkNotification(messageId, false, exCat, eMsg, null, copyNrb(networkRollback));
 
 244             } catch (Exception e1) {
 
 245                 logger.error("{} {} Error sending updateNetwork notification {} ",
 
 246                         MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e1.getMessage(), e1);
 
 251         logger.debug("Async Update Network:Name {} NetworkId:{}", networkName, networkId);
 
 252         // Build and send Asynchronous response
 
 254             NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
 
 255             notifyPort.updateNetworkNotification(messageId, true, null, null, copyUpdateSubnetIdMap(subnetIdMap),
 
 256                     copyNrb(networkRollback));
 
 257         } catch (Exception e) {
 
 258             logger.error("{} {} Error sending updateNotification request {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
 
 259                     ErrorCode.DataError.getValue(), e.getMessage(), e);
 
 265      * This is the queryNetwork method. It returns the existence and status of the specified network, along with its
 
 266      * Neutron UUID and list of VLANs. This method attempts to find the network using both Heat and Neutron. Heat stacks
 
 267      * are first searched based on the provided network name/id. If none is found, the Neutron is directly queried.
 
 270     public void queryNetworkA(String cloudSiteId, String tenantId, String networkNameOrId, String messageId,
 
 271             MsoRequest msoRequest, String notificationUrl) {
 
 273         logger.debug("Async Query Network {} in {}/{}", networkNameOrId, cloudSiteId, tenantId);
 
 274         String errorCreateNetworkMessage = CREATE_NETWORK_ERROR_LOGMSG;
 
 276         // Use the synchronous method to perform the actual Create
 
 279         // Synchronous Web Service Outputs
 
 280         Holder<Boolean> networkExists = new Holder<>();
 
 281         Holder<String> networkId = new Holder<>();
 
 282         Holder<String> neutronNetworkId = new Holder<>();
 
 283         Holder<NetworkStatus> status = new Holder<>();
 
 284         Holder<List<Integer>> vlans = new Holder<>();
 
 285         Holder<Map<String, String>> subnetIdMap = new Holder<>();
 
 288             networkAdapter.queryNetwork(cloudSiteId, tenantId, networkNameOrId, msoRequest, networkExists, networkId,
 
 289                     neutronNetworkId, status, vlans, subnetIdMap);
 
 290         } catch (NetworkException e) {
 
 291             logger.debug(NETWORK_EXCEPTION_MSG, e);
 
 292             MsoExceptionCategory exCat = null;
 
 295                 eMsg = e.getFaultInfo().getMessage();
 
 296                 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
 
 297             } catch (Exception e1) {
 
 298                 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
 
 301             // Build and send Asynchronous error response
 
 303                 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
 
 304                 notifyPort.queryNetworkNotification(messageId, false, exCat, eMsg, null, null, null, null, null, null);
 
 305             } catch (Exception e1) {
 
 306                 logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
 
 307                         ErrorCode.DataError.getValue(), e1.getMessage(), e1);
 
 311         logger.debug("Async Query Network:NameOrId {} tenantId:{}", networkNameOrId, tenantId);
 
 312         // Build and send Asynchronous response
 
 314             NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
 
 315             org.onap.so.adapters.network.async.client.NetworkStatus networkS =
 
 316                     org.onap.so.adapters.network.async.client.NetworkStatus.fromValue(status.value.name());
 
 317             notifyPort.queryNetworkNotification(messageId, true, null, null, networkExists.value, networkId.value,
 
 318                     neutronNetworkId.value, networkS, vlans.value, copyQuerySubnetIdMap(subnetIdMap));
 
 319         } catch (Exception e) {
 
 320             logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
 
 321                     ErrorCode.DataError.getValue(), e.getMessage(), e);
 
 327      * This is the "Delete Network" web service implementation. It will delete a Network in the specified cloud and
 
 330      * If the network is not found, it is treated as a success.
 
 332      * This service supports two modes of Network creation/update/delete: - via Heat Templates - via Neutron API The
 
 333      * network orchestration mode for each network type is declared in its catalog definition.
 
 335      * For Heat-based orchestration, the networkId should be the stack ID. For Neutron-based orchestration, the
 
 336      * networkId should be the Neutron network UUID.
 
 338      * The method returns nothing on success. Rollback is not possible for delete commands, so any failure on delete
 
 339      * will require manual fallout in the client.
 
 342     public void deleteNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
 
 343             String networkId, String messageId, MsoRequest msoRequest, String notificationUrl) {
 
 345         String serviceName = "DeleteNetworkA";
 
 346         logger.debug("Async Delete Network {} in {}/{}", networkId, cloudSiteId, tenantId);
 
 348         // Use the synchronous method to perform the actual Create
 
 351         // Synchronous Web Service Outputs
 
 352         Holder<Boolean> networkDeleted = new Holder<>();
 
 355             networkAdapter.deleteNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId,
 
 356                     msoRequest, networkDeleted);
 
 357         } catch (NetworkException e) {
 
 358             logger.debug(NETWORK_EXCEPTION_MSG, e);
 
 359             MsoExceptionCategory exCat = null;
 
 362                 eMsg = e.getFaultInfo().getMessage();
 
 363                 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
 
 364             } catch (Exception e1) {
 
 365                 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
 
 368             // Build and send Asynchronous error response
 
 370                 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
 
 371                 notifyPort.deleteNetworkNotification(messageId, false, exCat, eMsg, null);
 
 372             } catch (Exception e1) {
 
 373                 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
 
 374                         ErrorCode.DataError.getValue(), e1.getMessage(), e1);
 
 379         logger.debug("Async Delete NetworkId: {} tenantId:{}", networkId, tenantId);
 
 380         // Build and send Asynchronous response
 
 382             NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
 
 383             notifyPort.deleteNetworkNotification(messageId, true, null, null, networkDeleted.value);
 
 384         } catch (Exception e) {
 
 385             logger.error("{} {} Error sending deleteNetwork notification {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
 
 386                     ErrorCode.DataError.getValue(), e.getMessage(), e);
 
 393      * This web service endpoint will rollback a previous Create VNF operation. A rollback object is returned to the
 
 394      * client in a successful creation response. The client can pass that object as-is back to the rollbackNetwork
 
 395      * operation to undo the creation.
 
 397      * The rollback includes removing the VNF and deleting the tenant if the tenant did not exist prior to the VNF
 
 401     public void rollbackNetworkA(NetworkRollback rollback, String messageId, String notificationUrl) {
 
 402         // rollback may be null (e.g. if network already existed when Create was called)
 
 403         if (rollback == null) {
 
 404             logger.warn("{} {} Rollback is null", MessageEnum.RA_ROLLBACK_NULL, ErrorCode.SchemaError.getValue());
 
 408         logger.info(LoggingAnchor.TWO, MessageEnum.RA_ASYNC_ROLLBACK, rollback.getNetworkStackId());
 
 409         // Use the synchronous method to perform the actual Create
 
 413             networkAdapter.rollbackNetwork(rollback);
 
 414         } catch (NetworkException e) {
 
 415             logger.debug("Got a NetworkException on rollbackNetwork: ", e);
 
 416             // Build and send Asynchronous error response
 
 417             MsoExceptionCategory exCat = null;
 
 420                 eMsg = e.getFaultInfo().getMessage();
 
 421                 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
 
 422             } catch (Exception e1) {
 
 423                 logger.error("{} {} Exception in get fault info ", MessageEnum.RA_FAULT_INFO_EXC,
 
 424                         ErrorCode.DataError.getValue(), e1);
 
 426             // Build and send Asynchronous error response
 
 428                 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
 
 429                 notifyPort.rollbackNetworkNotification(rollback.getMsoRequest().getRequestId(), false, exCat, eMsg);
 
 430             } catch (Exception e1) {
 
 431                 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
 
 432                         ErrorCode.DataError.getValue(), e1.getMessage(), e1);
 
 437         logger.debug("Async Rollback NetworkId: {} tenantId:{}", rollback.getNetworkStackId(), rollback.getTenantId());
 
 438         // Build and send Asynchronous response
 
 440             NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
 
 441             notifyPort.rollbackNetworkNotification(rollback.getMsoRequest().getRequestId(), true, null, null);
 
 442         } catch (Exception e) {
 
 443             logger.error("{} {} Error sending rollbackNetwork notification {} ",
 
 444                     MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e.getMessage(), e);
 
 450     private org.onap.so.adapters.network.async.client.NetworkRollback copyNrb(Holder<NetworkRollback> hNrb) {
 
 451         org.onap.so.adapters.network.async.client.NetworkRollback cnrb =
 
 452                 new org.onap.so.adapters.network.async.client.NetworkRollback();
 
 454         if (hNrb != null && hNrb.value != null) {
 
 455             org.onap.so.adapters.network.async.client.MsoRequest cmr =
 
 456                     new org.onap.so.adapters.network.async.client.MsoRequest();
 
 458             cnrb.setCloudId(hNrb.value.getCloudId());
 
 459             cmr.setRequestId(hNrb.value.getMsoRequest().getRequestId());
 
 460             cmr.setServiceInstanceId(hNrb.value.getMsoRequest().getServiceInstanceId());
 
 461             cnrb.setMsoRequest(cmr);
 
 462             cnrb.setNetworkId(hNrb.value.getNetworkId());
 
 463             cnrb.setNetworkStackId(hNrb.value.getNetworkStackId());
 
 464             cnrb.setNeutronNetworkId(hNrb.value.getNeutronNetworkId());
 
 465             cnrb.setTenantId(hNrb.value.getTenantId());
 
 466             cnrb.setNetworkType(hNrb.value.getNetworkType());
 
 467             cnrb.setNetworkCreated(hNrb.value.getNetworkCreated());
 
 468             cnrb.setNetworkName(hNrb.value.getNetworkName());
 
 469             cnrb.setPhysicalNetwork(hNrb.value.getPhysicalNetwork());
 
 470             List<Integer> vlansc = cnrb.getVlans();
 
 471             List<Integer> vlansh = hNrb.value.getVlans();
 
 472             if (vlansh != null) {
 
 473                 vlansc.addAll(vlansh);
 
 479     private NetworkAdapterNotify getNotifyEP(String notificationUrl) {
 
 481         URL warWsdlLoc = null;
 
 483             warWsdlLoc = Thread.currentThread().getContextClassLoader().getResource("NetworkAdapterNotify.wsdl");
 
 484         } catch (Exception e) {
 
 485             logger.error("{} {} Exception - WSDL not found ", MessageEnum.RA_WSDL_NOT_FOUND,
 
 486                     ErrorCode.DataError.getValue(), e);
 
 488         if (warWsdlLoc == null) {
 
 489             logger.error("{} {} WSDL not found", MessageEnum.RA_WSDL_NOT_FOUND, ErrorCode.DataError.getValue());
 
 492                 logger.debug("NetworkAdpaterNotify.wsdl location: {}", warWsdlLoc.toURI().toString());
 
 493             } catch (Exception e) {
 
 494                 logger.error("{} {} Exception - WSDL URL convention ", MessageEnum.RA_WSDL_URL_CONVENTION_EXC,
 
 495                         ErrorCode.SchemaError.getValue(), e);
 
 499         NetworkAdapterNotify_Service notifySvc = new NetworkAdapterNotify_Service(warWsdlLoc,
 
 500                 new QName("http://org.onap.so/networkNotify", "networkAdapterNotify"));
 
 502         NetworkAdapterNotify notifyPort = notifySvc.getMsoNetworkAdapterAsyncImplPort();
 
 504         BindingProvider bp = (BindingProvider) notifyPort;
 
 508             epUrl = new URL(notificationUrl);
 
 509         } catch (MalformedURLException e1) {
 
 510             logger.error("{} {} Exception - init notification ", MessageEnum.RA_INIT_NOTIF_EXC,
 
 511                     ErrorCode.DataError.getValue(), e1);
 
 515             logger.debug("Notification Endpoint URL: {}", epUrl.toExternalForm());
 
 516             bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, epUrl.toExternalForm());
 
 518             logger.debug("Notification Endpoint URL is NULL: ");
 
 523             Map<String, Object> reqCtx = bp.getRequestContext();
 
 524             Map<String, List<String>> headers = new HashMap<>();
 
 526             String userCredentials = this.getEncryptedProperty(BPEL_AUTH_PROP, "", ENCRYPTION_KEY_PROP);
 
 528             String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
 
 529             reqCtx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
 
 530             headers.put("Authorization", Collections.singletonList(basicAuth));
 
 531         } catch (Exception e) {
 
 532             logger.error("{} {} Unable to set authorization in callback request {} ",
 
 533                     MessageEnum.RA_SET_CALLBACK_AUTH_EXC, ErrorCode.DataError.getValue(), e.getMessage(), e);
 
 539     public String getEncryptedProperty(String key, String defaultValue, String encryptionKey) {
 
 541             return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey));
 
 542         } catch (GeneralSecurityException e) {
 
 543             logger.debug("Exception while decrypting property: {} ", this.environment.getProperty(key), e);
 
 549     private CreateNetworkNotification.SubnetIdMap copyCreateSubnetIdMap(Holder<Map<String, String>> hMap) {
 
 551         CreateNetworkNotification.SubnetIdMap subnetIdMap = new CreateNetworkNotification.SubnetIdMap();
 
 553         if (hMap != null && hMap.value != null) {
 
 554             Map<String, String> sMap = hMap.value;
 
 555             CreateNetworkNotification.SubnetIdMap.Entry entry = new CreateNetworkNotification.SubnetIdMap.Entry();
 
 557             for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
 
 558                 String key = mapEntry.getKey();
 
 559                 String value = mapEntry.getValue();
 
 561                 entry.setValue(value);
 
 562                 subnetIdMap.getEntry().add(entry);
 
 568     private UpdateNetworkNotification.SubnetIdMap copyUpdateSubnetIdMap(Holder<Map<String, String>> hMap) {
 
 570         UpdateNetworkNotification.SubnetIdMap subnetIdMap = new UpdateNetworkNotification.SubnetIdMap();
 
 572         if (hMap != null && hMap.value != null) {
 
 573             Map<String, String> sMap = hMap.value;
 
 574             UpdateNetworkNotification.SubnetIdMap.Entry entry = new UpdateNetworkNotification.SubnetIdMap.Entry();
 
 576             for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
 
 577                 String key = mapEntry.getKey();
 
 578                 String value = mapEntry.getValue();
 
 580                 entry.setValue(value);
 
 581                 subnetIdMap.getEntry().add(entry);
 
 587     private QueryNetworkNotification.SubnetIdMap copyQuerySubnetIdMap(Holder<Map<String, String>> hMap) {
 
 589         QueryNetworkNotification.SubnetIdMap subnetIdMap = new QueryNetworkNotification.SubnetIdMap();
 
 591         if (hMap != null && hMap.value != null) {
 
 592             Map<String, String> sMap = hMap.value;
 
 593             QueryNetworkNotification.SubnetIdMap.Entry entry = new QueryNetworkNotification.SubnetIdMap.Entry();
 
 595             for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
 
 596                 String key = mapEntry.getKey();
 
 597                 String value = mapEntry.getValue();
 
 599                 entry.setValue(value);
 
 600                 subnetIdMap.getEntry().add(entry);