2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
20 package org.onap.so.sdncsimulator.providers;
22 import static org.onap.sdnc.northbound.client.model.GenericResourceApiOrderStatusEnumeration.CREATED;
23 import static org.onap.sdnc.northbound.client.model.GenericResourceApiOrderStatusEnumeration.PENDINGCREATE;
24 import static org.onap.sdnc.northbound.client.model.GenericResourceApiRequestStatusEnumeration.SYNCCOMPLETE;
25 import static org.onap.so.sdncsimulator.utils.Constants.RESTCONF_CONFIG_END_POINT;
26 import static org.onap.so.sdncsimulator.utils.Constants.SERVICE_DATA_VNFS_VNF;
27 import static org.onap.so.sdncsimulator.utils.Constants.SERVICE_TOPOLOGY_OPERATION;
28 import static org.onap.so.sdncsimulator.utils.Constants.SERVICE_TOPOLOGY_OPERATION_CACHE;
29 import static org.onap.so.sdncsimulator.utils.Constants.VNF_DATA_VNF_TOPOLOGY;
30 import static org.onap.so.sdncsimulator.utils.Constants.YES;
31 import static org.onap.so.sdncsimulator.utils.ObjectUtils.getString;
32 import static org.onap.so.sdncsimulator.utils.ObjectUtils.getStringOrNull;
33 import static org.onap.so.sdncsimulator.utils.ObjectUtils.isValid;
34 import java.time.LocalDateTime;
35 import java.util.ArrayList;
36 import java.util.List;
37 import java.util.Optional;
38 import javax.validation.Valid;
39 import org.onap.sdnc.northbound.client.model.GenericResourceApiInstanceReference;
40 import org.onap.sdnc.northbound.client.model.GenericResourceApiLastActionEnumeration;
41 import org.onap.sdnc.northbound.client.model.GenericResourceApiLastRpcActionEnumeration;
42 import org.onap.sdnc.northbound.client.model.GenericResourceApiOnapmodelinformationOnapModelInformation;
43 import org.onap.sdnc.northbound.client.model.GenericResourceApiOperStatusData;
44 import org.onap.sdnc.northbound.client.model.GenericResourceApiOrderStatusEnumeration;
45 import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation;
46 import org.onap.sdnc.northbound.client.model.GenericResourceApiRpcActionEnumeration;
47 import org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader;
48 import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
49 import org.onap.sdnc.northbound.client.model.GenericResourceApiServicedataServiceData;
50 import org.onap.sdnc.northbound.client.model.GenericResourceApiServicedataServicedataVnfs;
51 import org.onap.sdnc.northbound.client.model.GenericResourceApiServicedataServicedataVnfsVnf;
52 import org.onap.sdnc.northbound.client.model.GenericResourceApiServicedataServicedataVnfsVnfVnfData;
53 import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation;
54 import org.onap.sdnc.northbound.client.model.GenericResourceApiServicemodelinfrastructureService;
55 import org.onap.sdnc.northbound.client.model.GenericResourceApiServicestatusServiceStatus;
56 import org.onap.sdnc.northbound.client.model.GenericResourceApiServicetopologyServiceTopology;
57 import org.onap.sdnc.northbound.client.model.GenericResourceApiServicetopologyidentifierServiceTopologyIdentifier;
58 import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
59 import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfinformationVnfInformation;
60 import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfrequestinputVnfRequestInput;
61 import org.onap.sdnc.northbound.client.model.GenericResourceApiVnftopologyVnfTopology;
62 import org.onap.sdnc.northbound.client.model.GenericResourceApiVnftopologyidentifierstructureVnfTopologyIdentifierStructure;
63 import org.onap.so.sdncsimulator.models.Output;
64 import org.onap.so.simulator.cache.provider.AbstractCacheServiceProvider;
65 import org.slf4j.Logger;
66 import org.slf4j.LoggerFactory;
67 import org.springframework.beans.factory.annotation.Autowired;
68 import org.springframework.cache.Cache;
69 import org.springframework.cache.CacheManager;
70 import org.springframework.http.HttpStatus;
71 import org.springframework.stereotype.Service;
74 * @author Waqas Ikram (waqas.ikram@est.tech)
78 public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServiceProvider
79 implements ServiceOperationsCacheServiceProvider {
81 private static final String EMPTY_STRING = "";
82 private static final Logger LOGGER = LoggerFactory.getLogger(ServiceOperationsCacheServiceProviderimpl.class);
85 public ServiceOperationsCacheServiceProviderimpl(final CacheManager cacheManager) {
90 public Output putServiceOperationInformation(final GenericResourceApiServiceOperationInformation input) {
92 final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader();
93 final String svcRequestId = getSvcRequestId(requestHeader);
95 final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation();
96 if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId())) {
97 final Cache cache = getCache(SERVICE_TOPOLOGY_OPERATION_CACHE);
98 final String serviceInstanceId = serviceInformation.getServiceInstanceId();
99 LOGGER.info("Adding GenericResourceApiServiceOperationInformation to cache with key: {}",
102 final GenericResourceApiServicemodelinfrastructureService service =
103 getServiceItem(input, serviceInstanceId);
104 cache.put(serviceInstanceId, service);
106 final GenericResourceApiServicestatusServiceStatus serviceStatus = service.getServiceStatus();
108 return new Output().ackFinalIndicator(serviceStatus.getFinalIndicator())
109 .responseCode(serviceStatus.getResponseCode()).responseMessage(serviceStatus.getResponseMessage())
110 .svcRequestId(svcRequestId).serviceResponseInformation(new GenericResourceApiInstanceReference()
111 .instanceId(serviceInstanceId).objectPath(getObjectPath(serviceInstanceId)));
115 "Unable to add GenericResourceApiServiceOperationInformation in cache due to invalid input: {}... ",
117 return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.BAD_REQUEST.toString())
118 .responseMessage("Service instance not found").svcRequestId(svcRequestId);
122 public Output deleteServiceOperationInformation(final GenericResourceApiServiceOperationInformation input) {
123 final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation();
124 final String svcRequestId = getSvcRequestId(input.getSdncRequestHeader());
126 if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId())) {
127 final String serviceInstanceId = serviceInformation.getServiceInstanceId();
128 final Optional<GenericResourceApiServicemodelinfrastructureService> optional =
129 getGenericResourceApiServicemodelinfrastructureService(serviceInstanceId);
130 if (optional.isPresent()) {
131 final Cache cache = getCache(SERVICE_TOPOLOGY_OPERATION_CACHE);
132 LOGGER.info("Deleting GenericResourceApiServiceOperationInformation from cache using key: {}",
134 cache.evict(serviceInstanceId);
135 return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.OK.toString())
136 .responseMessage(EMPTY_STRING).svcRequestId(svcRequestId).serviceResponseInformation(
137 new GenericResourceApiInstanceReference().instanceId(serviceInstanceId));
140 "Unable to find existing GenericResourceApiServiceModelInfrastructure in cache using service instance id: {}",
144 LOGGER.error("Unable to remove service instance from cache due to invalid input: {}... ", input);
145 return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.BAD_REQUEST.toString())
146 .responseMessage("Unable to remove service").svcRequestId(svcRequestId);
150 public Optional<GenericResourceApiServicemodelinfrastructureService> getGenericResourceApiServicemodelinfrastructureService(
151 final String serviceInstanceId) {
152 final Cache cache = getCache(SERVICE_TOPOLOGY_OPERATION_CACHE);
154 final GenericResourceApiServicemodelinfrastructureService value =
155 cache.get(serviceInstanceId, GenericResourceApiServicemodelinfrastructureService.class);
157 LOGGER.info("Found {} in cahce for service instance id: {}", value, serviceInstanceId);
158 return Optional.of(value);
160 LOGGER.error("Unable to find GenericResourceApiServiceModelInfrastructure in cache for service instance id: {}",
162 return Optional.empty();
166 public Output putVnfOperationInformation(final GenericResourceApiVnfOperationInformation input) {
168 final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation();
169 final GenericResourceApiVnfinformationVnfInformation vnfInformation = input.getVnfInformation();
171 final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader();
172 final String svcRequestId = getSvcRequestId(requestHeader);
174 if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId()) && vnfInformation != null
175 && isValid(vnfInformation.getVnfId())) {
176 final String serviceInstanceId = serviceInformation.getServiceInstanceId();
177 final String vnfId = vnfInformation.getVnfId();
178 final Optional<GenericResourceApiServicemodelinfrastructureService> optional =
179 getGenericResourceApiServicemodelinfrastructureService(serviceInstanceId);
180 if (optional.isPresent()) {
181 final GenericResourceApiServicemodelinfrastructureService service = optional.get();
182 final GenericResourceApiServicedataServiceData serviceData = service.getServiceData();
183 if (serviceData != null) {
184 final List<GenericResourceApiServicedataServicedataVnfsVnf> vnfsList = getVnfs(serviceData);
185 final GenericResourceApiLastRpcActionEnumeration svcAction =
186 GenericResourceApiLastRpcActionEnumeration.fromValue(getSvcAction(requestHeader));
188 if (ifVnfNotExists(vnfId, svcAction, vnfsList)) {
189 vnfsList.add(getGenericResourceApiServicedataVnf(serviceInstanceId, vnfId, input));
191 final GenericResourceApiServicestatusServiceStatus serviceStatus = service.getServiceStatus();
193 return new Output().ackFinalIndicator(serviceStatus.getFinalIndicator())
194 .responseCode(serviceStatus.getResponseCode())
195 .responseMessage(serviceStatus.getResponseMessage()).svcRequestId(svcRequestId)
196 .serviceResponseInformation(new GenericResourceApiInstanceReference()
197 .instanceId(serviceInstanceId).objectPath(getObjectPath(serviceInstanceId)))
198 .vnfResponseInformation(new GenericResourceApiInstanceReference().instanceId(vnfId)
199 .objectPath(getObjectPath(serviceInstanceId, vnfId)));
201 LOGGER.error("vnfId: {} already exists with SVC Action: {}", vnfId, svcAction);
202 return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.BAD_REQUEST.toString())
203 .responseMessage("vnfId: " + vnfId + " already exists").svcRequestId(svcRequestId);
207 "Unable to find existing GenericResourceApiServiceModelInfrastructure in cache using service instance id: {}",
212 "Unable to add GenericResourceApiServiceOperationInformation in cache due to invalid input: {}... ",
214 return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.BAD_REQUEST.toString())
215 .responseMessage("Unable to add vnf").svcRequestId(svcRequestId);
219 public Output deleteVnfOperationInformation(final GenericResourceApiVnfOperationInformation input) {
220 final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation();
221 final GenericResourceApiVnfinformationVnfInformation vnfInformation = input.getVnfInformation();
223 final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader();
224 final String svcRequestId = getSvcRequestId(requestHeader);
226 if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId()) && vnfInformation != null
227 && isValid(vnfInformation.getVnfId())) {
228 final String serviceInstanceId = serviceInformation.getServiceInstanceId();
229 final String vnfId = vnfInformation.getVnfId();
230 final Optional<GenericResourceApiServicemodelinfrastructureService> optional =
231 getGenericResourceApiServicemodelinfrastructureService(serviceInstanceId);
232 if (optional.isPresent()) {
233 final GenericResourceApiServicemodelinfrastructureService service = optional.get();
234 final GenericResourceApiServicedataServiceData serviceData = service.getServiceData();
235 if (serviceData != null) {
236 final List<GenericResourceApiServicedataServicedataVnfsVnf> vnfsList = getVnfs(serviceData);
237 final Optional<GenericResourceApiServicedataServicedataVnfsVnf> vnfInstanceOptional =
238 getExistingVnf(vnfId, vnfsList);
240 if (vnfInstanceOptional.isPresent()) {
241 vnfsList.removeIf(vnf -> {
242 final String existingVnfId = vnf.getVnfId();
243 if (existingVnfId != null && existingVnfId.equals(vnfId)) {
244 LOGGER.info("Remove vnf with id: {} ... ", existingVnfId);
250 return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.OK.toString())
251 .responseMessage(EMPTY_STRING).svcRequestId(svcRequestId)
252 .serviceResponseInformation(
253 new GenericResourceApiInstanceReference().instanceId(serviceInstanceId))
254 .vnfResponseInformation(new GenericResourceApiInstanceReference().instanceId(vnfId));
260 "Unable to find existing GenericResourceApiServiceModelInfrastructure in cache using service instance id: {}",
264 LOGGER.error("Unable to remove vnf instance from cache due to invalid input: {}... ", input);
265 return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.BAD_REQUEST.toString())
266 .responseMessage("Unable to remove vnf").svcRequestId(svcRequestId);
270 private String getSvcRequestId(final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader) {
271 return requestHeader != null ? requestHeader.getSvcRequestId() : null;
275 public void clearAll() {
276 clearCache(SERVICE_TOPOLOGY_OPERATION_CACHE);
279 private String getObjectPath(final String serviceInstanceId, final String vnfId) {
280 return getObjectPath(serviceInstanceId) + SERVICE_DATA_VNFS_VNF + vnfId + VNF_DATA_VNF_TOPOLOGY;
283 private String getObjectPath(final String serviceInstanceId) {
284 return RESTCONF_CONFIG_END_POINT + serviceInstanceId;
288 private boolean ifVnfNotExists(final String vnfId, final GenericResourceApiLastRpcActionEnumeration svcAction,
289 final List<GenericResourceApiServicedataServicedataVnfsVnf> vnfsList) {
290 final Optional<GenericResourceApiServicedataServicedataVnfsVnf> optional = getExistingVnf(vnfId, vnfsList);
291 if (optional.isPresent()) {
292 final GenericResourceApiServicedataServicedataVnfsVnf existingVnf = optional.get();
293 final GenericResourceApiServicedataServicedataVnfsVnfVnfData vnfData = existingVnf.getVnfData();
295 if (vnfData != null && vnfData.getVnfLevelOperStatus() != null
296 && vnfData.getVnfLevelOperStatus().getLastRpcAction() != null) {
297 final GenericResourceApiLastRpcActionEnumeration existingVnflastRpcAction =
298 vnfData.getVnfLevelOperStatus().getLastRpcAction();
299 if (existingVnflastRpcAction.equals(svcAction)) {
300 LOGGER.error("Found vnf with id: {} and LastRpcAction: {} same as SvcAction: {}", vnfId,
301 existingVnflastRpcAction, svcAction);
304 LOGGER.warn("Will remove and replace existing vnf with id: {} as SvcAction is changed from {} to {}",
305 vnfId, existingVnflastRpcAction, svcAction);
306 vnfsList.removeIf(vnf -> vnf.getVnfId() != null && vnf.getVnfId().equals(vnfId));
314 private Optional<GenericResourceApiServicedataServicedataVnfsVnf> getExistingVnf(final String vnfId,
315 final List<GenericResourceApiServicedataServicedataVnfsVnf> vnfsList) {
316 return vnfsList.stream().filter(vnf -> vnf.getVnfId() != null && vnf.getVnfId().equals(vnfId)).findFirst();
319 private List<GenericResourceApiServicedataServicedataVnfsVnf> getVnfs(
320 final GenericResourceApiServicedataServiceData serviceData) {
321 GenericResourceApiServicedataServicedataVnfs vnfs = serviceData.getVnfs();
323 vnfs = new GenericResourceApiServicedataServicedataVnfs();
324 serviceData.setVnfs(vnfs);
327 List<GenericResourceApiServicedataServicedataVnfsVnf> vnfsList = vnfs.getVnf();
328 if (vnfsList == null) {
329 vnfsList = new ArrayList<>();
330 vnfs.setVnf(vnfsList);
335 private GenericResourceApiServicedataServicedataVnfsVnf getGenericResourceApiServicedataVnf(
336 final String serviceInstanceId, final String vnfId, final GenericResourceApiVnfOperationInformation input) {
337 return new GenericResourceApiServicedataServicedataVnfsVnf().vnfId(vnfId).vnfData(getVnfData(input));
340 private GenericResourceApiServicedataServicedataVnfsVnfVnfData getVnfData(
341 final GenericResourceApiVnfOperationInformation input) {
343 final GenericResourceApiServicedataServicedataVnfsVnfVnfData vnfData =
344 new GenericResourceApiServicedataServicedataVnfsVnfVnfData();
346 vnfData.vnfLevelOperStatus(
347 getServiceLevelOperStatus(PENDINGCREATE, input.getRequestInformation(), input.getSdncRequestHeader()));
348 vnfData.serviceInformation(input.getServiceInformation());
349 vnfData.sdncRequestHeader(input.getSdncRequestHeader());
350 vnfData.vnfInformation(input.getVnfInformation());
351 vnfData.requestInformation(input.getRequestInformation());
352 vnfData.vnfRequestInput(input.getVnfRequestInput());
354 vnfData.vnfTopology(getVnfTopology(input.getVnfInformation(), input.getVnfRequestInput()));
359 private GenericResourceApiVnftopologyVnfTopology getVnfTopology(
360 final GenericResourceApiVnfinformationVnfInformation vnfInformation,
361 final GenericResourceApiVnfrequestinputVnfRequestInput vnfRequestInput) {
363 final GenericResourceApiVnftopologyVnfTopology apiVnftopologyVnfTopology =
364 new GenericResourceApiVnftopologyVnfTopology();
366 if (vnfInformation != null) {
367 apiVnftopologyVnfTopology.onapModelInformation(vnfInformation.getOnapModelInformation());
368 apiVnftopologyVnfTopology.vnfTopologyIdentifierStructure(getTopologyIdentifierStructure(vnfInformation));
370 if (vnfRequestInput != null) {
371 apiVnftopologyVnfTopology.tenant(vnfRequestInput.getTenant());
372 apiVnftopologyVnfTopology.aicClli(vnfRequestInput.getAicClli());
373 apiVnftopologyVnfTopology.aicCloudRegion(vnfRequestInput.getAicCloudRegion());
375 return apiVnftopologyVnfTopology;
378 private GenericResourceApiVnftopologyidentifierstructureVnfTopologyIdentifierStructure getTopologyIdentifierStructure(
379 @Valid final GenericResourceApiVnfinformationVnfInformation vnfInformation) {
380 return new GenericResourceApiVnftopologyidentifierstructureVnfTopologyIdentifierStructure()
381 .vnfId(vnfInformation.getVnfId()).vnfName(vnfInformation.getVnfName())
382 .vnfType(vnfInformation.getVnfType());
385 private GenericResourceApiServicemodelinfrastructureService getServiceItem(
386 final GenericResourceApiServiceOperationInformation input, final String serviceInstanceId) {
388 final GenericResourceApiServicedataServiceData apiServicedataServiceData =
389 new GenericResourceApiServicedataServiceData();
391 apiServicedataServiceData.requestInformation(input.getRequestInformation());
392 apiServicedataServiceData.serviceRequestInput(input.getServiceRequestInput());
393 apiServicedataServiceData.serviceInformation(input.getServiceInformation());
394 apiServicedataServiceData.serviceTopology(getServiceTopology(input));
395 apiServicedataServiceData.sdncRequestHeader(input.getSdncRequestHeader());
396 apiServicedataServiceData.serviceLevelOperStatus(getServiceLevelOperStatus(input));
398 final GenericResourceApiServicestatusServiceStatus serviceStatus =
399 getServiceStatus(getSvcAction(input.getSdncRequestHeader()),
400 getRequestAction(input.getRequestInformation()), HttpStatus.OK.toString());
402 return new GenericResourceApiServicemodelinfrastructureService().serviceData(apiServicedataServiceData)
403 .serviceStatus(serviceStatus).serviceInstanceId(serviceInstanceId);
406 private String getSvcAction(final GenericResourceApiSdncrequestheaderSdncRequestHeader input) {
407 return input != null ? getStringOrNull(input.getSvcAction()) : null;
410 private GenericResourceApiServicestatusServiceStatus getServiceStatus(final String rpcAction, final String action,
411 final String responseCode) {
412 return new GenericResourceApiServicestatusServiceStatus().finalIndicator(YES)
413 .rpcAction(GenericResourceApiRpcActionEnumeration.fromValue(rpcAction))
414 .rpcName(SERVICE_TOPOLOGY_OPERATION).responseTimestamp(LocalDateTime.now().toString())
415 .responseCode(responseCode).requestStatus(SYNCCOMPLETE).responseMessage(EMPTY_STRING).action(action);
418 private GenericResourceApiOperStatusData getServiceLevelOperStatus(
419 final GenericResourceApiServiceOperationInformation input) {
420 return getServiceLevelOperStatus(CREATED, input.getRequestInformation(), input.getSdncRequestHeader());
423 private GenericResourceApiOperStatusData getServiceLevelOperStatus(
424 final GenericResourceApiOrderStatusEnumeration statusEnumeration,
425 final GenericResourceApiRequestinformationRequestInformation requestInformation,
426 final GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader) {
427 return new GenericResourceApiOperStatusData().orderStatus(statusEnumeration)
428 .lastAction(GenericResourceApiLastActionEnumeration.fromValue(getRequestAction(requestInformation)))
429 .lastRpcAction(GenericResourceApiLastRpcActionEnumeration.fromValue(getSvcAction(sdncRequestHeader)));
432 private String getRequestAction(final GenericResourceApiRequestinformationRequestInformation input) {
433 return getRequestAction(input, EMPTY_STRING);
436 private String getRequestAction(final GenericResourceApiRequestinformationRequestInformation input,
437 final String defaultValue) {
438 return input != null ? getString(input.getRequestAction(), defaultValue) : defaultValue;
441 private GenericResourceApiServicetopologyServiceTopology getServiceTopology(
442 final GenericResourceApiServiceOperationInformation input) {
443 final GenericResourceApiOnapmodelinformationOnapModelInformation modelInformation =
444 input.getServiceInformation() != null ? input.getServiceInformation().getOnapModelInformation() : null;
445 return new GenericResourceApiServicetopologyServiceTopology().onapModelInformation(modelInformation)
446 .serviceTopologyIdentifier(getServiceTopologyIdentifier(input));
449 private GenericResourceApiServicetopologyidentifierServiceTopologyIdentifier getServiceTopologyIdentifier(
450 final GenericResourceApiServiceOperationInformation input) {
451 final GenericResourceApiServicetopologyidentifierServiceTopologyIdentifier identifier =
452 new GenericResourceApiServicetopologyidentifierServiceTopologyIdentifier();
454 if (input.getServiceInformation() != null) {
455 final GenericResourceApiServiceinformationServiceInformation serviceInformation =
456 input.getServiceInformation();
457 identifier.globalCustomerId(serviceInformation.getGlobalCustomerId())
458 .serviceType(input.getServiceInformation().getSubscriptionServiceType())
459 .serviceInstanceId(input.getServiceInformation().getServiceInstanceId());;
462 if (input.getServiceRequestInput() != null) {
463 identifier.serviceInstanceName(input.getServiceRequestInput().getServiceInstanceName());