+ public OperationResult modifyTempService(String serviceName, State operationalState, State administrativeState) {
+ LOG.debug("Modifying '{}' Temp Service", serviceName);
+ Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.temp.service.list
+ .Services> readService = getTempService(serviceName);
+ if (readService.isPresent()) {
+ try {
+ WriteTransaction writeTx = this.dataBroker.newWriteOnlyTransaction();
+ InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.temp.service.list
+ .Services> iid = InstanceIdentifier.create(TempServiceList.class)
+ .child(org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.temp.service.list
+ .Services.class, new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014
+ .temp.service.list.ServicesKey(serviceName));
+ org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.temp.service.list
+ .Services services = new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.temp
+ .service.list.ServicesBuilder(readService.get()).setOperationalState(operationalState)
+ .setAdministrativeState(administrativeState)
+ .build();
+ writeTx.merge(LogicalDatastoreType.OPERATIONAL, iid, services);
+ writeTx.commit().get(Timeouts.DATASTORE_WRITE, TimeUnit.MILLISECONDS);
+ return OperationResult.ok(SUCCESSFUL_MESSAGE);
+ } catch (TimeoutException | InterruptedException | ExecutionException e) {
+ String message = "Failed to modify temp service " + serviceName + " from Temp Service List";
+ LOG.warn(message, e);
+ return OperationResult.failed(message);
+ }
+ } else {
+ String message = "Temp Service " + serviceName + " is not present!";
+ LOG.warn(message);
+ return OperationResult.failed(message);
+ }
+ }
+
+ @Override
+ public OperationResult createService(ServiceCreateInput serviceCreateInput) {