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) 2019 Samsung
9 * ================================================================================
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 * ============LICENSE_END=========================================================
24 package org.onap.so.adapters.vnf;
27 import java.net.MalformedURLException;
29 import java.security.GeneralSecurityException;
30 import java.util.Collections;
31 import java.util.HashMap;
32 import java.util.List;
34 import javax.jws.WebService;
35 import javax.xml.bind.DatatypeConverter;
36 import javax.xml.namespace.QName;
37 import javax.xml.ws.BindingProvider;
38 import javax.xml.ws.Holder;
39 import javax.xml.ws.handler.MessageContext;
40 import org.onap.so.adapters.vnf.async.client.CreateVnfNotification;
41 import org.onap.so.adapters.vnf.async.client.QueryVnfNotification;
42 import org.onap.so.adapters.vnf.async.client.UpdateVnfNotification;
43 import org.onap.so.adapters.vnf.async.client.VnfAdapterNotify;
44 import org.onap.so.adapters.vnf.async.client.VnfAdapterNotify_Service;
45 import org.onap.so.adapters.vnf.exceptions.VnfException;
46 import org.onap.so.entity.MsoRequest;
47 import org.onap.so.logger.ErrorCode;
48 import org.onap.so.logger.MessageEnum;
49 import org.onap.so.openstack.beans.VnfRollback;
50 import org.onap.so.openstack.beans.VnfStatus;
51 import org.onap.so.utils.CryptoUtils;
52 import org.slf4j.Logger;
53 import org.slf4j.LoggerFactory;
54 import org.springframework.beans.factory.annotation.Autowired;
55 import org.springframework.core.env.Environment;
56 import org.springframework.stereotype.Component;
58 @WebService(serviceName = "VnfAdapterAsync", endpointInterface = "org.onap.so.adapters.vnf.MsoVnfAdapterAsync", targetNamespace = "http://org.onap.so/vnfA")
60 public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
62 private static final Logger logger = LoggerFactory.getLogger(MsoVnfAdapterAsyncImpl.class);
64 private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.vnf.bpelauth";
65 private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey";
68 private Environment environment;
71 private MsoVnfAdapterImpl vnfImpl;
74 * Health Check web method. Does nothing but return to show the adapter is deployed.
77 public void healthCheckA () {
78 logger.debug ("Health check call in VNF Adapter");
82 * This is the asynchronous "Create VNF" web service implementation.
83 * It will create a new VNF of the requested type in the specified cloud
84 * and tenant. The tenant must exist before this service is called.
86 * If a VNF with the same name already exists, this can be considered a
87 * success or failure, depending on the value of the 'failIfExists' parameter.
89 * All VNF types will be defined in the MSO catalog. The caller must request
90 * one of these pre-defined types or an error will be returned. Within the
91 * catalog, each VNF type references (among other things) a Heat template
92 * which is used to deploy the required VNF artifacts (VMs, networks, etc.)
95 * Depending on the Heat template, a variable set of input parameters will
96 * be defined, some of which are required. The caller is responsible to
97 * pass the necessary input data for the VNF or an error will be thrown.
99 * The method sends an asynchronous response to the notification URL when
100 * processing completes. The createAsyncResponse contains the vnfId (the
101 * canonical name of the stack), a Map of VNF output attributes, and a
102 * VnfRollback object. This last object can be passed as-is to the
103 * rollbackVnf operation to undo everything that was created for the VNF.
104 * This is useful if a VNF is successfully created but the orchestrator
105 * fails on a subsequent operation.
107 * Note: this method is implemented by calling the synchronous web method
108 * and translating the response to an asynchronous notification.
110 * @param cloudSiteId CLLI code of the cloud site in which to create the VNF
111 * @param tenantId Openstack tenant identifier
112 * @param vnfType VNF type key, should match a VNF definition in catalog DB
113 * @param vnfName Name to be assigned to the new VNF
114 * @param inputs Map of key=value inputs for VNF stack creation
115 * @param failIfExists Flag whether already existing VNF should be considered
116 * a success or failure
117 * @param msoRequest Request tracking information for logs
118 * @param notificationURL the target URL for asynchronous response
121 public void createVnfA (String cloudSiteId,
127 String volumeGroupHeatStackId,
128 Map <String, Object> inputs,
129 Boolean failIfExists,
131 Boolean enableBridge,
133 MsoRequest msoRequest,
134 String notificationUrl) {
136 logger.info("{} createVnfA", MessageEnum.RA_ASYNC_CREATE_VNF);
137 // Use the synchronous method to perform the actual Create
138 MsoVnfAdapter vnfAdapter = vnfImpl;
139 // Synchronous Web Service Outputs
140 Holder <String> vnfId = new Holder <> ();
141 Holder <Map <String, String>> outputs = new Holder <> ();
142 Holder <VnfRollback> vnfRollback = new Holder <> ();
145 vnfAdapter.createVnf (cloudSiteId,
151 volumeGroupHeatStackId,
160 } catch (VnfException e) {
161 logger.error("{} {} VnfException in createVnfA ", MessageEnum.RA_CREATE_VNF_ERR,
162 ErrorCode.BusinessProcesssError.getValue(), e);
163 org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
166 eMsg = e.getFaultInfo ().getMessage ();
167 exCat = org.onap.so.adapters.vnf.async.client.MsoExceptionCategory.fromValue (e.getFaultInfo ()
170 } catch (Exception e1) {
171 logger.error("{} {} Exception - Fault info ", MessageEnum.RA_FAULT_INFO_EXC,
172 ErrorCode.BusinessProcesssError.getValue(), e1);
174 // Build and send Asynchronous error response
176 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
177 notifyPort.createVnfNotification (messageId, false, exCat, eMsg, null, null, null);
178 } catch (Exception e1) {
179 logger.error("{} {} Exception sending createVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
180 ErrorCode.BusinessProcesssError.getValue(), e1);
182 logger.info("{}", MessageEnum.RA_ASYNC_CREATE_VNF_COMPLETE);
185 logger.debug("Async Create VNF: {} VnfId:{}", vnfName, vnfId.value);
186 // Build and send Asynchronous response
188 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
189 notifyPort.createVnfNotification (messageId,
194 copyCreateOutputs (outputs),
195 copyVrb (vnfRollback));
196 } catch (Exception e) {
197 logger.error("{} {} Exception sending createVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
198 ErrorCode.BusinessProcesssError.getValue(), e);
200 logger.info("{} createVnfA", MessageEnum.RA_ASYNC_CREATE_VNF_COMPLETE);
205 public void updateVnfA (String cloudSiteId,
211 String volumeGroupHeatStackId,
212 Map <String, Object> inputs,
214 MsoRequest msoRequest,
215 String notificationUrl) {
217 logger.info("{} UpdateVnfA", MessageEnum.RA_ASYNC_UPDATE_VNF);
219 // Use the synchronous method to perform the actual Create
220 MsoVnfAdapter vnfAdapter = vnfImpl;
222 // Synchronous Web Service Outputs
223 Holder <String> vnfId = new Holder <> ();
224 Holder <Map <String, String>> outputs = new Holder <> ();
225 Holder <VnfRollback> vnfRollback = new Holder <> ();
228 vnfAdapter.updateVnf (cloudSiteId, tenantId, vnfType,vnfVersion, vnfName, requestType, volumeGroupHeatStackId, inputs, msoRequest, outputs, vnfRollback);
229 } catch (VnfException e) {
230 logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_UPDATE_VNF_ERR,
231 ErrorCode.BusinessProcesssError.getValue(), e);
232 org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
235 eMsg = e.getFaultInfo ().getMessage ();
236 exCat = org.onap.so.adapters.vnf.async.client.MsoExceptionCategory.fromValue (e.getFaultInfo ()
239 } catch (Exception e1) {
240 logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
241 ErrorCode.BusinessProcesssError.getValue(), e1);
243 // Build and send Asynchronous error response
245 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
246 notifyPort.updateVnfNotification (messageId, false, exCat, eMsg, null, null);
247 } catch (Exception e1) {
248 logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
249 ErrorCode.BusinessProcesssError.getValue(), e1);
251 logger.info("{} UpdateVnfA", MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE);
254 logger.debug("Async Update VNF: {} VnfId:{}", vnfName, vnfId.value);
255 // Build and send Asynchronous response
257 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
258 notifyPort.updateVnfNotification (messageId,
262 copyUpdateOutputs (outputs),
263 copyVrb (vnfRollback));
264 } catch (Exception e) {
265 logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
266 ErrorCode.BusinessProcesssError.getValue(), e);
268 logger.info("{} UpdateVnfA", MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE);
273 * This is the "Query VNF" web service implementation.
274 * It will look up a VNF by name or ID in the specified cloud and tenant.
276 * The method returns an indicator that the VNF exists, its Openstack internal
277 * ID, its status, and the set of outputs (from when the stack was created).
279 * @param cloudSiteId CLLI code of the cloud site in which to query
280 * @param tenantId Openstack tenant identifier
281 * @param vnfName VNF Name or Openstack ID
282 * @param msoRequest Request tracking information for logs
283 * @param notificationURL the target URL for asynchronous response
286 public void queryVnfA (String cloudSiteId,
290 MsoRequest msoRequest,
291 String notificationUrl) {
293 String serviceName = "QueryVnfA";
294 logger.info("{}", MessageEnum.RA_ASYNC_QUERY_VNF);
296 // Use the synchronous method to perform the actual query
297 MsoVnfAdapter vnfAdapter = vnfImpl;
299 // Synchronous Web Service Outputs
300 Holder <Boolean> vnfExists = new Holder <> ();
301 Holder <String> vnfId = new Holder <> ();
302 Holder <VnfStatus> status = new Holder <> ();
303 Holder <Map <String, String>> outputs = new Holder <> ();
306 vnfAdapter.queryVnf (cloudSiteId, tenantId, vnfName, msoRequest, vnfExists, vnfId, status, outputs);
307 } catch (VnfException e) {
308 logger.error("{} {} Exception sending queryVnfA notification ", MessageEnum.RA_QUERY_VNF_ERR,
309 ErrorCode.BusinessProcesssError.getValue(), e);
310 org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
313 eMsg = e.getFaultInfo ().getMessage ();
314 exCat = org.onap.so.adapters.vnf.async.client.MsoExceptionCategory.fromValue (e.getFaultInfo ()
317 } catch (Exception e1) {
318 logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
319 ErrorCode.BusinessProcesssError.getValue(), e1);
321 // Build and send Asynchronous error response
323 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
324 notifyPort.queryVnfNotification (messageId, false, exCat, eMsg, null, null, null, null);
325 } catch (Exception e1) {
326 logger.error("{} {} Exception sending queryVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
327 ErrorCode.BusinessProcesssError.getValue(), e1);
329 logger.info("{} queryVnfA", MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE);
333 if (!vnfExists.value) {
334 logger.debug ("Async Query, VNF not found");
336 logger.debug("Async Query, VNF={}, status={}", vnfId.value, status.value);
338 // Build and send Asynchronous response
340 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
341 org.onap.so.adapters.vnf.async.client.VnfStatus vnfS = org.onap.so.adapters.vnf.async.client.VnfStatus.fromValue (status.value.name ());
342 notifyPort.queryVnfNotification (messageId,
349 copyQueryOutputs (outputs));
350 } catch (Exception e) {
351 logger.error("{} {} Exception sending queryVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
352 ErrorCode.BusinessProcesssError.getValue(), e);
355 logger.info("{} queryVnfA", MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE);
360 * This is the Asynchronous "Delete VNF" web service implementation.
361 * It will delete a VNF by name or ID in the specified cloud and tenant.
363 * The method has no outputs.
365 * @param cloudSiteId CLLI code of the cloud site in which to delete
366 * @param tenantId Openstack tenant identifier
367 * @param vnfName VNF Name or Openstack ID
368 * @param msoRequest Request tracking information for logs
369 * @param notificationURL the target URL for asynchronous response
372 public void deleteVnfA (String cloudSiteId,
376 MsoRequest msoRequest,
377 String notificationUrl) {
379 String serviceName = "DeleteVnfA";
380 logger.info("{}", MessageEnum.RA_ASYNC_DELETE_VNF);
382 // Use the synchronous method to perform the actual delete
383 MsoVnfAdapter vnfAdapter = vnfImpl;
386 vnfAdapter.deleteVnf (cloudSiteId, tenantId, vnfName, msoRequest);
387 } catch (VnfException e) {
388 logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_DELETE_VNF_ERR,
389 ErrorCode.BusinessProcesssError.getValue(), e);
390 org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
393 eMsg = e.getFaultInfo ().getMessage ();
394 exCat = org.onap.so.adapters.vnf.async.client.MsoExceptionCategory.fromValue (e.getFaultInfo ()
397 } catch (Exception e1) {
398 logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
399 ErrorCode.BusinessProcesssError.getValue(), e1);
401 // Build and send Asynchronous error response
403 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
404 notifyPort.deleteVnfNotification (messageId, false, exCat, eMsg);
405 } catch (Exception e1) {
406 logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
407 ErrorCode.BusinessProcesssError.getValue(), e1);
409 logger.info("{} deleteVnfA", MessageEnum.RA_ASYNC_DELETE_VNF_COMPLETE);
413 logger.debug("Async Delete VNF: {}", vnfName);
414 // Build and send Asynchronous response
416 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
417 notifyPort.deleteVnfNotification (messageId, true, null, null);
419 } catch (Exception e) {
420 logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
421 ErrorCode.BusinessProcesssError.getValue(), e);
424 logger.info("{} deleteVnfA", MessageEnum.RA_ASYNC_DELETE_VNF_COMPLETE);
429 * This web service endpoint will rollback a previous Create VNF operation.
430 * A rollback object is returned to the client in a successful creation
431 * response. The client can pass that object as-is back to the rollbackVnf
432 * operation to undo the creation.
435 public void rollbackVnfA (VnfRollback rollback, String messageId, String notificationUrl) {
436 // rollback may be null (e.g. if stack already existed when Create was called)
437 if (rollback == null) {
438 logger.info("{} rollbackVnfA: Empty Rollback: No action to perform", MessageEnum.RA_ROLLBACK_NULL);
442 logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF);
444 // Use the synchronous method to perform the actual rollback
445 MsoVnfAdapter vnfAdapter = vnfImpl;
448 vnfAdapter.rollbackVnf (rollback);
449 } catch (VnfException e) {
450 logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_ROLLBACK_VNF_ERR,
451 ErrorCode.BusinessProcesssError.getValue(), e);
452 org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
455 eMsg = e.getFaultInfo ().getMessage ();
456 exCat = org.onap.so.adapters.vnf.async.client.MsoExceptionCategory.fromValue (e.getFaultInfo ()
459 } catch (Exception e1) {
460 logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
461 ErrorCode.BusinessProcesssError.getValue(), e1);
463 // Build and send Asynchronous error response
465 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
466 notifyPort.rollbackVnfNotification (messageId, false, exCat, eMsg);
467 } catch (Exception e1) {
468 logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
469 ErrorCode.BusinessProcesssError.getValue(), e1);
471 logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE);
475 logger.debug ("Async Rollback VNF:" + rollback.getVnfId ());
476 // Build and send Asynchronous response
478 VnfAdapterNotify notifyPort = getNotifyEP (notificationUrl);
479 notifyPort.rollbackVnfNotification (messageId, true, null, null);
480 } catch (Exception e) {
481 logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
482 ErrorCode.BusinessProcesssError.getValue(), e);
485 logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE);
489 private org.onap.so.adapters.vnf.async.client.VnfRollback copyVrb (Holder <VnfRollback> hVrb) {
490 org.onap.so.adapters.vnf.async.client.VnfRollback cvrb = new org.onap.so.adapters.vnf.async.client.VnfRollback ();
492 if (hVrb != null && hVrb.value != null) {
493 org.onap.so.adapters.vnf.async.client.MsoRequest cmr = new org.onap.so.adapters.vnf.async.client.MsoRequest ();
495 cvrb.setCloudSiteId (hVrb.value.getCloudSiteId ());
496 if (hVrb.value.getMsoRequest() != null) {
497 cmr.setRequestId (hVrb.value.getMsoRequest ().getRequestId ());
498 cmr.setServiceInstanceId (hVrb.value.getMsoRequest ().getServiceInstanceId ());
500 cmr.setRequestId (null);
501 cmr.setServiceInstanceId (null);
503 cvrb.setMsoRequest (cmr);
504 cvrb.setVnfId (hVrb.value.getVnfId ());
505 cvrb.setTenantId (hVrb.value.getTenantId ());
506 cvrb.setTenantCreated (hVrb.value.getTenantCreated ());
507 cvrb.setVnfCreated (hVrb.value.getVnfCreated ());
512 private CreateVnfNotification.Outputs copyCreateOutputs (Holder <Map <String, String>> hMap) {
514 CreateVnfNotification.Outputs outputs = new CreateVnfNotification.Outputs ();
516 if (hMap != null && hMap.value != null) {
517 Map <String, String> sMap = new HashMap <> ();
519 CreateVnfNotification.Outputs.Entry entry = new CreateVnfNotification.Outputs.Entry ();
521 for (String key : sMap.keySet ()) {
523 entry.setValue (sMap.get (key));
524 outputs.getEntry ().add (entry);
530 private UpdateVnfNotification.Outputs copyUpdateOutputs (Holder <Map <String, String>> hMap) {
532 UpdateVnfNotification.Outputs outputs = new UpdateVnfNotification.Outputs ();
534 if (hMap != null && hMap.value != null) {
535 Map <String, String> sMap = new HashMap <> ();
537 UpdateVnfNotification.Outputs.Entry entry = new UpdateVnfNotification.Outputs.Entry ();
539 for (Map.Entry<String,String> mapEntry : sMap.entrySet ()) {
540 String key = mapEntry.getKey();
541 String value = mapEntry.getValue();
543 entry.setValue (value);
544 outputs.getEntry ().add (entry);
550 private QueryVnfNotification.Outputs copyQueryOutputs (Holder <Map <String, String>> hMap) {
552 QueryVnfNotification.Outputs outputs = new QueryVnfNotification.Outputs ();
554 if (hMap != null && hMap.value != null) {
555 Map <String, String> sMap = new HashMap <> ();
558 QueryVnfNotification.Outputs.Entry entry = new QueryVnfNotification.Outputs.Entry ();
560 for (Map.Entry<String,String> mapEntry : sMap.entrySet ()) {
561 String key = mapEntry.getKey();
562 String value = mapEntry.getValue();
564 entry.setValue (value);
565 outputs.getEntry ().add (entry);
571 private VnfAdapterNotify getNotifyEP (String notificationUrl) {
573 URL warWsdlLoc = null;
575 warWsdlLoc = Thread.currentThread ().getContextClassLoader ().getResource ("VnfAdapterNotify.wsdl");
576 } catch (Exception e) {
577 logger.error("{} {} Exception - WSDL not found ", MessageEnum.RA_WSDL_NOT_FOUND,
578 ErrorCode.BusinessProcesssError.getValue(), e);
580 if (warWsdlLoc == null) {
581 logger.error("{} {} WSDL not found", MessageEnum.RA_WSDL_NOT_FOUND,
582 ErrorCode.BusinessProcesssError.getValue());
585 logger.debug("VnfAdpaterNotify.wsdl location:{}", warWsdlLoc.toURI().toString());
586 } catch (Exception e) {
587 logger.error("{} {} Exception - WSDL URL convention ", MessageEnum.RA_WSDL_URL_CONVENTION_EXC,
588 ErrorCode.BusinessProcesssError.getValue(), e);
592 VnfAdapterNotify_Service notifySvc = new VnfAdapterNotify_Service (warWsdlLoc,
593 new QName ("http://org.onap.so/vnfNotify",
594 "vnfAdapterNotify"));
596 VnfAdapterNotify notifyPort = notifySvc.getMsoVnfAdapterAsyncImplPort ();
598 BindingProvider bp = (BindingProvider) notifyPort;
602 epUrl = new URL (notificationUrl);
603 } catch (MalformedURLException e1) {
604 logger.error("{} {} MalformedURLException ", MessageEnum.RA_INIT_NOTIF_EXC,
605 ErrorCode.BusinessProcesssError.getValue(), e1);
609 logger.debug("Notification Endpoint URL: {}", epUrl.toExternalForm());
610 bp.getRequestContext ().put (BindingProvider.ENDPOINT_ADDRESS_PROPERTY, epUrl.toExternalForm ());
613 logger.debug ("epUrl is NULL:");
618 Map <String, Object> reqCtx = bp.getRequestContext ();
619 Map <String, List <String>> headers = new HashMap <> ();
621 String userCredentials = this.getEncryptedProperty(BPEL_AUTH_PROP, "", ENCRYPTION_KEY_PROP);
623 String basicAuth = "Basic " + DatatypeConverter.printBase64Binary (userCredentials.getBytes ());
624 reqCtx.put (MessageContext.HTTP_REQUEST_HEADERS, headers);
625 headers.put ("Authorization", Collections.singletonList (basicAuth));
626 } catch (Exception e) {
627 logger.error("{} {} Exception - Unable to set authorization in callback request ",
628 MessageEnum.RA_SET_CALLBACK_AUTH_EXC, ErrorCode.BusinessProcesssError.getValue(), e);
634 public String getEncryptedProperty(String key, String defaultValue, String encryptionKey) {
636 return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey));
637 } catch (GeneralSecurityException e) {
638 logger.debug("Exception while decrypting property: {} ", this.environment.getProperty(key), e);