// <copy-config>, unlike <edit-config>, always replaces entire configuration,
// so remove old configuration first:
final DOMDataTreeReadWriteTransaction rwTx = transactionProvider.getOrCreateTransaction();
- rwTx.put(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY, EMPTY_ROOT_NODE);
+ rwTx.put(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.empty(), EMPTY_ROOT_NODE);
// Then create nodes present in the <config> element:
for (final XmlElement element : configElements) {
private static XmlElement getSourceElement(final XmlElement parent) throws DocumentedException {
final Optional<XmlElement> sourceElement = parent.getOnlyChildElementOptionally(SOURCE_KEY);
- if (!sourceElement.isPresent()) {
+ if (sourceElement.isEmpty()) {
throw new DocumentedException("<source> element is missing",
DocumentedException.ErrorType.PROTOCOL,
DocumentedException.ErrorTag.MISSING_ELEMENT,
private ContainerNode readData(final XmlElement source) throws DocumentedException {
final Datastore sourceDatastore = getDatastore(source);
final DOMDataTreeReadWriteTransaction rwTx = getTransaction(sourceDatastore);
- final YangInstanceIdentifier dataRoot = YangInstanceIdentifier.EMPTY;
+ final YangInstanceIdentifier dataRoot = YangInstanceIdentifier.empty();
try {
final Optional<NormalizedNode<?, ?>> normalizedNodeOptional = rwTx.read(
LogicalDatastoreType.CONFIGURATION, dataRoot).get();