import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GENERICRESOURCEAPIService;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationNotificationInput;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationNotificationInputBuilder;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationNotificationOutput;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationTopologyOperationInput;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationTopologyOperationInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationTopologyOperationOutput;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.VnfTopologyOperationInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.VnfTopologyOperationOutput;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.VnfTopologyOperationOutputBuilder;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PnfTopologyOperationInput;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PnfTopologyOperationInputBuilder;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PnfTopologyOperationOutput;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PnfTopologyOperationOutputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.brg.response.information.BrgResponseInformationBuilder;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.connection.attachment.response.information.ConnectionAttachmentResponseInformationBuilder;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.contrail.route.response.information.ContrailRouteResponseInformationBuilder;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.tunnelxconn.response.information.TunnelxconnResponseInformationBuilder;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.vf.module.response.information.VfModuleResponseInformationBuilder;
import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.vnf.response.information.VnfResponseInformationBuilder;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.pnf.response.information.PnfResponseInformationBuilder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
private static final String SERVICE_OBJECT_PATH_PARAM = "service-object-path";
private static final String NETWORK_OBJECT_PATH_PARAM = "network-object-path";
private static final String VNF_OBJECT_PATH_PARAM = "vnf-object-path";
+ private static final String PNF_OBJECT_PATH_PARAM = "pnf-object-path";
private static final String VF_MODULE_OBJECT_PATH_PARAM = "vf-module-object-path";
+ private static final String VF_MODULE_ID_PARAM = "vf-module-id";
private static final String UPDATING_MDSAL_ERROR_MESSAGE = "Caught Exception updating MD-SAL for {} [{}] \n";
private static final String UPDATING_MDSAL_ERROR_MESSAGE_2 = "Caught Exception updating MD-SAL for {} [{},{}] \n";
private static final String RETURNED_FAILED_MESSAGE = "Returned FAILED for {} [{}] {}";
// Each entry will be identifiable by a unique key, we have to create that
// identifier
InstanceIdentifier<Service> path = InstanceIdentifier.builder(Services.class)
- .child(Service.class, entry.getKey()).build();
+ .child(Service.class, entry.key()).build();
trySaveEntry(entry, merge, storeType, path);
}
// Each entry will be identifiable by a unique key, we have to create
// that identifier
InstanceIdentifier<Service> path = InstanceIdentifier.builder(Services.class)
- .child(Service.class, entry.getKey()).build();
+ .child(Service.class, entry.key()).build();
tryDeleteEntry(storeType, path);
}
// Each entry will be identifiable by a unique key, we have to create that
// identifier
InstanceIdentifier.InstanceIdentifierBuilder<PreloadList> preloadListBuilder = InstanceIdentifier
- .<PreloadInformation>builder(PreloadInformation.class).child(PreloadList.class, entry.getKey());
+ .<PreloadInformation>builder(PreloadInformation.class).child(PreloadList.class, entry.key());
InstanceIdentifier<PreloadList> path = preloadListBuilder.build();
int tries = 2;
while (true) {
// Each entry will be identifiable by a unique key, we have to create
// that identifier
InstanceIdentifier<PreloadList> path = InstanceIdentifier.builder(PreloadInformation.class)
- .child(PreloadList.class, entry.getKey()).build();
+ .child(PreloadList.class, entry.key()).build();
tryDeletePreloadListEntry(storeType, path);
}
}
@Override
- public Future<RpcResult<ServiceTopologyOperationOutput>> serviceTopologyOperation(
+ public ListenableFuture<RpcResult<ServiceTopologyOperationOutput>> serviceTopologyOperation(
ServiceTopologyOperationInput input) {
final String svcOperation = "service-topology-operation";
return input.getSdncRequestHeader() != null && input.getSdncRequestHeader().getSvcAction() != null;
}
+
+ @Override
+ public ListenableFuture<RpcResult<PnfTopologyOperationOutput>> pnfTopologyOperation(PnfTopologyOperationInput input) {
+
+ final String svcOperation = "pnf-topology-operation";
+ ServiceData serviceData;
+ ServiceStatusBuilder serviceStatusBuilder = new ServiceStatusBuilder();
+ Properties properties = new Properties();
+
+ log.info(CALLED_STR, svcOperation);
+ // create a new response object
+ PnfTopologyOperationOutputBuilder responseBuilder = new PnfTopologyOperationOutputBuilder();
+
+ if (hasInvalidServiceId(input)) {
+ log.debug(NULL_OR_EMPTY_ERROR_MESSAGE, svcOperation);
+ responseBuilder.setResponseCode("404");
+ responseBuilder.setResponseMessage(NULL_OR_EMPTY_ERROR_PARAM);
+ responseBuilder.setAckFinalIndicator("Y");
+ RpcResult<PnfTopologyOperationOutput> rpcResult = RpcResultBuilder.<PnfTopologyOperationOutput>status(true)
+ .withResult(responseBuilder.build()).build();
+ // return error
+ return Futures.immediateFuture(rpcResult);
+ }
+
+ // Grab the service instance ID from the input buffer
+ String siid = input.getServiceInformation().getServiceInstanceId();
+
+ trySetSvcRequestId(input, responseBuilder);
+
+ /* Comment out mandatory check for pnf id for scenario wherein for assign/create request pnf-id is generated by
+ SDNC itself.
+ if (hasInvalidPnfId(input)) {
+ log.debug("exiting {} because of null or empty pnf-id", svcOperation);
+ responseBuilder.setResponseCode("404");
+ responseBuilder.setResponseMessage("invalid input, null or empty pnf-id");
+ responseBuilder.setAckFinalIndicator("Y");
+
+ RpcResult<PnfTopologyOperationOutput> rpcResult = RpcResultBuilder.<PnfTopologyOperationOutput>status(true)
+ .withResult(responseBuilder.build()).build();
+
+ return Futures.immediateFuture(rpcResult);
+ }
+ */
+
+ String pnfId = input.getPnfDetails().getPnfId();
+ ServiceDataBuilder serviceDataBuilder = new ServiceDataBuilder();
+ getServiceData(siid, serviceDataBuilder);
+
+ ServiceDataBuilder operDataBuilder = new ServiceDataBuilder();
+ getServiceData(siid, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
+
+ // Set the serviceStatus based on input
+ setServiceStatus(serviceStatusBuilder, input.getSdncRequestHeader());
+ setServiceStatus(serviceStatusBuilder, input.getRequestInformation());
+
+ //
+ // setup a service-data object builder
+ // ACTION pnf-topology-operation
+ // INPUT:
+ // USES sdnc-request-header;
+ // USES request-information;
+ // USES service-information;
+ // USES pnf-details
+ // OUTPUT:
+ // USES pnf-topology-response-body;
+ // USES pnf-details
+ // USES service-information
+ //
+ // uses oper-status;
+
+ log.info(ADDING_INPUT_DATA_LOG, svcOperation, siid, input);
+ PnfTopologyOperationInputBuilder inputBuilder = new PnfTopologyOperationInputBuilder(input);
+ GenericResourceApiUtil.toProperties(properties, inputBuilder.build());
+
+ log.info(ADDING_OPERATIONAL_DATA_LOG, svcOperation, siid, operDataBuilder.build());
+ GenericResourceApiUtil.toProperties(properties, OPERATIONAL_DATA_PARAM, operDataBuilder);
+
+ // Call SLI sync method
+
+ ResponseObject responseObject = new ResponseObject("200", "");
+ String ackFinal = "Y";
+ String serviceObjectPath = null;
+ String pnfObjectPath = null;
+ Properties respProps = tryGetProperties(svcOperation, properties, serviceDataBuilder, responseObject);
+
+ if (respProps != null) {
+ responseObject.setMessage(respProps.getProperty(ERROR_MESSAGE_PARAM));
+ responseObject.setStatusCode(respProps.getProperty(ERROR_CODE_PARAM));
+ ackFinal = respProps.getProperty(ACK_FINAL_PARAM, "Y");
+ if (pnfId == null) {
+ pnfId = respProps.getProperty("pnfId");
+ }
+ serviceObjectPath = respProps.getProperty(SERVICE_OBJECT_PATH_PARAM);
+ pnfObjectPath = respProps.getProperty(PNF_OBJECT_PATH_PARAM);
+ }
+
+ setServiceStatus(serviceStatusBuilder, responseObject.getStatusCode(), responseObject.getMessage(), ackFinal);
+ serviceStatusBuilder.setRequestStatus(RequestStatus.Synccomplete);
+ serviceStatusBuilder.setRpcName(svcOperation);
+
+ if (failed(responseObject)) {
+ responseBuilder.setResponseCode(responseObject.getStatusCode());
+ responseBuilder.setResponseMessage(responseObject.getMessage());
+ responseBuilder.setAckFinalIndicator(ackFinal);
+
+ ServiceBuilder serviceBuilder = new ServiceBuilder();
+ serviceBuilder.setServiceInstanceId(siid);
+ serviceBuilder.setServiceStatus(serviceStatusBuilder.build());
+ try {
+ saveService(serviceBuilder.build(), true, LogicalDatastoreType.CONFIGURATION);
+ trySaveService(input, serviceBuilder);
+ } catch (Exception e) {
+ log.error(UPDATING_MDSAL_ERROR_MESSAGE, svcOperation, siid, e);
+ }
+ log.error(RETURNED_FAILED_MESSAGE, svcOperation, siid, responseBuilder.build());
+
+ RpcResult<PnfTopologyOperationOutput> rpcResult = RpcResultBuilder.<PnfTopologyOperationOutput>status(true)
+ .withResult(responseBuilder.build()).build();
+
+ // return error
+ return Futures.immediateFuture(rpcResult);
+ }
+
+ // Got success from SLI
+ try {
+ serviceData = serviceDataBuilder.build();
+ log.info(UPDATING_MDSAL_INFO_MESSAGE, svcOperation, siid, serviceData);
+
+ // service object
+ ServiceBuilder serviceBuilder = new ServiceBuilder();
+ serviceBuilder.setServiceData(serviceData);
+ serviceBuilder.setServiceInstanceId(siid);
+ serviceBuilder.setServiceStatus(serviceStatusBuilder.build());
+ saveService(serviceBuilder.build(), false, LogicalDatastoreType.CONFIGURATION);
+
+ if (isValidRequest(input) && input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Activate)) {
+ // Only update operational tree on Assign
+ log.info(UPDATING_TREE_INFO_MESSAGE);
+ saveService(serviceBuilder.build(), false, LogicalDatastoreType.OPERATIONAL);
+ }
+
+ ServiceResponseInformationBuilder serviceResponseInformationBuilder = new ServiceResponseInformationBuilder();
+ serviceResponseInformationBuilder.setInstanceId(siid);
+ serviceResponseInformationBuilder.setObjectPath(serviceObjectPath);
+ responseBuilder.setServiceResponseInformation(serviceResponseInformationBuilder.build());
+
+ PnfResponseInformationBuilder pnfResponseInformationBuilder = new PnfResponseInformationBuilder();
+ pnfResponseInformationBuilder.setInstanceId(pnfId);
+ pnfResponseInformationBuilder.setObjectPath(pnfObjectPath);
+ responseBuilder.setPnfResponseInformation(pnfResponseInformationBuilder.build());
+
+ } catch (Exception e) {
+ log.error(UPDATING_MDSAL_ERROR_MESSAGE, svcOperation, siid, e);
+ responseBuilder.setResponseCode("500");
+ responseBuilder.setResponseMessage(e.getMessage());
+ responseBuilder.setAckFinalIndicator("Y");
+ log.error(RETURNED_FAILED_MESSAGE, svcOperation, siid, responseBuilder.build());
+
+ RpcResult<PnfTopologyOperationOutput> rpcResult = RpcResultBuilder.<PnfTopologyOperationOutput>status(true)
+ .withResult(responseBuilder.build()).build();
+
+ return Futures.immediateFuture(rpcResult);
+ }
+
+ // Update succeeded
+ responseBuilder.setResponseCode(responseObject.getStatusCode());
+ responseBuilder.setAckFinalIndicator(ackFinal);
+ trySetResponseMessage(responseBuilder, responseObject);
+ log.info(UPDATED_MDSAL_INFO_MESSAGE, svcOperation, siid);
+ log.info(RETURNED_SUCCESS_MESSAGE, svcOperation, siid, responseBuilder.build());
+
+ RpcResult<PnfTopologyOperationOutput> rpcResult = RpcResultBuilder.<PnfTopologyOperationOutput>status(true)
+ .withResult(responseBuilder.build()).build();
+
+ // return success
+ return Futures.immediateFuture(rpcResult);
+ }
+
+ private void trySetResponseMessage(PnfTopologyOperationOutputBuilder responseBuilder,
+ ResponseObject responseObject) {
+ if (responseObject.getMessage() != null) {
+ responseBuilder.setResponseMessage(responseObject.getMessage());
+ }
+ }
+
+ private void trySaveService(PnfTopologyOperationInput input, ServiceBuilder serviceBuilder) {
+ if (isValidRequest(input) && (input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Delete)
+ || input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Activate))) {
+
+ // Only update operational tree on activate or delete
+ log.info(UPDATING_TREE_INFO_MESSAGE);
+ saveService(serviceBuilder.build(), false, LogicalDatastoreType.OPERATIONAL);
+ }
+ }
+
+ private boolean hasInvalidPnfId(PnfTopologyOperationInput input) {
+ return input.getPnfDetails() == null || input.getPnfDetails().getPnfId() == null
+ || input.getPnfDetails().getPnfId().length() == 0;
+ }
+
+ private boolean hasInvalidServiceId(PnfTopologyOperationInput input) {
+ return input == null || input.getServiceInformation() == null
+ || input.getServiceInformation().getServiceInstanceId() == null
+ || input.getServiceInformation().getServiceInstanceId().length() == 0;
+ }
+
+ private void trySetSvcRequestId(PnfTopologyOperationInput input,
+ PnfTopologyOperationOutputBuilder responseBuilder) {
+ if (input.getSdncRequestHeader() != null) {
+ responseBuilder.setSvcRequestId(input.getSdncRequestHeader().getSvcRequestId());
+ }
+ }
+
+ private boolean isValidRequest(PnfTopologyOperationInput input) {
+ return input.getSdncRequestHeader() != null && input.getSdncRequestHeader().getSvcAction() != null;
+ }
+
+
@Override
- public Future<RpcResult<VnfTopologyOperationOutput>> vnfTopologyOperation(VnfTopologyOperationInput input) {
+ public ListenableFuture<RpcResult<VnfTopologyOperationOutput>> vnfTopologyOperation(VnfTopologyOperationInput input) {
final String svcOperation = "vnf-topology-operation";
ServiceData serviceData;
responseObject.setMessage(respProps.getProperty(ERROR_MESSAGE_PARAM));
responseObject.setStatusCode(respProps.getProperty(ERROR_CODE_PARAM));
ackFinal = respProps.getProperty(ACK_FINAL_PARAM, "Y");
+ if (vnfId == null) {
+ vnfId = respProps.getProperty("vnfId");
+ }
serviceObjectPath = respProps.getProperty(SERVICE_OBJECT_PATH_PARAM);
vnfObjectPath = respProps.getProperty(VNF_OBJECT_PATH_PARAM);
}
}
@Override
- public Future<RpcResult<VfModuleTopologyOperationOutput>> vfModuleTopologyOperation(
+ public ListenableFuture<RpcResult<VfModuleTopologyOperationOutput>> vfModuleTopologyOperation(
VfModuleTopologyOperationInput input) {
final String svcOperation = "vf-module-topology-operation";
return Futures.immediateFuture(rpcResult);
}
- if (hasInvalidVfModuleId(input)) {
+ /*if (hasInvalidVfModuleId(input)) {
log.debug("exiting {} because of null or empty vf-module-id", svcOperation);
responseBuilder.setResponseCode("403");
responseBuilder.setResponseMessage("invalid input, vf-module-id is null or empty");
.<VfModuleTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
return Futures.immediateFuture(rpcResult);
- }
+ }*/
// Grab the service instance ID from the input buffer
String siid = input.getServiceInformation().getServiceInstanceId();
responseObject.setStatusCode(respProps.getProperty(ERROR_CODE_PARAM));
responseObject.setMessage(respProps.getProperty(ERROR_MESSAGE_PARAM));
ackFinal = respProps.getProperty(ACK_FINAL_PARAM, "Y");
+ if (vfModuleId == null) {
+ vfModuleId = respProps.getProperty(VF_MODULE_ID_PARAM);
+ if (vfModuleId == null) {
+ log.debug("exiting {} because vf-module-id not found in response", svcOperation);
+ responseBuilder.setResponseCode("403");
+ responseBuilder.setResponseMessage("failed to generate vf-module-id");
+ responseBuilder.setAckFinalIndicator("Y");
+
+ RpcResult<VfModuleTopologyOperationOutput> rpcResult = RpcResultBuilder
+ .<VfModuleTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
+
+ return Futures.immediateFuture(rpcResult);
+ }
+ }
serviceObjectPath = respProps.getProperty(SERVICE_OBJECT_PATH_PARAM);
vnfObjectPath = respProps.getProperty(VNF_OBJECT_PATH_PARAM);
vfModuleObjectPath = respProps.getProperty(VF_MODULE_OBJECT_PATH_PARAM);
}
@Override
- public Future<RpcResult<NetworkTopologyOperationOutput>> networkTopologyOperation(
+ public ListenableFuture<RpcResult<NetworkTopologyOperationOutput>> networkTopologyOperation(
NetworkTopologyOperationInput input) {
final String svcOperation = "network-topology-operation";
|| input.getServiceInformation().getServiceInstanceId().length() == 0;
}
- private Future<RpcResult<NetworkTopologyOperationOutput>> buildRpcResultFuture(
+ private ListenableFuture<RpcResult<NetworkTopologyOperationOutput>> buildRpcResultFuture(
NetworkTopologyOperationOutputBuilder responseBuilder, String responseMessage) {
responseBuilder.setResponseCode("404");
}
@Override
- public Future<RpcResult<ContrailRouteTopologyOperationOutput>> contrailRouteTopologyOperation(
+ public ListenableFuture<RpcResult<ContrailRouteTopologyOperationOutput>> contrailRouteTopologyOperation(
ContrailRouteTopologyOperationInput input) {
final String svcOperation = "contrail-route-topology-operation";
|| input.getServiceInformation().getServiceInstanceId().length() == 0;
}
- private Future<RpcResult<ContrailRouteTopologyOperationOutput>> buildRpcResultFuture(
+ private ListenableFuture<RpcResult<ContrailRouteTopologyOperationOutput>> buildRpcResultFuture(
ContrailRouteTopologyOperationOutputBuilder responseBuilder, String responseMessage) {
responseBuilder.setResponseCode("404");
responseBuilder.setResponseMessage(responseMessage);
}
@Override
- public Future<RpcResult<SecurityZoneTopologyOperationOutput>> securityZoneTopologyOperation(
+ public ListenableFuture<RpcResult<SecurityZoneTopologyOperationOutput>> securityZoneTopologyOperation(
SecurityZoneTopologyOperationInput input) {
final String svcOperation = "security-zone-topology-operation";
|| input.getServiceInformation().getServiceInstanceId().length() == 0;
}
- private Future<RpcResult<SecurityZoneTopologyOperationOutput>> buildRpcResultFuture(
+ private ListenableFuture<RpcResult<SecurityZoneTopologyOperationOutput>> buildRpcResultFuture(
SecurityZoneTopologyOperationOutputBuilder responseBuilder, String responseMessage) {
responseBuilder.setResponseCode("404");
}
}
- private Future<RpcResult<ConnectionAttachmentTopologyOperationOutput>>
+ private ListenableFuture<RpcResult<ConnectionAttachmentTopologyOperationOutput>>
buildRpcResultFuture(ConnectionAttachmentTopologyOperationOutputBuilder responseBuilder, String responseMessage) {
responseBuilder.setResponseCode("404");
}
@Override
- public Future<RpcResult<ConnectionAttachmentTopologyOperationOutput>> connectionAttachmentTopologyOperation(ConnectionAttachmentTopologyOperationInput input) {
+ public ListenableFuture<RpcResult<ConnectionAttachmentTopologyOperationOutput>> connectionAttachmentTopologyOperation(ConnectionAttachmentTopologyOperationInput input) {
final String svcOperation = "connection-attachment-topology-operation";
Properties parms = new Properties();
log.info(CALLED_STR, svcOperation);
}
@Override
- public Future<RpcResult<TunnelxconnTopologyOperationOutput>> tunnelxconnTopologyOperation(
+ public ListenableFuture<RpcResult<TunnelxconnTopologyOperationOutput>> tunnelxconnTopologyOperation(
TunnelxconnTopologyOperationInput input) {
final String svcOperation = "tunnelxconn-topology-operation";
}
@Override
- public Future<RpcResult<BrgTopologyOperationOutput>> brgTopologyOperation(BrgTopologyOperationInput input) {
+ public ListenableFuture<RpcResult<BrgTopologyOperationOutput>> brgTopologyOperation(BrgTopologyOperationInput input) {
final String svcOperation = "brg-topology-operation";
Properties parms = new Properties();
}
@Override
- public Future<RpcResult<PreloadNetworkTopologyOperationOutput>> preloadNetworkTopologyOperation(
+ public ListenableFuture<RpcResult<PreloadNetworkTopologyOperationOutput>> preloadNetworkTopologyOperation(
PreloadNetworkTopologyOperationInput input) {
final String svcOperation = "preload-network-topology-operation";
responseBuilder.setAckFinalIndicator("Y");
log.error(RETURNED_FAILED_MESSAGE, svcOperation, preloadId, responseBuilder.build());
RpcResult<PreloadNetworkTopologyOperationOutput> rpcResult = RpcResultBuilder
- .<PreloadNetworkTopologyOperationOutput>status(false).withResult(responseBuilder.build()).build();
+ .<PreloadNetworkTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
return Futures.immediateFuture(rpcResult);
}
}
@Override
- public Future<RpcResult<PreloadVfModuleTopologyOperationOutput>> preloadVfModuleTopologyOperation(
+ public ListenableFuture<RpcResult<PreloadVfModuleTopologyOperationOutput>> preloadVfModuleTopologyOperation(
PreloadVfModuleTopologyOperationInput input) {
final String svcOperation = "preload-vf-module-topology-operation";
responseBuilder.setAckFinalIndicator("Y");
log.error(RETURNED_FAILED_MESSAGE, svcOperation, preloadId, responseBuilder.build());
RpcResult<PreloadVfModuleTopologyOperationOutput> rpcResult = RpcResultBuilder
- .<PreloadVfModuleTopologyOperationOutput>status(false).withResult(responseBuilder.build()).build();
+ .<PreloadVfModuleTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
return Futures.immediateFuture(rpcResult);
}
}
@Override
- public Future<RpcResult<GenericConfigurationTopologyOperationOutput>> genericConfigurationTopologyOperation(
+ public ListenableFuture<RpcResult<GenericConfigurationTopologyOperationOutput>> genericConfigurationTopologyOperation(
GenericConfigurationTopologyOperationInput input) {
final String svcOperation = "generic-configuration-topology-operation";
}
@Override
- public Future<RpcResult<Void>> genericConfigurationNotification(GenericConfigurationNotificationInput input) {
+ public ListenableFuture<RpcResult<GenericConfigurationNotificationOutput>> genericConfigurationNotification(GenericConfigurationNotificationInput input) {
final String svcOperation = "generic-configuration-notification";
ServiceData serviceData;
} catch (Exception e) {
log.error(UPDATING_MDSAL_ERROR_MESSAGE, svcOperation, siid, e);
}
+
+
+
- RpcResult<Void> rpcResult = RpcResultBuilder.<Void>status(true).build();
+ RpcResult<GenericConfigurationNotificationOutput> rpcResult = RpcResultBuilder.<GenericConfigurationNotificationOutput>status(true).build();
return Futures.immediateFuture(rpcResult);
}
} catch (Exception e) {
log.error(UPDATING_MDSAL_ERROR_MESSAGE, svcOperation, siid, e);
- RpcResult<Void> rpcResult = RpcResultBuilder.<Void>status(true).build();
+ RpcResult<GenericConfigurationNotificationOutput> rpcResult = RpcResultBuilder.<GenericConfigurationNotificationOutput>status(true).build();
return Futures.immediateFuture(rpcResult);
}
// Update succeeded
log.info(UPDATED_MDSAL_INFO_MESSAGE, svcOperation, siid);
- RpcResult<Void> rpcResult = RpcResultBuilder.<Void>status(true).build();
+ RpcResult<GenericConfigurationNotificationOutput> rpcResult = RpcResultBuilder.<GenericConfigurationNotificationOutput>status(true).build();
return Futures.immediateFuture(rpcResult);
}
@Override
- public Future<RpcResult<GetpathsegmentTopologyOperationOutput>> getpathsegmentTopologyOperation(
+ public ListenableFuture<RpcResult<GetpathsegmentTopologyOperationOutput>> getpathsegmentTopologyOperation(
GetpathsegmentTopologyOperationInput input) {
final String svcOperation = "getpathsegment-topology-operation";
}
@Override
- public Future<RpcResult<PolicyUpdateNotifyOperationOutput>> policyUpdateNotifyOperation(
+ public ListenableFuture<RpcResult<PolicyUpdateNotifyOperationOutput>> policyUpdateNotifyOperation(
PolicyUpdateNotifyOperationInput input) {
final String svcOperation = "policy-update-notify-operation";
}
@Override
- public Future<RpcResult<PortMirrorTopologyOperationOutput>> portMirrorTopologyOperation(
+ public ListenableFuture<RpcResult<PortMirrorTopologyOperationOutput>> portMirrorTopologyOperation(
final PortMirrorTopologyOperationInput input) {
final String svcOperation = "port-mirror-topology-operation";
}
@Override
- public Future<RpcResult<VnfGetResourceRequestOutput>> vnfGetResourceRequest(VnfGetResourceRequestInput input) {
+ public ListenableFuture<RpcResult<VnfGetResourceRequestOutput>> vnfGetResourceRequest(VnfGetResourceRequestInput input) {
final String svcOperation = "vnf-get-resource-request";
ServiceData serviceData;