Merge "Add MountInstance client documentation and promote to ListenableFuture"
authorTony Tkacik <ttkacik@cisco.com>
Tue, 25 Mar 2014 05:24:51 +0000 (05:24 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 25 Mar 2014 05:24:51 +0000 (05:24 +0000)
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/mount/MountInstance.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/mount/MountProvisionService.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/mount/MountService.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointImpl.java

index 18c854646cca6aa08596a84ddaeba77959129219..5698b969771bd4296cbcb8d85ebbd03fcbca59ae 100644 (file)
@@ -8,8 +8,6 @@
 
 package org.opendaylight.controller.sal.core.api.mount;
 
-import java.util.concurrent.Future;
-
 import org.opendaylight.controller.sal.core.api.data.DataBrokerService;
 import org.opendaylight.controller.sal.core.api.notify.NotificationService;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -17,11 +15,29 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Interface representing a single mount instance and represents a way for
+ * clients to access underlying data, RPCs and notifications.
+ */
 public interface MountInstance extends //
         NotificationService, //
         DataBrokerService {
 
-    Future<RpcResult<CompositeNode>> rpc(QName type, CompositeNode input);
+    /**
+     * Invoke an RPC on the system underlying the mount instance.
+     *
+     * @param type RPC type
+     * @param input RPC input arguments
+     * @return Future representing execution of the RPC.
+     */
+    ListenableFuture<RpcResult<CompositeNode>> rpc(QName type, CompositeNode input);
 
+    /**
+     * Get {@link SchemaContext} of the system underlying the mount instance.
+     *
+     * @return A schema context.
+     */
     SchemaContext getSchemaContext();
 }
index c4c7889f579526a8626a59ab6952ddd6bc151a95..1185c4528cee3e60bbc7bba70ab3beddc5eac021 100644 (file)
@@ -16,18 +16,18 @@ public interface MountProvisionService extends MountService {
 
     @Override
     public MountProvisionInstance getMountPoint(InstanceIdentifier path);
-    
+
     MountProvisionInstance createMountPoint(InstanceIdentifier path);
-    
+
     MountProvisionInstance createOrGetMountPoint(InstanceIdentifier path);
-    
+
     ListenerRegistration<MountProvisionListener> registerProvisionListener(MountProvisionListener listener);
-    
-    public  interface MountProvisionListener extends EventListener {
-        
+
+    public interface MountProvisionListener extends EventListener {
+
         void onMountPointCreated(InstanceIdentifier path);
-        
+
         void onMountPointRemoved(InstanceIdentifier path);
-        
+
     }
 }
index 3180271c935311a64bb69a66b7264ab1ef72cb2a..6d1f17255c7defd4a0e61a890d0b6246b4b466a1 100644 (file)
@@ -10,8 +10,16 @@ package org.opendaylight.controller.sal.core.api.mount;
 import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 
-
+/**
+ * Client-level interface for interacting with mount points. It provides access
+ * to {@link MountInstance} instances based on their path.
+ */
 public interface MountService extends BrokerService {
-
+    /**
+     * Obtain access to a mount instance registered at the specified path.
+     *
+     * @param path Path at which the instance is registered
+     * @return Reference to the instance, or null if no such instance exists.
+     */
     MountInstance getMountPoint(InstanceIdentifier path);
 }
index dc554a072769ae0ecadf74601aa059cdbfc2d4eb..f9f977e3c24d67abe809ce2f3648df5f63960d83 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.sal.dom.broker;
 
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Future;
 
 import org.opendaylight.controller.md.sal.common.api.RegistrationListener;
 import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler;
@@ -41,6 +40,8 @@ import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
+import com.google.common.util.concurrent.ListenableFuture;
+
 public class MountPointImpl implements MountProvisionInstance, SchemaContextProvider {
 
     private final SchemaAwareRpcBroker rpcs;
@@ -135,7 +136,7 @@ public class MountPointImpl implements MountProvisionInstance, SchemaContextProv
 
 
     @Override
-    public Future<RpcResult<CompositeNode>> rpc(QName type, CompositeNode input) {
+    public ListenableFuture<RpcResult<CompositeNode>> rpc(QName type, CompositeNode input) {
         return null;
     }