import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.transportpce.common.Timeouts;
import org.opendaylight.transportpce.common.device.DeviceTransaction;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
}
+ @SuppressWarnings({ "unchecked", "deprecation", "rawtypes" })
+ // deviceTx.put needs the "true" boolean parameter at the end in order to not compromise the Junit test suite
+ // FIXME check if the InstanceIdentifier raw type can be avoided
+ // Raw types use are discouraged since they lack type safety.
+ // Resulting Problems are observed at run time and not at compile time
public static boolean writeTransaction(DeviceTransactionManager deviceTransactionManager,
String nodeId,
LogicalDatastoreType logicalDatastoreType,
return false;
}
DeviceTransaction deviceTx = deviceTxFuture.get().get();
- deviceTx.put(logicalDatastoreType, instanceIdentifier, object, true);
+ deviceTx.merge(logicalDatastoreType, instanceIdentifier, object);
deviceTx.commit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT).get();
return true;
}
return null;
}
DeviceTransaction deviceTx = deviceTxFuture.get().get();
- com.google.common.base.Optional<? extends DataObject> readOpt
+ Optional<? extends DataObject> readOpt
= deviceTx.read(logicalDatastoreType, instanceIdentifier).get();
if (!readOpt.isPresent()) {
return null;