+ @Override
+ public final ListenableFuture<RpcResult<ServiceCreateBulkOutput>> serviceCreateBulk(ServiceCreateBulkInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<ServiceCreateBulkOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<TempServiceCreateBulkOutput>> tempServiceCreateBulk(
+ TempServiceCreateBulkInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<TempServiceCreateBulkOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<
+ ServiceRollResultNotificationRequestOutput>> serviceRollResultNotificationRequest(
+ ServiceRollResultNotificationRequestInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<ServiceRollResultNotificationRequestOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<ServiceReconfigureBulkOutput>> serviceReconfigureBulk(
+ ServiceReconfigureBulkInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<ServiceReconfigureBulkOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<ServiceReconfigureResultNotificationRequestOutput>>
+ serviceReconfigureResultNotificationRequest(ServiceReconfigureResultNotificationRequestInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<ServiceReconfigureResultNotificationRequestOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<ServiceRestorationResultNotificationRequestOutput>>
+ serviceRestorationResultNotificationRequest(ServiceRestorationResultNotificationRequestInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<ServiceRestorationResultNotificationRequestOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<ServiceReversionResultNotificationRequestOutput>>
+ serviceReversionResultNotificationRequest(ServiceReversionResultNotificationRequestInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<ServiceReversionResultNotificationRequestOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<ServiceRerouteConfirmResultNotificationRequestOutput>>
+ serviceRerouteConfirmResultNotificationRequest(ServiceRerouteConfirmResultNotificationRequestInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<ServiceRerouteConfirmResultNotificationRequestOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<
+ OpticalTunnelCreateOutput>> opticalTunnelCreate(OpticalTunnelCreateInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<OpticalTunnelCreateOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<OpticalTunnelRequestCancelOutput>> opticalTunnelRequestCancel(
+ OpticalTunnelRequestCancelInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<OpticalTunnelRequestCancelOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ /**
+ * Implementation of the RPC to set OR operational modes in the catalog of the controller.
+ * Semantics of the RPC is such that the information in the input replaces the full content
+ * of the OR operational modes catalog in the config data store. Incremental changes to the
+ * catalog, if required, must be done via individual PUT/POST/DELETE RESTconf APIs.
+ *
+ * @param input AddOpenroadmOperationalModesToCatalogInput to be added to Catalog
+ * @return Result of the request
+ */
+ public final ListenableFuture<RpcResult<AddOpenroadmOperationalModesToCatalogOutput>>
+ addOpenroadmOperationalModesToCatalog(AddOpenroadmOperationalModesToCatalogInput input) {
+
+ LOG.info("RPC addOpenroadmOperationalModesToCatalog in progress");
+ LOG.debug(" Input openRoadm {}", input);
+ // Validation
+ OperationResult validationResult = CatalogValidation.validateORCatalogRequest(
+ new CatalogInput(input), RpcActions.FillCatalogWithOrOperationalModes);
+ if (! validationResult.isSuccess()) {
+ LOG.warn(ADD_OR_TO_CATALOG_MSG, LogMessages.ABORT_OR_TO_CATALOG_FAILED);
+ return ModelMappingUtils.addOpenroadmServiceReply(
+ input, ResponseCodes.FINAL_ACK_YES,
+ validationResult.getResultMessage(), ResponseCodes.RESPONSE_FAILED);
+ }
+ LOG.info(" Request System Id {} " ,input.getSdncRequestHeader().getRequestSystemId());
+ LOG.info(" Rpc Action {} " ,input.getSdncRequestHeader().getRpcAction());
+
+ OpenroadmOperationalModes objToSave = CatalogMapper.createORModesToSave(input);
+ catalogDataStoreOperations.addOpenroadmOperationalModesToCatalog(objToSave);
+ LOG.info("RPC addOpenroadmOperationalModesToCatalog Completed");
+ return ModelMappingUtils.addOpenroadmServiceReply(input, ResponseCodes.FINAL_ACK_YES,
+ validationResult.getResultMessage(), ResponseCodes.RESPONSE_OK);
+ }
+
+ @Override
+ /**
+ * Implementation of the RPC to set specific operational modes in the catalog of the controller.
+ * Semantics of the RPC is such that the information in the input replaces the full content
+ * of the specific operational modes catalog in the config data store. Incremental changes to the
+ * catalog, if required, must be done via individual PUT/POST/DELETE RESTconf APIs.
+ *
+ * @param input AddSpecificOperationalModesToCatalogInput to be added to Catalog
+ * @return Result of the request
+ */
+ public final ListenableFuture<RpcResult<AddSpecificOperationalModesToCatalogOutput>>
+ addSpecificOperationalModesToCatalog(AddSpecificOperationalModesToCatalogInput input) {
+
+ LOG.info("RPC addSpecificOperationalModesToCatalog in progress");
+ LOG.debug(" Input openSpecificRoadm {}", input);
+ // Validation
+ OperationResult validationResult = CatalogValidation.validateSpecificCatalogRequest(
+ new CatalogInput(input), RpcActions.FillCatalogWithSpecificOperationalModes);
+ if (! validationResult.isSuccess()) {
+ LOG.warn(ADD_SPECIFIC_TO_CATALOG_MSG, LogMessages.ABORT_SPECIFIC_TO_CATALOG_FAILED);
+ return ModelMappingUtils.addSpecificOpenroadmServiceReply(
+ input, ResponseCodes.FINAL_ACK_YES,
+ validationResult.getResultMessage(), ResponseCodes.RESPONSE_FAILED);
+ }
+ LOG.info(" Request System Id {} " ,input.getSdncRequestHeader().getRequestSystemId());
+ LOG.info(" Rpc Action {} " ,input.getSdncRequestHeader().getRpcAction());
+
+ SpecificOperationalModes objToSave = CatalogMapper.createSpecificModesToSave(input);
+ catalogDataStoreOperations.addSpecificOperationalModesToCatalog(objToSave);
+ LOG.info("RPC addSpecificOperationalModesToCatalog Completed");
+ return ModelMappingUtils.addSpecificOpenroadmServiceReply(input, ResponseCodes.FINAL_ACK_YES,
+ validationResult.getResultMessage(), ResponseCodes.RESPONSE_OK);
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<ServiceSrlgGetOutput>> serviceSrlgGet(ServiceSrlgGetInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<ServiceSrlgGetOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<EndTerminalPerformanceInfoRequestOutput>> endTerminalPerformanceInfoRequest(
+ EndTerminalPerformanceInfoRequestInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<EndTerminalPerformanceInfoRequestOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<EndTerminalActivationRequestOutput>> endTerminalActivationRequest(
+ EndTerminalActivationRequestInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<EndTerminalActivationRequestOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<EndTerminalDeactivationRequestOutput>> endTerminalDeactivationRequest(
+ EndTerminalDeactivationRequestInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<EndTerminalDeactivationRequestOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ @Override
+ public final ListenableFuture<RpcResult<EndTerminalPowerControlOutput>> endTerminalPowerControl(
+ EndTerminalPowerControlInput input) {
+ // TODO Auto-generated method stub
+ return RpcResultBuilder.<EndTerminalPowerControlOutput>failed()
+ .withError(ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED, "RPC not implemented yet")
+ .buildFuture();
+ }
+
+ public Registration getRegisteredRpc() {
+ return reg;
+ }
+
+ /**
+ * Send notification to NBI notification in order to publish message.
+ * @param service PublishNotificationService
+ */
+ private void sendNbiNotification(PublishNotificationProcessService service) {
+ try {
+ notificationPublishService.putNotification(service);
+ } catch (InterruptedException e) {
+ LOG.warn("Cannot send notification to nbi", e);
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ private ImmutableClassToInstanceMap<Rpc<?, ?>> registerRPCs() {
+ return ImmutableClassToInstanceMap.<Rpc<?, ?>>builder()
+ .put(ServiceCreate.class, this::serviceCreate)
+ .put(ServiceDelete.class, this::serviceDelete)
+ .put(ServiceFeasibilityCheck.class, this::serviceFeasibilityCheck)
+ .put(ServiceReconfigure.class, this::serviceReconfigure)
+ .put(ServiceRestoration.class, this::serviceRestoration)
+ .put(EquipmentNotification.class, this::equipmentNotification)
+ .put(ServiceRerouteConfirm.class, this::serviceRerouteConfirm)
+ .put(ServiceReroute.class, this::serviceReroute)
+ .put(ServiceReversion.class, this::serviceReversion)
+ .put(ServiceRoll.class, this::serviceRoll)
+ .put(NetworkReOptimization.class, this::networkReOptimization)
+ .put(TempServiceDelete.class, this::tempServiceDelete)
+ .put(TempServiceCreate.class, this::tempServiceCreate)
+ .put(ServiceDeleteComplexResultNotificationRequest.class,
+ this::serviceDeleteComplexResultNotificationRequest)
+ .put(ServiceCreateResultNotificationRequest.class, this::serviceCreateResultNotificationRequest)
+ .put(ServiceDeleteResultNotificationRequest.class, this::serviceDeleteResultNotificationRequest)
+ .put(ServiceCreateComplexResultNotificationRequest.class,
+ this::serviceCreateComplexResultNotificationRequest)
+ .put(ServiceFeasibilityCheckBulk.class, this::serviceFeasibilityCheckBulk)
+ .put(ServiceCreateBulk.class, this::serviceCreateBulk)
+ .put(TempServiceCreateBulk.class, this::tempServiceCreateBulk)
+ .put(ServiceRollResultNotificationRequest.class, this::serviceRollResultNotificationRequest)
+ .put(ServiceReconfigureBulk.class, this::serviceReconfigureBulk)
+ .put(ServiceReconfigureResultNotificationRequest.class, this::serviceReconfigureResultNotificationRequest)
+ .put(ServiceRestorationResultNotificationRequest.class, this::serviceRestorationResultNotificationRequest)
+ .put(ServiceReversionResultNotificationRequest.class, this::serviceReversionResultNotificationRequest)
+ .put(ServiceRerouteConfirmResultNotificationRequest.class,
+ this::serviceRerouteConfirmResultNotificationRequest)
+ .put(OpticalTunnelCreate.class, this::opticalTunnelCreate)
+ .put(OpticalTunnelRequestCancel.class, this::opticalTunnelRequestCancel)
+ .put(AddOpenroadmOperationalModesToCatalog.class, this::addOpenroadmOperationalModesToCatalog)
+ .put(AddSpecificOperationalModesToCatalog.class, this::addSpecificOperationalModesToCatalog)
+ .put(ServiceSrlgGet.class, this::serviceSrlgGet)
+ .put(EndTerminalPerformanceInfoRequest.class, this::endTerminalPerformanceInfoRequest)
+ .put(EndTerminalActivationRequest.class, this::endTerminalActivationRequest)
+ .put(EndTerminalDeactivationRequest.class, this::endTerminalDeactivationRequest)
+ .put(EndTerminalPowerControl.class, this::endTerminalPowerControl)
+ .build();
+ }