/**
* The PruningDataTreeModification first removes all entries from the data which do not belong in the schemaContext
- * before delegating it to the actual DataTreeModification
+ * before delegating it to the actual DataTreeModification.
*/
public class PruningDataTreeModification extends ForwardingObject implements DataTreeModification {
public void delete(YangInstanceIdentifier yangInstanceIdentifier) {
try {
delegate.delete(yangInstanceIdentifier);
- } catch(SchemaValidationFailedException e){
+ } catch (SchemaValidationFailedException e) {
LOG.warn("Node at path : {} does not exist ignoring delete", yangInstanceIdentifier);
}
}
@Override
public void merge(YangInstanceIdentifier yangInstanceIdentifier, NormalizedNode<?, ?> normalizedNode) {
try {
- if(YangInstanceIdentifier.EMPTY.equals(yangInstanceIdentifier)){
+ if (YangInstanceIdentifier.EMPTY.equals(yangInstanceIdentifier)) {
pruneAndMergeNode(yangInstanceIdentifier, normalizedNode);
} else {
delegate.merge(yangInstanceIdentifier, normalizedNode);
}
- } catch (SchemaValidationFailedException e){
+ } catch (SchemaValidationFailedException e) {
LOG.warn("Node at path {} was pruned during merge due to validation error: {}",
yangInstanceIdentifier, e.getMessage());
private void pruneAndMergeNode(YangInstanceIdentifier yangInstanceIdentifier, NormalizedNode<?, ?> normalizedNode) {
NormalizedNode<?,?> pruned = pruneNormalizedNode(yangInstanceIdentifier, normalizedNode);
- if(pruned != null) {
+ if (pruned != null) {
delegate.merge(yangInstanceIdentifier, pruned);
}
}
@Override
public void write(YangInstanceIdentifier yangInstanceIdentifier, NormalizedNode<?, ?> normalizedNode) {
try {
- if(YangInstanceIdentifier.EMPTY.equals(yangInstanceIdentifier)){
+ if (YangInstanceIdentifier.EMPTY.equals(yangInstanceIdentifier)) {
pruneAndWriteNode(yangInstanceIdentifier, normalizedNode);
} else {
delegate.write(yangInstanceIdentifier, normalizedNode);
}
- } catch (SchemaValidationFailedException e){
+ } catch (SchemaValidationFailedException e) {
LOG.warn("Node at path : {} was pruned during write due to validation error: {}",
yangInstanceIdentifier, e.getMessage());
private void pruneAndWriteNode(YangInstanceIdentifier yangInstanceIdentifier, NormalizedNode<?, ?> normalizedNode) {
NormalizedNode<?,?> pruned = pruneNormalizedNode(yangInstanceIdentifier, normalizedNode);
- if(pruned != null) {
+ if (pruned != null) {
delegate.write(yangInstanceIdentifier, pruned);
}
}
public void write(PathArgument child, NormalizedNode<?, ?> data) {
YangInstanceIdentifier path = current().node(child);
NormalizedNode<?, ?> prunedNode = pruningModification.pruneNormalizedNode(path, data);
- if(prunedNode != null) {
+ if (prunedNode != null) {
toModification.write(path, prunedNode);
}
}
public void merge(PathArgument child, NormalizedNode<?, ?> data) {
YangInstanceIdentifier path = current().node(child);
NormalizedNode<?, ?> prunedNode = pruningModification.pruneNormalizedNode(path, data);
- if(prunedNode != null) {
+ if (prunedNode != null) {
toModification.merge(path, prunedNode);
}
}
public void delete(PathArgument child) {
try {
toModification.delete(current().node(child));
- } catch(SchemaValidationFailedException e) {
+ } catch (SchemaValidationFailedException e) {
// Ignoring since we would've already logged this in the call to the original modification.
}
}