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";
77 private Environment environment;
80 private MsoNetworkAdapter networkAdapter;
83 * Health Check web method. Does nothing but return to show the adapter is deployed.
86 public void healthCheckA() {
87 logger.debug("Health check call in Network Adapter");
91 * This is the "Create Network" web service implementation. It will create a new Network of the requested type in
92 * the specified cloud and tenant. The tenant must exist at the time this service is called.
94 * If a network with the same name already exists, this can be considered a success or failure, depending on the
95 * value of the 'failIfExists' parameter.
97 * There will be a pre-defined set of network types defined in the MSO Catalog. All such networks will have a
98 * similar configuration, based on the allowable Openstack networking definitions. This includes basic networks,
99 * provider networks (with a single VLAN), and multi-provider networks (one or more VLANs)
101 * Initially, all provider networks must be "vlan" type, and multiple segments in a multi-provider network must be
102 * multiple VLANs on the same physical network.
104 * This service supports two modes of Network creation/update: - via Heat Templates - via Neutron API The network
105 * orchestration mode for each network type is declared in its catalog definition. All Heat-based templates must
106 * support some subset of the same input parameters: network_name, physical_network, vlan(s).
108 * The method returns the network ID and a NetworkRollback object. This latter object can be passed as-is to the
109 * rollbackNetwork operation to undo everything that was created. This is useful if a network is successfully
110 * created but the orchestration fails on a subsequent operation.
113 public void createNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
114 String networkName, String physicalNetworkName, List<Integer> vlans, Boolean failIfExists, Boolean backout,
115 List<Subnet> subnets, Map<String, String> networkParams, String messageId, MsoRequest msoRequest,
116 String notificationUrl) {
118 logger.debug("Async Create Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId);
120 // Use the synchronous method to perform the actual Create
123 // Synchronous Web Service Outputs
124 Holder<String> networkId = new Holder<>();
125 Holder<String> neutronNetworkId = new Holder<>();
126 Holder<NetworkRollback> networkRollback = new Holder<>();
127 Holder<Map<String, String>> subnetIdMap = new Holder<>();
129 HashMap<String, String> params = (HashMap<String, String>) networkParams;
131 params = new HashMap<>();
132 String shared = null;
133 String external = null;
134 if (params.containsKey(SHARED))
135 shared = params.get(SHARED);
136 if (params.containsKey("external"))
137 external = params.get("external");
140 networkAdapter.createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName,
141 physicalNetworkName, vlans, shared, external, failIfExists, backout, subnets, params, msoRequest,
142 networkId, neutronNetworkId, subnetIdMap, networkRollback);
143 } catch (NetworkException e) {
144 logger.debug(NETWORK_EXCEPTION_MSG, e);
145 MsoExceptionCategory exCat = null;
148 eMsg = e.getFaultInfo().getMessage();
149 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
150 } catch (Exception e1) {
151 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
154 // Build and send Asynchronous error response
156 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
157 notifyPort.createNetworkNotification(messageId, false, exCat, eMsg, null, null, null, null);
158 } catch (Exception e1) {
159 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
160 ErrorCode.DataError.getValue(), e1.getMessage(), e1);
165 logger.debug("Async Create Network:Name {} physicalNetworkName:{}", networkName, physicalNetworkName);
166 // Build and send Asynchronous response
168 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
169 notifyPort.createNetworkNotification(messageId, true, null, null, networkId.value, neutronNetworkId.value,
170 copyCreateSubnetIdMap(subnetIdMap), copyNrb(networkRollback));
171 } catch (Exception e) {
172 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
173 ErrorCode.DataError.getValue(), e.getMessage(), e);
180 * This is the "Update Network" web service implementation. It will update an existing Network of the requested type
181 * in the specified cloud and tenant. The typical use will be to replace the VLANs with the supplied list (to add or
182 * remove a VLAN), but other properties may be updated as well.
184 * There will be a pre-defined set of network types defined in the MSO Catalog. All such networks will have a
185 * similar configuration, based on the allowable Openstack networking definitions. This includes basic networks,
186 * provider networks (with a single VLAN), and multi-provider networks (one or more VLANs).
188 * Initially, all provider networks must currently be "vlan" type, and multi-provider networks must be multiple
189 * VLANs on the same physical network.
191 * This service supports two modes of Network update: - via Heat Templates - via Neutron API The network
192 * orchestration mode for each network type is declared in its catalog definition. All Heat-based templates must
193 * support some subset of the same input parameters: network_name, physical_network, vlan, segments.
195 * The method returns a NetworkRollback object. This object can be passed as-is to the rollbackNetwork operation to
196 * undo everything that was updated. This is useful if a network is successfully updated but orchestration fails on
197 * a subsequent operation.
200 public void updateNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
201 String networkId, String networkName, String physicalNetworkName, List<Integer> vlans, List<Subnet> subnets,
202 Map<String, String> networkParams, String messageId, MsoRequest msoRequest, String notificationUrl) {
204 logger.debug("Async Update Network: {} of type {} in {}/{}", networkId, networkType, cloudSiteId, tenantId);
206 // Use the synchronous method to perform the actual Create
209 // Synchronous Web Service Outputs
210 Holder<NetworkRollback> networkRollback = new Holder<>();
211 Holder<Map<String, String>> subnetIdMap = new Holder<>();
213 HashMap<String, String> params = (HashMap<String, String>) networkParams;
215 params = new HashMap<>();
216 String shared = null;
217 String external = null;
218 if (params.containsKey(SHARED))
219 shared = params.get(SHARED);
220 if (params.containsKey("external"))
221 external = params.get("external");
224 networkAdapter.updateNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId,
225 networkName, physicalNetworkName, vlans, shared, external, subnets, params, msoRequest, subnetIdMap,
227 } catch (NetworkException e) {
228 logger.debug("Got a NetworkException on updateNetwork: ", e);
229 MsoExceptionCategory exCat = null;
232 eMsg = e.getFaultInfo().getMessage();
233 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
234 } catch (Exception e1) {
235 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
238 // Build and send Asynchronous error response
240 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
241 notifyPort.updateNetworkNotification(messageId, false, exCat, eMsg, null, copyNrb(networkRollback));
242 } catch (Exception e1) {
243 logger.error("{} {} Error sending updateNetwork notification {} ",
244 MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e1.getMessage(), e1);
249 logger.debug("Async Update Network:Name {} NetworkId:{}", networkName, networkId);
250 // Build and send Asynchronous response
252 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
253 notifyPort.updateNetworkNotification(messageId, true, null, null, copyUpdateSubnetIdMap(subnetIdMap),
254 copyNrb(networkRollback));
255 } catch (Exception e) {
256 logger.error("{} {} Error sending updateNotification request {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
257 ErrorCode.DataError.getValue(), e.getMessage(), e);
263 * This is the queryNetwork method. It returns the existence and status of the specified network, along with its
264 * Neutron UUID and list of VLANs. This method attempts to find the network using both Heat and Neutron. Heat stacks
265 * are first searched based on the provided network name/id. If none is found, the Neutron is directly queried.
268 public void queryNetworkA(String cloudSiteId, String tenantId, String networkNameOrId, String messageId,
269 MsoRequest msoRequest, String notificationUrl) {
271 logger.debug("Async Query Network {} in {}/{}", networkNameOrId, cloudSiteId, tenantId);
272 String errorCreateNetworkMessage = "{} {} Error sending createNetwork notification {} ";
274 // Use the synchronous method to perform the actual Create
277 // Synchronous Web Service Outputs
278 Holder<Boolean> networkExists = new Holder<>();
279 Holder<String> networkId = new Holder<>();
280 Holder<String> neutronNetworkId = new Holder<>();
281 Holder<NetworkStatus> status = new Holder<>();
282 Holder<List<Integer>> vlans = new Holder<>();
283 Holder<Map<String, String>> subnetIdMap = new Holder<>();
286 networkAdapter.queryNetwork(cloudSiteId, tenantId, networkNameOrId, msoRequest, networkExists, networkId,
287 neutronNetworkId, status, vlans, subnetIdMap);
288 } catch (NetworkException e) {
289 logger.debug(NETWORK_EXCEPTION_MSG, e);
290 MsoExceptionCategory exCat = null;
293 eMsg = e.getFaultInfo().getMessage();
294 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
295 } catch (Exception e1) {
296 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
299 // Build and send Asynchronous error response
301 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
302 notifyPort.queryNetworkNotification(messageId, false, exCat, eMsg, null, null, null, null, null, null);
303 } catch (Exception e1) {
304 logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
305 ErrorCode.DataError.getValue(), e1.getMessage(), e1);
309 logger.debug("Async Query Network:NameOrId {} tenantId:{}", networkNameOrId, tenantId);
310 // Build and send Asynchronous response
312 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
313 org.onap.so.adapters.network.async.client.NetworkStatus networkS =
314 org.onap.so.adapters.network.async.client.NetworkStatus.fromValue(status.value.name());
315 notifyPort.queryNetworkNotification(messageId, true, null, null, networkExists.value, networkId.value,
316 neutronNetworkId.value, networkS, vlans.value, copyQuerySubnetIdMap(subnetIdMap));
317 } catch (Exception e) {
318 logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
319 ErrorCode.DataError.getValue(), e.getMessage(), e);
325 * This is the "Delete Network" web service implementation. It will delete a Network in the specified cloud and
328 * If the network is not found, it is treated as a success.
330 * This service supports two modes of Network creation/update/delete: - via Heat Templates - via Neutron API The
331 * network orchestration mode for each network type is declared in its catalog definition.
333 * For Heat-based orchestration, the networkId should be the stack ID. For Neutron-based orchestration, the
334 * networkId should be the Neutron network UUID.
336 * The method returns nothing on success. Rollback is not possible for delete commands, so any failure on delete
337 * will require manual fallout in the client.
340 public void deleteNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
341 String networkId, String messageId, MsoRequest msoRequest, String notificationUrl) {
343 String serviceName = "DeleteNetworkA";
344 logger.debug("Async Delete Network {} in {}/{}", networkId, cloudSiteId, tenantId);
346 // Use the synchronous method to perform the actual Create
349 // Synchronous Web Service Outputs
350 Holder<Boolean> networkDeleted = new Holder<>();
353 networkAdapter.deleteNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId,
354 msoRequest, networkDeleted);
355 } catch (NetworkException e) {
356 logger.debug(NETWORK_EXCEPTION_MSG, e);
357 MsoExceptionCategory exCat = null;
360 eMsg = e.getFaultInfo().getMessage();
361 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
362 } catch (Exception e1) {
363 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
366 // Build and send Asynchronous error response
368 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
369 notifyPort.deleteNetworkNotification(messageId, false, exCat, eMsg, null);
370 } catch (Exception e1) {
371 logger.error("{} {} Error sending createNetwork notification {} ",
372 MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e1.getMessage(), e1);
377 logger.debug("Async Delete NetworkId: {} tenantId:{}", networkId, tenantId);
378 // Build and send Asynchronous response
380 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
381 notifyPort.deleteNetworkNotification(messageId, true, null, null, networkDeleted.value);
382 } catch (Exception e) {
383 logger.error("{} {} Error sending deleteNetwork notification {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
384 ErrorCode.DataError.getValue(), e.getMessage(), e);
391 * This web service endpoint will rollback a previous Create VNF operation. A rollback object is returned to the
392 * client in a successful creation response. The client can pass that object as-is back to the rollbackNetwork
393 * operation to undo the creation.
395 * The rollback includes removing the VNF and deleting the tenant if the tenant did not exist prior to the VNF
399 public void rollbackNetworkA(NetworkRollback rollback, String messageId, String notificationUrl) {
400 // rollback may be null (e.g. if network already existed when Create was called)
401 if (rollback == null) {
402 logger.warn("{} {} Rollback is null", MessageEnum.RA_ROLLBACK_NULL, ErrorCode.SchemaError.getValue());
406 logger.info("{} {}", MessageEnum.RA_ASYNC_ROLLBACK, rollback.getNetworkStackId());
407 // Use the synchronous method to perform the actual Create
411 networkAdapter.rollbackNetwork(rollback);
412 } catch (NetworkException e) {
413 logger.debug("Got a NetworkException on rollbackNetwork: ", e);
414 // Build and send Asynchronous error response
415 MsoExceptionCategory exCat = null;
418 eMsg = e.getFaultInfo().getMessage();
419 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
420 } catch (Exception e1) {
421 logger.error("{} {} Exception in get fault info ", MessageEnum.RA_FAULT_INFO_EXC,
422 ErrorCode.DataError.getValue(), e1);
424 // Build and send Asynchronous error response
426 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
427 notifyPort.rollbackNetworkNotification(rollback.getMsoRequest().getRequestId(), false, exCat, eMsg);
428 } catch (Exception e1) {
429 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
430 ErrorCode.DataError.getValue(), e1.getMessage(), e1);
435 logger.debug("Async Rollback NetworkId: {} tenantId:{}", rollback.getNetworkStackId(), rollback.getTenantId());
436 // Build and send Asynchronous response
438 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
439 notifyPort.rollbackNetworkNotification(rollback.getMsoRequest().getRequestId(), true, null, null);
440 } catch (Exception e) {
441 logger.error("{} {} Error sending rollbackNetwork notification {} ",
442 MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e.getMessage(), e);
448 private org.onap.so.adapters.network.async.client.NetworkRollback copyNrb(Holder<NetworkRollback> hNrb) {
449 org.onap.so.adapters.network.async.client.NetworkRollback cnrb =
450 new org.onap.so.adapters.network.async.client.NetworkRollback();
452 if (hNrb != null && hNrb.value != null) {
453 org.onap.so.adapters.network.async.client.MsoRequest cmr =
454 new org.onap.so.adapters.network.async.client.MsoRequest();
456 cnrb.setCloudId(hNrb.value.getCloudId());
457 cmr.setRequestId(hNrb.value.getMsoRequest().getRequestId());
458 cmr.setServiceInstanceId(hNrb.value.getMsoRequest().getServiceInstanceId());
459 cnrb.setMsoRequest(cmr);
460 cnrb.setNetworkId(hNrb.value.getNetworkId());
461 cnrb.setNetworkStackId(hNrb.value.getNetworkStackId());
462 cnrb.setNeutronNetworkId(hNrb.value.getNeutronNetworkId());
463 cnrb.setTenantId(hNrb.value.getTenantId());
464 cnrb.setNetworkType(hNrb.value.getNetworkType());
465 cnrb.setNetworkCreated(hNrb.value.getNetworkCreated());
466 cnrb.setNetworkName(hNrb.value.getNetworkName());
467 cnrb.setPhysicalNetwork(hNrb.value.getPhysicalNetwork());
468 List<Integer> vlansc = cnrb.getVlans();
469 List<Integer> vlansh = hNrb.value.getVlans();
470 if (vlansh != null) {
471 vlansc.addAll(vlansh);
477 private NetworkAdapterNotify getNotifyEP(String notificationUrl) {
479 URL warWsdlLoc = null;
481 warWsdlLoc = Thread.currentThread().getContextClassLoader().getResource("NetworkAdapterNotify.wsdl");
482 } catch (Exception e) {
483 logger.error("{} {} Exception - WSDL not found ", MessageEnum.RA_WSDL_NOT_FOUND,
484 ErrorCode.DataError.getValue(), e);
486 if (warWsdlLoc == null) {
487 logger.error("{} {} WSDL not found", MessageEnum.RA_WSDL_NOT_FOUND, ErrorCode.DataError.getValue());
490 logger.debug("NetworkAdpaterNotify.wsdl location: {}", warWsdlLoc.toURI().toString());
491 } catch (Exception e) {
492 logger.error("{} {} Exception - WSDL URL convention ", MessageEnum.RA_WSDL_URL_CONVENTION_EXC,
493 ErrorCode.SchemaError.getValue(), e);
497 NetworkAdapterNotify_Service notifySvc = new NetworkAdapterNotify_Service(warWsdlLoc,
498 new QName("http://org.onap.so/networkNotify", "networkAdapterNotify"));
500 NetworkAdapterNotify notifyPort = notifySvc.getMsoNetworkAdapterAsyncImplPort();
502 BindingProvider bp = (BindingProvider) notifyPort;
506 epUrl = new URL(notificationUrl);
507 } catch (MalformedURLException e1) {
508 logger.error("{} {} Exception - init notification ", MessageEnum.RA_INIT_NOTIF_EXC,
509 ErrorCode.DataError.getValue(), e1);
513 logger.debug("Notification Endpoint URL: {}", epUrl.toExternalForm());
514 bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, epUrl.toExternalForm());
516 logger.debug("Notification Endpoint URL is NULL: ");
521 Map<String, Object> reqCtx = bp.getRequestContext();
522 Map<String, List<String>> headers = new HashMap<>();
524 String userCredentials = this.getEncryptedProperty(BPEL_AUTH_PROP, "", ENCRYPTION_KEY_PROP);
526 String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
527 reqCtx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
528 headers.put("Authorization", Collections.singletonList(basicAuth));
529 } catch (Exception e) {
530 logger.error("{} {} Unable to set authorization in callback request {} ",
531 MessageEnum.RA_SET_CALLBACK_AUTH_EXC, ErrorCode.DataError.getValue(), e.getMessage(), e);
537 public String getEncryptedProperty(String key, String defaultValue, String encryptionKey) {
539 return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey));
540 } catch (GeneralSecurityException e) {
541 logger.debug("Exception while decrypting property: {} ", this.environment.getProperty(key), e);
547 private CreateNetworkNotification.SubnetIdMap copyCreateSubnetIdMap(Holder<Map<String, String>> hMap) {
549 CreateNetworkNotification.SubnetIdMap subnetIdMap = new CreateNetworkNotification.SubnetIdMap();
551 if (hMap != null && hMap.value != null) {
552 Map<String, String> sMap = hMap.value;
553 CreateNetworkNotification.SubnetIdMap.Entry entry = new CreateNetworkNotification.SubnetIdMap.Entry();
555 for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
556 String key = mapEntry.getKey();
557 String value = mapEntry.getValue();
559 entry.setValue(value);
560 subnetIdMap.getEntry().add(entry);
566 private UpdateNetworkNotification.SubnetIdMap copyUpdateSubnetIdMap(Holder<Map<String, String>> hMap) {
568 UpdateNetworkNotification.SubnetIdMap subnetIdMap = new UpdateNetworkNotification.SubnetIdMap();
570 if (hMap != null && hMap.value != null) {
571 Map<String, String> sMap = hMap.value;
572 UpdateNetworkNotification.SubnetIdMap.Entry entry = new UpdateNetworkNotification.SubnetIdMap.Entry();
574 for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
575 String key = mapEntry.getKey();
576 String value = mapEntry.getValue();
578 entry.setValue(value);
579 subnetIdMap.getEntry().add(entry);
585 private QueryNetworkNotification.SubnetIdMap copyQuerySubnetIdMap(Holder<Map<String, String>> hMap) {
587 QueryNetworkNotification.SubnetIdMap subnetIdMap = new QueryNetworkNotification.SubnetIdMap();
589 if (hMap != null && hMap.value != null) {
590 Map<String, String> sMap = hMap.value;
591 QueryNetworkNotification.SubnetIdMap.Entry entry = new QueryNetworkNotification.SubnetIdMap.Entry();
593 for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
594 String key = mapEntry.getKey();
595 String value = mapEntry.getValue();
597 entry.setValue(value);
598 subnetIdMap.getEntry().add(entry);