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 = "org.onap.so.adapters.network.encryptionKey";
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 ";
76 private Environment environment;
79 private MsoNetworkAdapter networkAdapter;
82 * Health Check web method. Does nothing but return to show the adapter is deployed.
85 public void healthCheckA() {
86 logger.debug("Health check call in Network Adapter");
90 * This is the "Create Network" web service implementation. It will create a new Network of the requested type in
91 * the specified cloud and tenant. The tenant must exist at the time this service is called.
93 * If a network with the same name already exists, this can be considered a success or failure, depending on the
94 * value of the 'failIfExists' parameter.
96 * There will be a pre-defined set of network types defined in the MSO Catalog. All such networks will have a
97 * similar configuration, based on the allowable Openstack networking definitions. This includes basic networks,
98 * provider networks (with a single VLAN), and multi-provider networks (one or more VLANs)
100 * Initially, all provider networks must be "vlan" type, and multiple segments in a multi-provider network must be
101 * multiple VLANs on the same physical network.
103 * This service supports two modes of Network creation/update: - via Heat Templates - via Neutron API The network
104 * orchestration mode for each network type is declared in its catalog definition. All Heat-based templates must
105 * support some subset of the same input parameters: network_name, physical_network, vlan(s).
107 * The method returns the network ID and a NetworkRollback object. This latter object can be passed as-is to the
108 * rollbackNetwork operation to undo everything that was created. This is useful if a network is successfully
109 * created but the orchestration fails on a subsequent operation.
112 public void createNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
113 String networkName, String physicalNetworkName, List<Integer> vlans, Boolean failIfExists, Boolean backout,
114 List<Subnet> subnets, Map<String, String> networkParams, String messageId, MsoRequest msoRequest,
115 String notificationUrl) {
117 logger.debug("Async Create Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId);
119 // Use the synchronous method to perform the actual Create
122 // Synchronous Web Service Outputs
123 Holder<String> networkId = new Holder<>();
124 Holder<String> neutronNetworkId = new Holder<>();
125 Holder<NetworkRollback> networkRollback = new Holder<>();
126 Holder<Map<String, String>> subnetIdMap = new Holder<>();
128 HashMap<String, String> params = (HashMap<String, String>) networkParams;
130 params = new HashMap<String, String>();
131 String shared = null;
132 String external = null;
133 if (params.containsKey("shared"))
134 shared = params.get("shared");
135 if (params.containsKey("external"))
136 external = params.get("external");
139 networkAdapter.createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName,
140 physicalNetworkName, vlans, shared, external, failIfExists, backout, subnets, params, msoRequest,
141 networkId, neutronNetworkId, subnetIdMap, networkRollback);
142 } catch (NetworkException e) {
143 logger.debug(NETWORK_EXCEPTION_MSG, e);
144 MsoExceptionCategory exCat = null;
147 eMsg = e.getFaultInfo().getMessage();
148 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
149 } catch (Exception e1) {
150 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
153 // Build and send Asynchronous error response
155 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
156 notifyPort.createNetworkNotification(messageId, false, exCat, eMsg, null, null, null, null);
157 } catch (Exception e1) {
158 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
159 ErrorCode.DataError.getValue(), e1.getMessage(), e1);
164 logger.debug("Async Create Network:Name {} physicalNetworkName:{}", networkName, physicalNetworkName);
165 // Build and send Asynchronous response
167 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
168 notifyPort.createNetworkNotification(messageId, true, null, null, networkId.value, neutronNetworkId.value,
169 copyCreateSubnetIdMap(subnetIdMap), copyNrb(networkRollback));
170 } catch (Exception e) {
171 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
172 ErrorCode.DataError.getValue(), e.getMessage(), e);
179 * This is the "Update Network" web service implementation. It will update an existing Network of the requested type
180 * in the specified cloud and tenant. The typical use will be to replace the VLANs with the supplied list (to add or
181 * remove a VLAN), but other properties may be updated as well.
183 * There will be a pre-defined set of network types defined in the MSO Catalog. All such networks will have a
184 * similar configuration, based on the allowable Openstack networking definitions. This includes basic networks,
185 * provider networks (with a single VLAN), and multi-provider networks (one or more VLANs).
187 * Initially, all provider networks must currently be "vlan" type, and multi-provider networks must be multiple
188 * VLANs on the same physical network.
190 * This service supports two modes of Network update: - via Heat Templates - via Neutron API The network
191 * orchestration mode for each network type is declared in its catalog definition. All Heat-based templates must
192 * support some subset of the same input parameters: network_name, physical_network, vlan, segments.
194 * The method returns a NetworkRollback object. This object can be passed as-is to the rollbackNetwork operation to
195 * undo everything that was updated. This is useful if a network is successfully updated but orchestration fails on
196 * a subsequent operation.
199 public void updateNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
200 String networkId, String networkName, String physicalNetworkName, List<Integer> vlans, List<Subnet> subnets,
201 Map<String, String> networkParams, String messageId, MsoRequest msoRequest, String notificationUrl) {
203 logger.debug("Async Update Network: {} of type {} in {}/{}", networkId, networkType, cloudSiteId, tenantId);
205 // Use the synchronous method to perform the actual Create
208 // Synchronous Web Service Outputs
209 Holder<NetworkRollback> networkRollback = new Holder<>();
210 Holder<Map<String, String>> subnetIdMap = new Holder<>();
212 HashMap<String, String> params = (HashMap<String, String>) networkParams;
214 params = new HashMap<String, String>();
215 String shared = null;
216 String external = null;
217 if (params.containsKey("shared"))
218 shared = params.get("shared");
219 if (params.containsKey("external"))
220 external = params.get("external");
223 networkAdapter.updateNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId,
224 networkName, physicalNetworkName, vlans, shared, external, subnets, params, msoRequest, subnetIdMap,
226 } catch (NetworkException e) {
227 logger.debug("Got a NetworkException on updateNetwork: ", e);
228 MsoExceptionCategory exCat = null;
231 eMsg = e.getFaultInfo().getMessage();
232 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
233 } catch (Exception e1) {
234 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
237 // Build and send Asynchronous error response
239 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
240 notifyPort.updateNetworkNotification(messageId, false, exCat, eMsg, null, copyNrb(networkRollback));
241 } catch (Exception e1) {
242 logger.error("{} {} Error sending updateNetwork notification {} ",
243 MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e1.getMessage(), e1);
248 logger.debug("Async Update Network:Name {} NetworkId:{}", networkName, networkId);
249 // Build and send Asynchronous response
251 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
252 notifyPort.updateNetworkNotification(messageId, true, null, null, copyUpdateSubnetIdMap(subnetIdMap),
253 copyNrb(networkRollback));
254 } catch (Exception e) {
255 logger.error("{} {} Error sending updateNotification request {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
256 ErrorCode.DataError.getValue(), e.getMessage(), e);
262 * This is the queryNetwork method. It returns the existence and status of the specified network, along with its
263 * Neutron UUID and list of VLANs. This method attempts to find the network using both Heat and Neutron. Heat stacks
264 * are first searched based on the provided network name/id. If none is found, the Neutron is directly queried.
267 public void queryNetworkA(String cloudSiteId, String tenantId, String networkNameOrId, String messageId,
268 MsoRequest msoRequest, String notificationUrl) {
270 logger.debug("Async Query Network {} in {}/{}", networkNameOrId, cloudSiteId, tenantId);
271 String errorCreateNetworkMessage = "{} {} Error sending createNetwork notification {} ";
273 // Use the synchronous method to perform the actual Create
276 // Synchronous Web Service Outputs
277 Holder<Boolean> networkExists = new Holder<>();
278 Holder<String> networkId = new Holder<>();
279 Holder<String> neutronNetworkId = new Holder<>();
280 Holder<NetworkStatus> status = new Holder<>();
281 Holder<List<Integer>> vlans = new Holder<>();
282 Holder<Map<String, String>> subnetIdMap = new Holder<>();
285 networkAdapter.queryNetwork(cloudSiteId, tenantId, networkNameOrId, msoRequest, networkExists, networkId,
286 neutronNetworkId, status, vlans, subnetIdMap);
287 } catch (NetworkException e) {
288 logger.debug(NETWORK_EXCEPTION_MSG, e);
289 MsoExceptionCategory exCat = null;
292 eMsg = e.getFaultInfo().getMessage();
293 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
294 } catch (Exception e1) {
295 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
298 // Build and send Asynchronous error response
300 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
301 notifyPort.queryNetworkNotification(messageId, false, exCat, eMsg, null, null, null, null, null, null);
302 } catch (Exception e1) {
303 logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
304 ErrorCode.DataError.getValue(), e1.getMessage(), e1);
308 logger.debug("Async Query Network:NameOrId {} tenantId:{}", networkNameOrId, tenantId);
309 // Build and send Asynchronous response
311 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
312 org.onap.so.adapters.network.async.client.NetworkStatus networkS =
313 org.onap.so.adapters.network.async.client.NetworkStatus.fromValue(status.value.name());
314 notifyPort.queryNetworkNotification(messageId, true, null, null, networkExists.value, networkId.value,
315 neutronNetworkId.value, networkS, vlans.value, copyQuerySubnetIdMap(subnetIdMap));
316 } catch (Exception e) {
317 logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
318 ErrorCode.DataError.getValue(), e.getMessage(), e);
324 * This is the "Delete Network" web service implementation. It will delete a Network in the specified cloud and
327 * If the network is not found, it is treated as a success.
329 * This service supports two modes of Network creation/update/delete: - via Heat Templates - via Neutron API The
330 * network orchestration mode for each network type is declared in its catalog definition.
332 * For Heat-based orchestration, the networkId should be the stack ID. For Neutron-based orchestration, the
333 * networkId should be the Neutron network UUID.
335 * The method returns nothing on success. Rollback is not possible for delete commands, so any failure on delete
336 * will require manual fallout in the client.
339 public void deleteNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
340 String networkId, String messageId, MsoRequest msoRequest, String notificationUrl) {
342 String serviceName = "DeleteNetworkA";
343 logger.debug("Async Delete Network {} in {}/{}", networkId, cloudSiteId, tenantId);
345 // Use the synchronous method to perform the actual Create
348 // Synchronous Web Service Outputs
349 Holder<Boolean> networkDeleted = new Holder<>();
352 networkAdapter.deleteNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId,
353 msoRequest, networkDeleted);
354 } catch (NetworkException e) {
355 logger.debug(NETWORK_EXCEPTION_MSG, e);
356 MsoExceptionCategory exCat = null;
359 eMsg = e.getFaultInfo().getMessage();
360 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
361 } catch (Exception e1) {
362 logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(),
365 // Build and send Asynchronous error response
367 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
368 notifyPort.deleteNetworkNotification(messageId, false, exCat, eMsg, null);
369 } catch (Exception e1) {
370 logger.error("{} {} Error sending createNetwork notification {} ",
371 MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e1.getMessage(), e1);
376 logger.debug("Async Delete NetworkId: {} tenantId:{}", networkId, tenantId);
377 // Build and send Asynchronous response
379 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
380 notifyPort.deleteNetworkNotification(messageId, true, null, null, networkDeleted.value);
381 } catch (Exception e) {
382 logger.error("{} {} Error sending deleteNetwork notification {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
383 ErrorCode.DataError.getValue(), e.getMessage(), e);
390 * This web service endpoint will rollback a previous Create VNF operation. A rollback object is returned to the
391 * client in a successful creation response. The client can pass that object as-is back to the rollbackNetwork
392 * operation to undo the creation.
394 * The rollback includes removing the VNF and deleting the tenant if the tenant did not exist prior to the VNF
398 public void rollbackNetworkA(NetworkRollback rollback, String messageId, String notificationUrl) {
399 // rollback may be null (e.g. if network already existed when Create was called)
400 if (rollback == null) {
401 logger.warn("{} {} Rollback is null", MessageEnum.RA_ROLLBACK_NULL, ErrorCode.SchemaError.getValue());
405 logger.info("{} {}", MessageEnum.RA_ASYNC_ROLLBACK, rollback.getNetworkStackId());
406 // Use the synchronous method to perform the actual Create
410 networkAdapter.rollbackNetwork(rollback);
411 } catch (NetworkException e) {
412 logger.debug("Got a NetworkException on rollbackNetwork: ", e);
413 // Build and send Asynchronous error response
414 MsoExceptionCategory exCat = null;
417 eMsg = e.getFaultInfo().getMessage();
418 exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name());
419 } catch (Exception e1) {
420 logger.error("{} {} Exception in get fault info ", MessageEnum.RA_FAULT_INFO_EXC,
421 ErrorCode.DataError.getValue(), e1);
423 // Build and send Asynchronous error response
425 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
426 notifyPort.rollbackNetworkNotification(rollback.getMsoRequest().getRequestId(), false, exCat, eMsg);
427 } catch (Exception e1) {
428 logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC,
429 ErrorCode.DataError.getValue(), e1.getMessage(), e1);
434 logger.debug("Async Rollback NetworkId: {} tenantId:{}", rollback.getNetworkStackId(), rollback.getTenantId());
435 // Build and send Asynchronous response
437 NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl);
438 notifyPort.rollbackNetworkNotification(rollback.getMsoRequest().getRequestId(), true, null, null);
439 } catch (Exception e) {
440 logger.error("{} {} Error sending rollbackNetwork notification {} ",
441 MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e.getMessage(), e);
447 private org.onap.so.adapters.network.async.client.NetworkRollback copyNrb(Holder<NetworkRollback> hNrb) {
448 org.onap.so.adapters.network.async.client.NetworkRollback cnrb =
449 new org.onap.so.adapters.network.async.client.NetworkRollback();
451 if (hNrb != null && hNrb.value != null) {
452 org.onap.so.adapters.network.async.client.MsoRequest cmr =
453 new org.onap.so.adapters.network.async.client.MsoRequest();
455 cnrb.setCloudId(hNrb.value.getCloudId());
456 cmr.setRequestId(hNrb.value.getMsoRequest().getRequestId());
457 cmr.setServiceInstanceId(hNrb.value.getMsoRequest().getServiceInstanceId());
458 cnrb.setMsoRequest(cmr);
459 cnrb.setNetworkId(hNrb.value.getNetworkId());
460 cnrb.setNetworkStackId(hNrb.value.getNetworkStackId());
461 cnrb.setNeutronNetworkId(hNrb.value.getNeutronNetworkId());
462 cnrb.setTenantId(hNrb.value.getTenantId());
463 cnrb.setNetworkType(hNrb.value.getNetworkType());
464 cnrb.setNetworkCreated(hNrb.value.getNetworkCreated());
465 cnrb.setNetworkName(hNrb.value.getNetworkName());
466 cnrb.setPhysicalNetwork(hNrb.value.getPhysicalNetwork());
467 List<Integer> vlansc = cnrb.getVlans();
468 List<Integer> vlansh = hNrb.value.getVlans();
469 if (vlansh != null) {
470 vlansc.addAll(vlansh);
476 private NetworkAdapterNotify getNotifyEP(String notificationUrl) {
478 URL warWsdlLoc = null;
480 warWsdlLoc = Thread.currentThread().getContextClassLoader().getResource("NetworkAdapterNotify.wsdl");
481 } catch (Exception e) {
482 logger.error("{} {} Exception - WSDL not found ", MessageEnum.RA_WSDL_NOT_FOUND,
483 ErrorCode.DataError.getValue(), e);
485 if (warWsdlLoc == null) {
486 logger.error("{} {} WSDL not found", MessageEnum.RA_WSDL_NOT_FOUND, ErrorCode.DataError.getValue());
489 logger.debug("NetworkAdpaterNotify.wsdl location: {}", warWsdlLoc.toURI().toString());
490 } catch (Exception e) {
491 logger.error("{} {} Exception - WSDL URL convention ", MessageEnum.RA_WSDL_URL_CONVENTION_EXC,
492 ErrorCode.SchemaError.getValue(), e);
496 NetworkAdapterNotify_Service notifySvc = new NetworkAdapterNotify_Service(warWsdlLoc,
497 new QName("http://org.onap.so/networkNotify", "networkAdapterNotify"));
499 NetworkAdapterNotify notifyPort = notifySvc.getMsoNetworkAdapterAsyncImplPort();
501 BindingProvider bp = (BindingProvider) notifyPort;
505 epUrl = new URL(notificationUrl);
506 } catch (MalformedURLException e1) {
507 logger.error("{} {} Exception - init notification ", MessageEnum.RA_INIT_NOTIF_EXC,
508 ErrorCode.DataError.getValue(), e1);
512 logger.debug("Notification Endpoint URL: {}", epUrl.toExternalForm());
513 bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, epUrl.toExternalForm());
515 logger.debug("Notification Endpoint URL is NULL: ");
520 Map<String, Object> reqCtx = bp.getRequestContext();
521 Map<String, List<String>> headers = new HashMap<>();
523 String userCredentials = this.getEncryptedProperty(BPEL_AUTH_PROP, "", ENCRYPTION_KEY_PROP);
525 String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
526 reqCtx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
527 headers.put("Authorization", Collections.singletonList(basicAuth));
528 } catch (Exception e) {
529 logger.error("{} {} Unable to set authorization in callback request {} ",
530 MessageEnum.RA_SET_CALLBACK_AUTH_EXC, ErrorCode.DataError.getValue(), e.getMessage(), e);
536 public String getEncryptedProperty(String key, String defaultValue, String encryptionKey) {
538 return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey));
539 } catch (GeneralSecurityException e) {
540 logger.debug("Exception while decrypting property: {} ", this.environment.getProperty(key), e);
546 private CreateNetworkNotification.SubnetIdMap copyCreateSubnetIdMap(Holder<Map<String, String>> hMap) {
548 CreateNetworkNotification.SubnetIdMap subnetIdMap = new CreateNetworkNotification.SubnetIdMap();
550 if (hMap != null && hMap.value != null) {
551 Map<String, String> sMap = hMap.value;
552 CreateNetworkNotification.SubnetIdMap.Entry entry = new CreateNetworkNotification.SubnetIdMap.Entry();
554 for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
555 String key = mapEntry.getKey();
556 String value = mapEntry.getValue();
558 entry.setValue(value);
559 subnetIdMap.getEntry().add(entry);
565 private UpdateNetworkNotification.SubnetIdMap copyUpdateSubnetIdMap(Holder<Map<String, String>> hMap) {
567 UpdateNetworkNotification.SubnetIdMap subnetIdMap = new UpdateNetworkNotification.SubnetIdMap();
569 if (hMap != null && hMap.value != null) {
570 Map<String, String> sMap = hMap.value;
571 UpdateNetworkNotification.SubnetIdMap.Entry entry = new UpdateNetworkNotification.SubnetIdMap.Entry();
573 for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
574 String key = mapEntry.getKey();
575 String value = mapEntry.getValue();
577 entry.setValue(value);
578 subnetIdMap.getEntry().add(entry);
584 private QueryNetworkNotification.SubnetIdMap copyQuerySubnetIdMap(Holder<Map<String, String>> hMap) {
586 QueryNetworkNotification.SubnetIdMap subnetIdMap = new QueryNetworkNotification.SubnetIdMap();
588 if (hMap != null && hMap.value != null) {
589 Map<String, String> sMap = hMap.value;
590 QueryNetworkNotification.SubnetIdMap.Entry entry = new QueryNetworkNotification.SubnetIdMap.Entry();
592 for (Map.Entry<String, String> mapEntry : sMap.entrySet()) {
593 String key = mapEntry.getKey();
594 String value = mapEntry.getValue();
596 entry.setValue(value);
597 subnetIdMap.getEntry().add(entry);