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.so.logger.ErrorCode;
50 import org.onap.so.logger.MessageEnum;
51 import org.onap.so.openstack.beans.NetworkRollback;
52 import org.onap.so.openstack.beans.NetworkStatus;
53 import org.onap.so.openstack.beans.Subnet;
54 import org.onap.so.utils.CryptoUtils;
55 import org.slf4j.Logger;
56 import org.slf4j.LoggerFactory;
57 import org.springframework.beans.factory.annotation.Autowired;
58 import org.springframework.core.env.Environment;
59 import org.springframework.stereotype.Component;
62 @WebService(serviceName = "NetworkAdapterAsync",
63 endpointInterface = "org.onap.so.adapters.network.MsoNetworkAdapterAsync",
64 targetNamespace = "http://org.onap.so/networkA")
65 public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
67 private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterAsyncImpl.class);
69 private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.network.bpelauth";
70 private static final String ENCRYPTION_KEY_PROP = "mso.msoKey";
71 private static final String NETWORK_EXCEPTION_MSG = "Got a NetworkException on createNetwork: ";
72 private static final String CREATE_NETWORK_ERROR_LOGMSG = "{} {} Error sending createNetwork notification {} ";
73 private static final String FAULT_INFO_ERROR_LOGMSG = "{} {} Exception - fault info ";
74 private static final String SHARED = "shared";
75 private static final String EXTERNAL = "external";
78 private Environment environment;
81 private MsoNetworkAdapter networkAdapter;
84 * Health Check web method. Does nothing but return to show the adapter is deployed.
87 public void healthCheckA() {
88 logger.debug("Health check call in Network Adapter");
92 * This is the "Create Network" web service implementation. It will create a new Network of the requested type in
93 * the specified cloud and tenant. The tenant must exist at the time this service is called.
95 * If a network with the same name already exists, this can be considered a success or failure, depending on the
96 * value of the 'failIfExists' parameter.
98 * There will be a pre-defined set of network types defined in the MSO Catalog. All such networks will have a
99 * similar configuration, based on the allowable Openstack networking definitions. This includes basic networks,
100 * provider networks (with a single VLAN), and multi-provider networks (one or more VLANs)
102 * Initially, all provider networks must be "vlan" type, and multiple segments in a multi-provider network must be
103 * multiple VLANs on the same physical network.
105 * This service supports two modes of Network creation/update: - via Heat Templates - via Neutron API The network
106 * orchestration mode for each network type is declared in its catalog definition. All Heat-based templates must
107 * support some subset of the same input parameters: network_name, physical_network, vlan(s).
109 * The method returns the network ID and a NetworkRollback object. This latter object can be passed as-is to the
110 * rollbackNetwork operation to undo everything that was created. This is useful if a network is successfully
111 * created but the orchestration fails on a subsequent operation.
114 public void createNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
115 String networkName, String physicalNetworkName, List<Integer> vlans, Boolean failIfExists, Boolean backout,
116 List<Subnet> subnets, Map<String, String> networkParams, String messageId, MsoRequest msoRequest,
117 String notificationUrl) {
119 logger.debug("Async Create Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId);
121 // Use the synchronous method to perform the actual Create
124 // Synchronous Web Service Outputs
125 Holder<String> networkId = new Holder<>();
126 Holder<String> neutronNetworkId = new Holder<>();
127 Holder<NetworkRollback> networkRollback = new Holder<>();
128 Holder<Map<String, String>> subnetIdMap = new Holder<>();
130 HashMap<String, String> params = (HashMap<String, String>) networkParams;
132 params = new HashMap<>();
133 String shared = null;
134 String external = null;
135 if (params.containsKey(SHARED))
136 shared = params.get(SHARED);
137 if (params.containsKey(EXTERNAL))
138 external = params.get(EXTERNAL);
141 networkAdapter.createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName,
142 physicalNetworkName, vlans, shared, external, failIfExists, backout, subnets, params, msoRequest,
143 networkId, neutronNetworkId, subnetIdMap, networkRollback);
144 } catch (NetworkException e) {
145 logger.debug(NETWORK_EXCEPTION_MSG, e);
146 MsoExceptionCategory exCat = null;
149 eMsg = e.getFaultInfo().getMessage();
150 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
151 } catch (Exception e1) {
152 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
155 // Build and send Asynchronous error response
157 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
158 notifyPort.createNetworkNotification(messageId, false, exCat, eMsg, null, null, null, null);
159 } catch (Exception e1) {
160 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
161 ErrorCode.DataError.getValue(), e1.getMessage(), e1);
166 logger.debug("Async Create Network:Name {} physicalNetworkName:{}", networkName, physicalNetworkName);
167 // Build and send Asynchronous response
169 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
170 notifyPort.createNetworkNotification(messageId, true, null, null, networkId.value, neutronNetworkId.value,
171 copyCreateSubnetIdMap(subnetIdMap), copyNrb(networkRollback));
172 } catch (Exception e) {
173 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
174 ErrorCode.DataError.getValue(), e.getMessage(), e);
181 * This is the "Update Network" web service implementation. It will update an existing Network of the requested type
182 * in the specified cloud and tenant. The typical use will be to replace the VLANs with the supplied list (to add or
183 * remove a VLAN), but other properties may be updated as well.
185 * There will be a pre-defined set of network types defined in the MSO Catalog. All such networks will have a
186 * similar configuration, based on the allowable Openstack networking definitions. This includes basic networks,
187 * provider networks (with a single VLAN), and multi-provider networks (one or more VLANs).
189 * Initially, all provider networks must currently be "vlan" type, and multi-provider networks must be multiple
190 * VLANs on the same physical network.
192 * This service supports two modes of Network update: - via Heat Templates - via Neutron API The network
193 * orchestration mode for each network type is declared in its catalog definition. All Heat-based templates must
194 * support some subset of the same input parameters: network_name, physical_network, vlan, segments.
196 * The method returns a NetworkRollback object. This object can be passed as-is to the rollbackNetwork operation to
197 * undo everything that was updated. This is useful if a network is successfully updated but orchestration fails on
198 * a subsequent operation.
201 public void updateNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
202 String networkId, String networkName, String physicalNetworkName, List<Integer> vlans, List<Subnet> subnets,
203 Map<String, String> networkParams, String messageId, MsoRequest msoRequest, String notificationUrl) {
205 logger.debug("Async Update Network: {} of type {} in {}/{}", networkId, networkType, cloudSiteId, tenantId);
207 // Use the synchronous method to perform the actual Create
210 // Synchronous Web Service Outputs
211 Holder<NetworkRollback> networkRollback = new Holder<>();
212 Holder<Map<String, String>> subnetIdMap = new Holder<>();
214 HashMap<String, String> params = (HashMap<String, String>) networkParams;
216 params = new HashMap<>();
217 String shared = null;
218 String external = null;
219 if (params.containsKey(SHARED))
220 shared = params.get(SHARED);
221 if (params.containsKey(EXTERNAL))
222 external = params.get(EXTERNAL);
225 networkAdapter.updateNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId,
226 networkName, physicalNetworkName, vlans, shared, external, subnets, params, msoRequest, subnetIdMap,
228 } catch (NetworkException e) {
229 logger.debug("Got a NetworkException on updateNetwork: ", e);
230 MsoExceptionCategory exCat = null;
233 eMsg = e.getFaultInfo().getMessage();
234 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
235 } catch (Exception e1) {
236 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
239 // Build and send Asynchronous error response
241 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
242 notifyPort.updateNetworkNotification(messageId, false, exCat, eMsg, null, copyNrb(networkRollback));
243 } catch (Exception e1) {
244 logger.error("{} {} Error sending updateNetwork notification {} ",
245 MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e1.getMessage(), e1);
250 logger.debug("Async Update Network:Name {} NetworkId:{}", networkName, networkId);
251 // Build and send Asynchronous response
253 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
254 notifyPort.updateNetworkNotification(messageId, true, null, null, copyUpdateSubnetIdMap(subnetIdMap),
255 copyNrb(networkRollback));
256 } catch (Exception e) {
257 logger.error("{} {} Error sending updateNotification request {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
258 ErrorCode.DataError.getValue(), e.getMessage(), e);
264 * This is the queryNetwork method. It returns the existence and status of the specified network, along with its
265 * Neutron UUID and list of VLANs. This method attempts to find the network using both Heat and Neutron. Heat stacks
266 * are first searched based on the provided network name/id. If none is found, the Neutron is directly queried.
269 public void queryNetworkA(String cloudSiteId, String tenantId, String networkNameOrId, String messageId,
270 MsoRequest msoRequest, String notificationUrl) {
272 logger.debug("Async Query Network {} in {}/{}", networkNameOrId, cloudSiteId, tenantId);
273 String errorCreateNetworkMessage = CREATE_NETWORK_ERROR_LOGMSG;
275 // Use the synchronous method to perform the actual Create
278 // Synchronous Web Service Outputs
279 Holder<Boolean> networkExists = new Holder<>();
280 Holder<String> networkId = new Holder<>();
281 Holder<String> neutronNetworkId = new Holder<>();
282 Holder<NetworkStatus> status = new Holder<>();
283 Holder<List<Integer>> vlans = new Holder<>();
284 Holder<Map<String, String>> subnetIdMap = new Holder<>();
287 networkAdapter.queryNetwork(cloudSiteId, tenantId, networkNameOrId, msoRequest, networkExists, networkId,
288 neutronNetworkId, status, vlans, subnetIdMap);
289 } catch (NetworkException e) {
290 logger.debug(NETWORK_EXCEPTION_MSG, e);
291 MsoExceptionCategory exCat = null;
294 eMsg = e.getFaultInfo().getMessage();
295 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
296 } catch (Exception e1) {
297 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
300 // Build and send Asynchronous error response
302 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
303 notifyPort.queryNetworkNotification(messageId, false, exCat, eMsg, null, null, null, null, null, null);
304 } catch (Exception e1) {
305 logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
306 ErrorCode.DataError.getValue(), e1.getMessage(), e1);
310 logger.debug("Async Query Network:NameOrId {} tenantId:{}", networkNameOrId, tenantId);
311 // Build and send Asynchronous response
313 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
314 org.onap.so.adapters.network.async.client.NetworkStatus networkS =
315 org.onap.so.adapters.network.async.client.NetworkStatus.fromValue(status.value.name());
316 notifyPort.queryNetworkNotification(messageId, true, null, null, networkExists.value, networkId.value,
317 neutronNetworkId.value, networkS, vlans.value, copyQuerySubnetIdMap(subnetIdMap));
318 } catch (Exception e) {
319 logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
320 ErrorCode.DataError.getValue(), e.getMessage(), e);
326 * This is the "Delete Network" web service implementation. It will delete a Network in the specified cloud and
329 * If the network is not found, it is treated as a success.
331 * This service supports two modes of Network creation/update/delete: - via Heat Templates - via Neutron API The
332 * network orchestration mode for each network type is declared in its catalog definition.
334 * For Heat-based orchestration, the networkId should be the stack ID. For Neutron-based orchestration, the
335 * networkId should be the Neutron network UUID.
337 * The method returns nothing on success. Rollback is not possible for delete commands, so any failure on delete
338 * will require manual fallout in the client.
341 public void deleteNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
342 String networkId, String messageId, MsoRequest msoRequest, String notificationUrl) {
344 String serviceName = "DeleteNetworkA";
345 logger.debug("Async Delete Network {} in {}/{}", networkId, cloudSiteId, tenantId);
347 // Use the synchronous method to perform the actual Create
350 // Synchronous Web Service Outputs
351 Holder<Boolean> networkDeleted = new Holder<>();
354 networkAdapter.deleteNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId,
355 msoRequest, networkDeleted);
356 } catch (NetworkException e) {
357 logger.debug(NETWORK_EXCEPTION_MSG, e);
358 MsoExceptionCategory exCat = null;
361 eMsg = e.getFaultInfo().getMessage();
362 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
363 } catch (Exception e1) {
364 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
367 // Build and send Asynchronous error response
369 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
370 notifyPort.deleteNetworkNotification(messageId, false, exCat, eMsg, null);
371 } catch (Exception e1) {
372 logger.error("{} {} Error sending createNetwork notification {} ",
373 MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e1.getMessage(), e1);
378 logger.debug("Async Delete NetworkId: {} tenantId:{}", networkId, tenantId);
379 // Build and send Asynchronous response
381 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
382 notifyPort.deleteNetworkNotification(messageId, true, null, null, networkDeleted.value);
383 } catch (Exception e) {
384 logger.error("{} {} Error sending deleteNetwork notification {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
385 ErrorCode.DataError.getValue(), e.getMessage(), e);
392 * This web service endpoint will rollback a previous Create VNF operation. A rollback object is returned to the
393 * client in a successful creation response. The client can pass that object as-is back to the rollbackNetwork
394 * operation to undo the creation.
396 * The rollback includes removing the VNF and deleting the tenant if the tenant did not exist prior to the VNF
400 public void rollbackNetworkA(NetworkRollback rollback, String messageId, String notificationUrl) {
401 // rollback may be null (e.g. if network already existed when Create was called)
402 if (rollback == null) {
403 logger.warn("{} {} Rollback is null", MessageEnum.RA_ROLLBACK_NULL, ErrorCode.SchemaError.getValue());
407 logger.info("{} {}", MessageEnum.RA_ASYNC_ROLLBACK, rollback.getNetworkStackId());
408 // Use the synchronous method to perform the actual Create
412 networkAdapter.rollbackNetwork(rollback);
413 } catch (NetworkException e) {
414 logger.debug("Got a NetworkException on rollbackNetwork: ", e);
415 // Build and send Asynchronous error response
416 MsoExceptionCategory exCat = null;
419 eMsg = e.getFaultInfo().getMessage();
420 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
421 } catch (Exception e1) {
422 logger.error("{} {} Exception in get fault info ", MessageEnum.RA_FAULT_INFO_EXC,
423 ErrorCode.DataError.getValue(), e1);
425 // Build and send Asynchronous error response
427 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
428 notifyPort.rollbackNetworkNotification(rollback.getMsoRequest().getRequestId(), false, exCat, eMsg);
429 } catch (Exception e1) {
430 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
431 ErrorCode.DataError.getValue(), e1.getMessage(), e1);
436 logger.debug("Async Rollback NetworkId: {} tenantId:{}", rollback.getNetworkStackId(), rollback.getTenantId());
437 // Build and send Asynchronous response
439 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
440 notifyPort.rollbackNetworkNotification(rollback.getMsoRequest().getRequestId(), true, null, null);
441 } catch (Exception e) {
442 logger.error("{} {} Error sending rollbackNetwork notification {} ",
443 MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e.getMessage(), e);
449 private org.onap.so.adapters.network.async.client.NetworkRollback copyNrb(Holder<NetworkRollback> hNrb) {
450 org.onap.so.adapters.network.async.client.NetworkRollback cnrb =
451 new org.onap.so.adapters.network.async.client.NetworkRollback();
453 if (hNrb != null && hNrb.value != null) {
454 org.onap.so.adapters.network.async.client.MsoRequest cmr =
455 new org.onap.so.adapters.network.async.client.MsoRequest();
457 cnrb.setCloudId(hNrb.value.getCloudId());
458 cmr.setRequestId(hNrb.value.getMsoRequest().getRequestId());
459 cmr.setServiceInstanceId(hNrb.value.getMsoRequest().getServiceInstanceId());
460 cnrb.setMsoRequest(cmr);
461 cnrb.setNetworkId(hNrb.value.getNetworkId());
462 cnrb.setNetworkStackId(hNrb.value.getNetworkStackId());
463 cnrb.setNeutronNetworkId(hNrb.value.getNeutronNetworkId());
464 cnrb.setTenantId(hNrb.value.getTenantId());
465 cnrb.setNetworkType(hNrb.value.getNetworkType());
466 cnrb.setNetworkCreated(hNrb.value.getNetworkCreated());
467 cnrb.setNetworkName(hNrb.value.getNetworkName());
468 cnrb.setPhysicalNetwork(hNrb.value.getPhysicalNetwork());
469 List<Integer> vlansc = cnrb.getVlans();
470 List<Integer> vlansh = hNrb.value.getVlans();
471 if (vlansh != null) {
472 vlansc.addAll(vlansh);
478 private NetworkAdapterNotify getNotifyEP(String notificationUrl) {
480 URL warWsdlLoc = null;
482 warWsdlLoc = Thread.currentThread().getContextClassLoader().getResource("NetworkAdapterNotify.wsdl");
483 } catch (Exception e) {
484 logger.error("{} {} Exception - WSDL not found ", MessageEnum.RA_WSDL_NOT_FOUND,
485 ErrorCode.DataError.getValue(), e);
487 if (warWsdlLoc == null) {
488 logger.error("{} {} WSDL not found", MessageEnum.RA_WSDL_NOT_FOUND, ErrorCode.DataError.getValue());
491 logger.debug("NetworkAdpaterNotify.wsdl location: {}", warWsdlLoc.toURI().toString());
492 } catch (Exception e) {
493 logger.error("{} {} Exception - WSDL URL convention ", MessageEnum.RA_WSDL_URL_CONVENTION_EXC,
494 ErrorCode.SchemaError.getValue(), e);
498 NetworkAdapterNotify_Service notifySvc = new NetworkAdapterNotify_Service(warWsdlLoc,
499 new QName("http://org.onap.so/networkNotify", "networkAdapterNotify"));
501 NetworkAdapterNotify notifyPort = notifySvc.getMsoNetworkAdapterAsyncImplPort();
503 BindingProvider bp = (BindingProvider) notifyPort;
507 epUrl = new URL(notificationUrl);
508 } catch (MalformedURLException e1) {
509 logger.error("{} {} Exception - init notification ", MessageEnum.RA_INIT_NOTIF_EXC,
510 ErrorCode.DataError.getValue(), e1);
514 logger.debug("Notification Endpoint URL: {}", epUrl.toExternalForm());
515 bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, epUrl.toExternalForm());
517 logger.debug("Notification Endpoint URL is NULL: ");
522 Map<String, Object> reqCtx = bp.getRequestContext();
523 Map<String, List<String>> headers = new HashMap<>();
525 String userCredentials = this.getEncryptedProperty(BPEL_AUTH_PROP, "", ENCRYPTION_KEY_PROP);
527 String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
528 reqCtx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
529 headers.put("Authorization", Collections.singletonList(basicAuth));
530 } catch (Exception e) {
531 logger.error("{} {} Unable to set authorization in callback request {} ",
532 MessageEnum.RA_SET_CALLBACK_AUTH_EXC, ErrorCode.DataError.getValue(), e.getMessage(), e);
538 public String getEncryptedProperty(String key, String defaultValue, String encryptionKey) {
540 return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey));
541 } catch (GeneralSecurityException e) {
542 logger.debug("Exception while decrypting property: {} ", this.environment.getProperty(key), e);
548 private CreateNetworkNotification.SubnetIdMap copyCreateSubnetIdMap(Holder<Map<String, String>> hMap) {
550 CreateNetworkNotification.SubnetIdMap subnetIdMap = new CreateNetworkNotification.SubnetIdMap();
552 if (hMap != null && hMap.value != null) {
553 Map<String, String> sMap = hMap.value;
554 CreateNetworkNotification.SubnetIdMap.Entry entry = new CreateNetworkNotification.SubnetIdMap.Entry();
556 for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
557 String key = mapEntry.getKey();
558 String value = mapEntry.getValue();
560 entry.setValue(value);
561 subnetIdMap.getEntry().add(entry);
567 private UpdateNetworkNotification.SubnetIdMap copyUpdateSubnetIdMap(Holder<Map<String, String>> hMap) {
569 UpdateNetworkNotification.SubnetIdMap subnetIdMap = new UpdateNetworkNotification.SubnetIdMap();
571 if (hMap != null && hMap.value != null) {
572 Map<String, String> sMap = hMap.value;
573 UpdateNetworkNotification.SubnetIdMap.Entry entry = new UpdateNetworkNotification.SubnetIdMap.Entry();
575 for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
576 String key = mapEntry.getKey();
577 String value = mapEntry.getValue();
579 entry.setValue(value);
580 subnetIdMap.getEntry().add(entry);
586 private QueryNetworkNotification.SubnetIdMap copyQuerySubnetIdMap(Holder<Map<String, String>> hMap) {
588 QueryNetworkNotification.SubnetIdMap subnetIdMap = new QueryNetworkNotification.SubnetIdMap();
590 if (hMap != null && hMap.value != null) {
591 Map<String, String> sMap = hMap.value;
592 QueryNetworkNotification.SubnetIdMap.Entry entry = new QueryNetworkNotification.SubnetIdMap.Entry();
594 for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
595 String key = mapEntry.getKey();
596 String value = mapEntry.getValue();
598 entry.setValue(value);
599 subnetIdMap.getEntry().add(entry);