X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fdom%2Fbroker%2Fimpl%2FSchemaAwareDataStoreAdapter.java;h=1a572d157dba9f8272140495b8eabf9669df11bc;hp=d8315568bee86ea07ee00b86feddcb0801faaa8e;hb=b80124e3f7b11cf2f5e5bd4a6b033d855ff4d0d4;hpb=4b5f54e25c08fc21c955ff75901abe96b12d3340 diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareDataStoreAdapter.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareDataStoreAdapter.java index d8315568be..1a572d157d 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareDataStoreAdapter.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareDataStoreAdapter.java @@ -45,9 +45,9 @@ import com.google.common.collect.FluentIterable; import com.google.common.collect.ImmutableSet; public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator implements // - DataStore, // - SchemaContextListener, // - AutoCloseable { +DataStore, // +SchemaContextListener, // +AutoCloseable { private final static Logger LOG = LoggerFactory.getLogger(SchemaAwareDataStoreAdapter.class); @@ -56,7 +56,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator reader = new MergeFirstLevelReader(); @Override - public boolean containsConfigurationPath(InstanceIdentifier path) { + public boolean containsConfigurationPath(final InstanceIdentifier path) { try { getDelegateReadLock().lock(); return getDelegate().containsConfigurationPath(path); @@ -67,7 +67,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator requestCommit( - DataModification modification) { + final DataModification modification) { validateAgainstSchema(modification); NormalizedDataModification cleanedUp = prepareMergedTransaction(modification); cleanedUp.status = TransactionStatus.SUBMITED; @@ -122,11 +122,11 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator modification) { + private void validateAgainstSchema(final DataModification modification) { if (!validationEnabled) { return; } @@ -138,12 +138,12 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator original) { + final DataModification original) { NormalizedDataModification normalized = new NormalizedDataModification(original); LOG.trace("Transaction: {} Removed Configuration {}, Removed Operational {}", original.getIdentifier(), original.getRemovedConfigurationData(), original.getRemovedConfigurationData()); @@ -194,7 +194,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator getConfigurationSubpaths(InstanceIdentifier entry) { + private Iterable getConfigurationSubpaths(final InstanceIdentifier entry) { // FIXME: This should be replaced by index Iterable paths = getStoredConfigurationPaths(); @@ -202,15 +202,15 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator getOperationalSubpaths(InstanceIdentifier entry) { + public Iterable getOperationalSubpaths(final InstanceIdentifier entry) { // FIXME: This should be indexed Iterable paths = getStoredOperationalPaths(); return getChildrenPaths(entry, paths); } - private static final Iterable getChildrenPaths(InstanceIdentifier entry, - Iterable paths) { + private static final Iterable getChildrenPaths(final InstanceIdentifier entry, + final Iterable paths) { ImmutableSet.Builder children = ImmutableSet.builder(); for (InstanceIdentifier potential : paths) { if (entry.contains(potential)) { @@ -222,7 +222,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator> preparationComparator = new Comparator>() { @Override - public int compare(Entry o1, Entry o2) { + public int compare(final Entry o1, final Entry o2) { InstanceIdentifier o1Key = o1.getKey(); InstanceIdentifier o2Key = o2.getKey(); return Integer.compare(o1Key.getPath().size(), o2Key.getPath().size()); @@ -242,7 +242,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator> childNodes = new ArrayList>(); if (original != null) { - childNodes.addAll(original.getChildren()); + childNodes.addAll(original.getValue()); qname = original.getNodeType(); } else { qname = path.getPath().get(path.getPath().size() - 1).getNodeType(); @@ -251,7 +251,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator directChildren = FluentIterable.from(getStoredConfigurationPaths()) .filter(new Predicate() { @Override - public boolean apply(InstanceIdentifier input) { + public boolean apply(final InstanceIdentifier input) { if (path.contains(input)) { int nesting = input.getPath().size() - path.getPath().size(); if (nesting == 1) { @@ -285,7 +285,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator> childNodes = new ArrayList>(); if (original != null) { - childNodes.addAll(original.getChildren()); + childNodes.addAll(original.getValue()); qname = original.getNodeType(); } else { qname = path.getPath().get(path.getPath().size() - 1).getNodeType(); @@ -294,7 +294,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator directChildren = FluentIterable.from(getStoredOperationalPaths()) .filter(new Predicate() { @Override - public boolean apply(InstanceIdentifier input) { + public boolean apply(final InstanceIdentifier input) { if (path.contains(input)) { int nesting = input.getPath().size() - path.getPath().size(); if (nesting == 1) { @@ -326,7 +326,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator original) { + public NormalizedDataModification(final DataModification original) { super(getDelegate()); identifier = original; status = TransactionStatus.NEW; @@ -339,7 +339,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator paths = getOperationalSubpaths(entry); removeOperationalData(entry); for (InstanceIdentifier potential : paths) { @@ -347,7 +347,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator paths = getConfigurationSubpaths(entry); removeConfigurationData(entry); for (InstanceIdentifier potential : paths) { @@ -355,11 +355,11 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator child : entryData.getChildren()) { + for (Node child : entryData.getValue()) { InstanceIdentifier subEntryId = InstanceIdentifier.builder(entryKey).node(child.getNodeType()) .toInstance(); if (child instanceof CompositeNode) { @@ -438,7 +438,7 @@ public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator getValuesFromListSchema(ListSchemaNode listSchema, CompositeNode entryData) { + private Map getValuesFromListSchema(final ListSchemaNode listSchema, final CompositeNode entryData) { List keyDef = listSchema.getKeyDefinition(); if (keyDef != null && !keyDef.isEmpty()) { Map map = new HashMap();