Clean up of binding broker implementation
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-binding-api / src / main / java / org / opendaylight / controller / sal / binding / api / data / DataBrokerService.java
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.sal.binding.api;\r
-\r
-import java.util.concurrent.Future;\r
-\r
-import org.opendaylight.controller.sal.common.DataStoreIdentifier;\r
-import org.opendaylight.controller.yang.binding.DataRoot;\r
-import org.opendaylight.controller.yang.common.RpcResult;\r
-\r
-\r
-/**\r
- * DataBrokerService provides unified access to the data stores available in the\r
- * system.\r
- * \r
- * \r
- * @see DataProviderService\r
-\r
- */\r
-public interface DataBrokerService extends BindingAwareService {\r
-\r
-    /**\r
-     * Returns a data from specified Data Store.\r
-     * \r
-     * Returns all the data visible to the consumer from specified Data Store.\r
-     * \r
-     * @param <T>\r
-     *            Interface generated from YANG module representing root of data\r
-     * @param store\r
-     *            Identifier of the store, from which will be data retrieved\r
-     * @return data visible to the consumer\r
-     */\r
-    <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType);\r
-\r
-    /**\r
-     * Returns a filtered subset of data from specified Data Store.\r
-     * \r
-     * <p>\r
-     * The filter is modeled as an hierarchy of Java TOs starting with\r
-     * implementation of {@link DataRoot} representing data root. The semantics\r
-     * of the filter tree is the same as filter semantics defined in the NETCONF\r
-     * protocol for rpc operations <code>get</code> and <code>get-config</code>\r
-     * in Section 6 of RFC6241.\r
-     * \r
-     * \r
-     * @see http://tools.ietf.org/html/rfc6241#section-6\r
-     * @param <T>\r
-     *            Interface generated from YANG module representing root of data\r
-     * @param store\r
-     *            Identifier of the store, from which will be data retrieved\r
-     * @param filter\r
-     *            Data tree filter similar to the NETCONF filter\r
-     * @return\r
-     */\r
-    <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);\r
-\r
-    /**\r
-     * Returns a candidate data which are not yet commited.\r
-     * \r
-     * \r
-     * @param <T>\r
-     *            Interface generated from YANG module representing root of data\r
-     * @param store\r
-     *            Identifier of the store, from which will be data retrieved\r
-     * @return\r
-     */\r
-    <T extends DataRoot> T getCandidateData(DataStoreIdentifier store,\r
-            Class<T> rootType);\r
-\r
-    /**\r
-     * Returns a filtered subset of candidate data from specified Data Store.\r
-     * \r
-     * <p>\r
-     * The filter is modeled as an hierarchy of {@link Node} starting with\r
-     * {@link CompositeNode} representing data root. The semantics of the filter\r
-     * tree is the same as filter semantics defined in the NETCONF protocol for\r
-     * rpc operations <code>get</code> and <code>get-config</code> in Section 6\r
-     * of RFC6241.\r
-     * \r
-     * \r
-     * @see http://tools.ietf.org/html/rfc6241#section-6\r
-     * @param <T>\r
-     *            Interface generated from YANG module representing root of data\r
-     * @param store\r
-     *            Identifier of the store, from which will be data retrieved\r
-     * @param filter\r
-     *            A filter data root\r
-     * @return\r
-     */\r
-    <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter);\r
-\r
-    /**\r
-     * \r
-     * @param <T>\r
-     *            Interface generated from YANG module representing root of data\r
-     * @param store\r
-     *            Identifier of the store, in which will be the candidate data\r
-     *            modified\r
-     * @param changeSet\r
-     *            Modification of data tree.\r
-     * @return Result object containing the modified data tree if the operation\r
-     *         was successful, otherwise list of the encountered errors.\r
-     */\r
-    RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store,\r
-            DataRoot changeSet);\r
-\r
-    /**\r
-     * Initiates a two-phase commit of candidate data.\r
-     * \r
-     * <p>\r
-     * The {@link Consumer} could initiate a commit of candidate data\r
-     * \r
-     * <p>\r
-     * The successful commit changes the state of the system and may affect\r
-     * several components.\r
-     * \r
-     * <p>\r
-     * The effects of successful commit of data are described in the\r
-     * specifications and YANG models describing the {@link Provider} components\r
-     * of controller. It is assumed that {@link Consumer} has an understanding\r
-     * of this changes.\r
-     * \r
-     * \r
-     * @see DataCommitHandler for further information how two-phase commit is\r
-     *      processed.\r
-     * @param store\r
-     *            Identifier of the store, where commit should occur.\r
-     * @return Result of the commit, containing success information or list of\r
-     *         encountered errors, if commit was not successful.\r
-     */\r
-    Future<RpcResult<Void>> commit(DataStoreIdentifier store);\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.sal.binding.api.data;
+
+import java.util.concurrent.Future;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareService;
+import org.opendaylight.controller.sal.common.DataStoreIdentifier;
+import org.opendaylight.yangtools.yang.binding.DataRoot;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+/**
+ * DataBrokerService provides unified access to the data stores available in the
+ * system.
+ * 
+ * 
+ * @see DataConsumerService
+ */
+public interface DataBrokerService extends BindingAwareService {
+
+    /**
+     * Returns a data from specified Data Store.
+     * 
+     * Returns all the data visible to the consumer from specified Data Store.
+     * 
+     * @param <T>
+     *            Interface generated from YANG module representing root of data
+     * @param store
+     *            Identifier of the store, from which will be data retrieved
+     * @return data visible to the consumer
+     */
+    <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType);
+
+    /**
+     * Returns a filtered subset of data from specified Data Store.
+     * 
+     * <p>
+     * The filter is modeled as an hierarchy of Java TOs starting with
+     * implementation of {@link DataRoot} representing data root. The semantics
+     * of the filter tree is the same as filter semantics defined in the NETCONF
+     * protocol for rpc operations <code>get</code> and <code>get-config</code>
+     * in Section 6 of RFC6241.
+     * 
+     * 
+     * @see http://tools.ietf.org/html/rfc6241#section-6
+     * @param <T>
+     *            Interface generated from YANG module representing root of data
+     * @param store
+     *            Identifier of the store, from which will be data retrieved
+     * @param filter
+     *            Data tree filter similar to the NETCONF filter
+     * @return
+     */
+    <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);
+
+    /**
+     * Returns a candidate data which are not yet commited.
+     * 
+     * 
+     * @param <T>
+     *            Interface generated from YANG module representing root of data
+     * @param store
+     *            Identifier of the store, from which will be data retrieved
+     * @return
+     */
+    <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType);
+
+    /**
+     * Returns a filtered subset of candidate data from specified Data Store.
+     * 
+     * <p>
+     * The filter is modeled as an hierarchy of {@link Node} starting with
+     * {@link CompositeNode} representing data root. The semantics of the filter
+     * tree is the same as filter semantics defined in the NETCONF protocol for
+     * rpc operations <code>get</code> and <code>get-config</code> in Section 6
+     * of RFC6241.
+     * 
+     * 
+     * @see http://tools.ietf.org/html/rfc6241#section-6
+     * @param <T>
+     *            Interface generated from YANG module representing root of data
+     * @param store
+     *            Identifier of the store, from which will be data retrieved
+     * @param filter
+     *            A filter data root
+     * @return
+     */
+    <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter);
+
+    /**
+     * 
+     * @param <T>
+     *            Interface generated from YANG module representing root of data
+     * @param store
+     *            Identifier of the store, in which will be the candidate data
+     *            modified
+     * @param changeSet
+     *            Modification of data tree.
+     * @return Result object containing the modified data tree if the operation
+     *         was successful, otherwise list of the encountered errors.
+     */
+    RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet);
+
+    /**
+     * Initiates a two-phase commit of candidate data.
+     * 
+     * <p>
+     * The {@link Consumer} could initiate a commit of candidate data
+     * 
+     * <p>
+     * The successful commit changes the state of the system and may affect
+     * several components.
+     * 
+     * <p>
+     * The effects of successful commit of data are described in the
+     * specifications and YANG models describing the {@link Provider} components
+     * of controller. It is assumed that {@link Consumer} has an understanding
+     * of this changes.
+     * 
+     * 
+     * @see DataCommitHandler for further information how two-phase commit is
+     *      processed.
+     * @param store
+     *            Identifier of the store, where commit should occur.
+     * @return Result of the commit, containing success information or list of
+     *         encountered errors, if commit was not successful.
+     */
+    Future<RpcResult<Void>> commit(DataStoreIdentifier store);
+}