import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-public interface BindingDataBroker extends AsyncDataBroker<InstanceIdentifier<?>, DataObject, BindingDataChangeListener>, BindingService {
+/**
+ * Provides access to a conceptual data tree store and also provides the ability to
+ * subscribe for changes to data under a given branch of the tree.
+ * <p>
+ * For more information on usage, please see the documentation in {@link AsyncDataBroker}.
+ */
+public interface DataBroker extends AsyncDataBroker<InstanceIdentifier<?>, DataObject, DataChangeListener>, BindingService {
@Override
- BindingDataReadOnlyTransaction newReadOnlyTransaction();
+ ReadOnlyTransaction newReadOnlyTransaction();
@Override
- BindingDataReadWriteTransaction newReadWriteTransaction();
+ ReadWriteTransaction newReadWriteTransaction();
@Override
- BindingDataWriteTransaction newWriteOnlyTransaction();
+ WriteTransaction newWriteOnlyTransaction();
@Override
- ListenerRegistration<BindingDataChangeListener> registerDataChangeListener(LogicalDatastoreType store,
- InstanceIdentifier<?> path, BindingDataChangeListener listener, DataChangeScope triggeringScope);
+ ListenerRegistration<DataChangeListener> registerDataChangeListener(LogicalDatastoreType store,
+ InstanceIdentifier<?> path, DataChangeListener listener, DataChangeScope triggeringScope);
}
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-public interface BindingDataChangeListener extends AsyncDataChangeListener<InstanceIdentifier<?>, DataObject> {
+public interface DataChangeListener extends AsyncDataChangeListener<InstanceIdentifier<?>, DataObject> {
@Override
void onDataChanged(AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> change);
}
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-public interface BindingDataReadOnlyTransaction extends BindingDataReadTransaction, AsyncReadOnlyTransaction<InstanceIdentifier<?>, DataObject> {
+/**
+ * A transaction that provides a stateful read-only view of the data tree.
+ * <p>
+ * For more information on usage and examples, please see the documentation in
+ * {@link org.opendaylight.controller.md.sal.common.api.data.AsyncReadTransaction}.
+ */
+public interface ReadOnlyTransaction extends ReadTransaction, AsyncReadOnlyTransaction<InstanceIdentifier<?>, DataObject> {
}
import com.google.common.base.Optional;
import com.google.common.util.concurrent.ListenableFuture;
-public interface BindingDataReadTransaction extends AsyncReadTransaction<InstanceIdentifier<?>, DataObject> {
+public interface ReadTransaction extends AsyncReadTransaction<InstanceIdentifier<?>, DataObject> {
@Override
ListenableFuture<Optional<DataObject>> read(LogicalDatastoreType store, InstanceIdentifier<?> path);
}
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
- * Logical capture of a combination of both {@link BindingDataReadTransaction} and
- * {@link BindingDataWriteTransaction}.
+ * A transaction that enables combined read/write capabilities.
+ * <p>
+ * For more information on usage and examples, please see the documentation in {@link AsyncReadWriteTransaction}.
*/
-public interface BindingDataReadWriteTransaction extends BindingDataReadTransaction, BindingDataWriteTransaction, AsyncReadWriteTransaction<InstanceIdentifier<?>, DataObject> {
+public interface ReadWriteTransaction extends ReadTransaction, WriteTransaction, AsyncReadWriteTransaction<InstanceIdentifier<?>, DataObject> {
}
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-public interface BindingDataWriteTransaction extends AsyncWriteTransaction<InstanceIdentifier<?>, DataObject> {
+/**
+ * A transaction that provides mutation capabilities on a data tree.
+ * <p>
+ * For more information on usage and examples, please see the documentation in {@link AsyncWriteTransaction}.
+ */
+public interface WriteTransaction extends AsyncWriteTransaction<InstanceIdentifier<?>, DataObject> {
@Override
void put(LogicalDatastoreType store, InstanceIdentifier<?> path, DataObject data);
import java.util.Map.Entry;
import java.util.Set;
-import org.opendaylight.controller.md.sal.binding.api.BindingDataChangeListener;
+import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
codec.onGlobalContextUpdated(ctx);
}
- public ListenerRegistration<BindingDataChangeListener> registerDataChangeListener(final LogicalDatastoreType store,
- final InstanceIdentifier<?> path, final BindingDataChangeListener listener,
+ public ListenerRegistration<DataChangeListener> registerDataChangeListener(final LogicalDatastoreType store,
+ final InstanceIdentifier<?> path, final DataChangeListener listener,
final DataChangeScope triggeringScope) {
DOMDataChangeListener domDataChangeListener = new TranslatingDataChangeInvoker(store, path, listener,
triggeringScope);
}
private class TranslatingDataChangeInvoker implements DOMDataChangeListener {
- private final BindingDataChangeListener bindingDataChangeListener;
+ private final DataChangeListener bindingDataChangeListener;
private final LogicalDatastoreType store;
private final InstanceIdentifier<?> path;
private final DataChangeScope triggeringScope;
public TranslatingDataChangeInvoker(final LogicalDatastoreType store, final InstanceIdentifier<?> path,
- final BindingDataChangeListener bindingDataChangeListener, final DataChangeScope triggeringScope) {
+ final DataChangeListener bindingDataChangeListener, final DataChangeScope triggeringScope) {
this.store = store;
this.path = path;
this.bindingDataChangeListener = bindingDataChangeListener;
}
}
- private static class ListenerRegistrationImpl extends AbstractListenerRegistration<BindingDataChangeListener> {
+ private static class ListenerRegistrationImpl extends AbstractListenerRegistration<DataChangeListener> {
private final ListenerRegistration<DOMDataChangeListener> registration;
- public ListenerRegistrationImpl(final BindingDataChangeListener listener,
+ public ListenerRegistrationImpl(final DataChangeListener listener,
final ListenerRegistration<DOMDataChangeListener> registration) {
super(listener);
this.registration = registration;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
-import org.opendaylight.controller.md.sal.binding.api.BindingDataChangeListener;
import org.opendaylight.controller.md.sal.common.api.RegistrationListener;
import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
final InstanceIdentifier<? extends DataObject> path, final DataChangeListener listener) {
- BindingDataChangeListener asyncOperListener = new BackwardsCompatibleOperationalDataChangeInvoker(listener);
- BindingDataChangeListener asyncCfgListener = new BackwardsCompatibleConfigurationDataChangeInvoker(listener);
+ org.opendaylight.controller.md.sal.binding.api.DataChangeListener asyncOperListener = new BackwardsCompatibleOperationalDataChangeInvoker(listener);
+ org.opendaylight.controller.md.sal.binding.api.DataChangeListener asyncCfgListener = new BackwardsCompatibleConfigurationDataChangeInvoker(listener);
- ListenerRegistration<BindingDataChangeListener> cfgReg = registerDataChangeListener(LogicalDatastoreType.CONFIGURATION, path, asyncCfgListener, DataChangeScope.SUBTREE);
- ListenerRegistration<BindingDataChangeListener> operReg = registerDataChangeListener(LogicalDatastoreType.OPERATIONAL, path, asyncOperListener, DataChangeScope.SUBTREE);
+ ListenerRegistration<org.opendaylight.controller.md.sal.binding.api.DataChangeListener> cfgReg = registerDataChangeListener(LogicalDatastoreType.CONFIGURATION, path, asyncCfgListener, DataChangeScope.SUBTREE);
+ ListenerRegistration<org.opendaylight.controller.md.sal.binding.api.DataChangeListener> operReg = registerDataChangeListener(LogicalDatastoreType.OPERATIONAL, path, asyncOperListener, DataChangeScope.SUBTREE);
return new LegacyListenerRegistration(listener,cfgReg,operReg);
}
private static final class LegacyListenerRegistration implements ListenerRegistration<DataChangeListener> {
private final DataChangeListener instance;
- private final ListenerRegistration<BindingDataChangeListener> cfgReg;
- private final ListenerRegistration<BindingDataChangeListener> operReg;
+ private final ListenerRegistration<org.opendaylight.controller.md.sal.binding.api.DataChangeListener> cfgReg;
+ private final ListenerRegistration<org.opendaylight.controller.md.sal.binding.api.DataChangeListener> operReg;
public LegacyListenerRegistration(final DataChangeListener listener,
- final ListenerRegistration<BindingDataChangeListener> cfgReg,
- final ListenerRegistration<BindingDataChangeListener> operReg) {
+ final ListenerRegistration<org.opendaylight.controller.md.sal.binding.api.DataChangeListener> cfgReg,
+ final ListenerRegistration<org.opendaylight.controller.md.sal.binding.api.DataChangeListener> operReg) {
this.instance = listener;
this.cfgReg = cfgReg;
this.operReg = operReg;
}
- private static class BackwardsCompatibleOperationalDataChangeInvoker implements BindingDataChangeListener, Delegator<DataChangeListener> {
+ private static class BackwardsCompatibleOperationalDataChangeInvoker implements org.opendaylight.controller.md.sal.binding.api.DataChangeListener, Delegator<DataChangeListener> {
private final org.opendaylight.controller.md.sal.common.api.data.DataChangeListener<?,?> delegate;
}
- private static class BackwardsCompatibleConfigurationDataChangeInvoker implements BindingDataChangeListener, Delegator<DataChangeListener> {
+ private static class BackwardsCompatibleConfigurationDataChangeInvoker implements org.opendaylight.controller.md.sal.binding.api.DataChangeListener, Delegator<DataChangeListener> {
private final org.opendaylight.controller.md.sal.common.api.data.DataChangeListener<?,?> delegate;
public BackwardsCompatibleConfigurationDataChangeInvoker(final DataChangeListener listener) {
*/
package org.opendaylight.controller.md.sal.binding.impl;
-import org.opendaylight.controller.md.sal.binding.api.BindingDataBroker;
-import org.opendaylight.controller.md.sal.binding.api.BindingDataReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.binding.api.BindingDataReadWriteTransaction;
-import org.opendaylight.controller.md.sal.binding.api.BindingDataWriteTransaction;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
* NormalizedNode once the MappingService is updated
*
*/
-public class ForwardedBindingDataBroker extends AbstractForwardedDataBroker implements BindingDataBroker {
+public class ForwardedBindingDataBroker extends AbstractForwardedDataBroker implements DataBroker {
public ForwardedBindingDataBroker(final DOMDataBroker domDataBroker, final BindingIndependentMappingService mappingService, final SchemaService schemaService) {
super(domDataBroker, mappingService,schemaService);
}
@Override
- public BindingDataReadOnlyTransaction newReadOnlyTransaction() {
+
+ public ReadOnlyTransaction newReadOnlyTransaction() {
return new BindingDataReadTransactionImpl(getDelegate().newReadOnlyTransaction(),getCodec());
}
@Override
- public BindingDataReadWriteTransaction newReadWriteTransaction() {
+ public ReadWriteTransaction newReadWriteTransaction() {
return new BindingDataReadWriteTransactionImpl(getDelegate().newReadWriteTransaction(),getCodec());
}
@Override
- public BindingDataWriteTransaction newWriteOnlyTransaction() {
+ public WriteTransaction newWriteOnlyTransaction() {
return new BindingDataWriteTransactionImpl<DOMDataWriteTransaction>(getDelegate().newWriteOnlyTransaction(),getCodec());
}
}
+
private class BindingDataReadTransactionImpl extends AbstractBindingTransaction<DOMDataReadOnlyTransaction> implements
- BindingDataReadOnlyTransaction {
+ ReadOnlyTransaction {
protected BindingDataReadTransactionImpl(final DOMDataReadOnlyTransaction delegate,
final BindingToNormalizedNodeCodec codec) {
}
private class BindingDataWriteTransactionImpl<T extends DOMDataWriteTransaction> extends
- AbstractBindingTransaction<T> implements BindingDataWriteTransaction {
+ AbstractBindingTransaction<T> implements WriteTransaction {
protected BindingDataWriteTransactionImpl(final T delegate, final BindingToNormalizedNodeCodec codec) {
super(delegate, codec);
}
private class BindingDataReadWriteTransactionImpl extends
- BindingDataWriteTransactionImpl<DOMDataReadWriteTransaction> implements BindingDataReadWriteTransaction {
+ BindingDataWriteTransactionImpl<DOMDataReadWriteTransaction> implements ReadWriteTransaction {
protected BindingDataReadWriteTransactionImpl(final DOMDataReadWriteTransaction delegate,
final BindingToNormalizedNodeCodec codec) {
import static com.google.common.base.Preconditions.checkState;
-import org.opendaylight.controller.md.sal.binding.api.BindingDataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.util.AbstractBindingSalProviderInstance;
import org.opendaylight.controller.md.sal.binding.util.BindingContextUtils;
import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
private DataProviderService legacyDataBroker;
- private BindingDataBroker dataBroker;
+ private DataBroker dataBroker;
private MountPointManagerImpl mountManager;
consBuilder.put(DataBrokerService.class, getRoot());
consBuilder.put(RpcConsumerRegistry.class, getRoot());
if(dataBroker != null) {
- consBuilder.put(BindingDataBroker.class, dataBroker);
+ consBuilder.put(DataBroker.class, dataBroker);
}
consBuilder.put(MountService.class, mountManager).build();
supportedConsumerServices = consBuilder.build();
}
}
- public void setDataBroker(final BindingDataBroker asyncDataBroker) {
+ public void setDataBroker(final DataBroker asyncDataBroker) {
dataBroker = asyncDataBroker;
}
}
identity binding-async-data-broker {
base "config:service-type";
- config:java-class "org.opendaylight.controller.md.sal.binding.api.BindingDataBroker";
+ config:java-class "org.opendaylight.controller.md.sal.binding.api.DataBroker";
}
identity binding-data-consumer-broker {
/**
*
- * Provides access to a conceptual data tree store.
+ * Base interface that provides access to a conceptual data tree store and also provides the ability to
+ * subscribe for changes to data under a given branch of the tree.
*
* <p>
- * Also provides the ability to subscribe for changes to data under a given
- * branch of the tree.
- *
- * <p>
- * All operations on data tree are performed via one of the transactions:
+ * All operations on the data tree are performed via one of the transactions:
* <ul>
* <li>Read-Only - allocated using {@link #newReadOnlyTransaction()}
* <li>Write-Only - allocated using {@link #newWriteOnlyTransaction()}
public interface AsyncReadOnlyTransaction<P extends Path<P>, D> extends AsyncReadTransaction<P, D>, AutoCloseable {
/**
- * Closes transaction and releases all resources associated with it.
+ * Closes this transaction and releases all resources associated with it.
*
*/
@Override
* <b>Implementation Note:</b> This interface is not intended to be implemented
* by users of MD-SAL, but only to be consumed by them.
*
- * <h2>Transaction isolation example</h2> Lest assume initial state of data tree
- * for <code>PATH</code> is <code>A</code>.
+ * <h2>Transaction isolation example</h2>
+ * Lets assume initial state of data tree for <code>PATH</code> is <code>A</code>.
*
* <pre>
* txRead = broker.newReadOnlyTransaction(); // read Transaction is snapshot of data
* or other functions from {@link com.google.common.util.concurrent.Futures} to
* register more specific listeners.
*
+ * @see AsyncReadTransaction
+ * @see AsyncWriteTransaction
*
* @param <P>
* Type of path (subtree identifier), which represents location in