Add MountInstance client documentation and promote to ListenableFuture 22/5622/2
authorRobert Varga <rovarga@cisco.com>
Thu, 13 Mar 2014 08:23:27 +0000 (09:23 +0100)
committerRobert Varga <rovarga@cisco.com>
Thu, 13 Mar 2014 08:33:04 +0000 (09:33 +0100)
This adds documentation to MountInstance interface. Also promote
Future<> to ListenableFuture<>, as there is only a single implementation
anyway.

Change-Id: I9346f1f38c633b32fa7039f143d6c7634cb97359
Signed-off-by: Robert Varga <rovarga@cisco.com>
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 18c8546..5698b96 100644 (file)
@@ -8,8 +8,6 @@
 
 package org.opendaylight.controller.sal.core.api.mount;
 
 
 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;
 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 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 {
 
 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();
 }
     SchemaContext getSchemaContext();
 }
index c4c7889..1185c45 100644 (file)
@@ -16,18 +16,18 @@ public interface MountProvisionService extends MountService {
 
     @Override
     public MountProvisionInstance getMountPoint(InstanceIdentifier path);
 
     @Override
     public MountProvisionInstance getMountPoint(InstanceIdentifier path);
-    
+
     MountProvisionInstance createMountPoint(InstanceIdentifier path);
     MountProvisionInstance createMountPoint(InstanceIdentifier path);
-    
+
     MountProvisionInstance createOrGetMountPoint(InstanceIdentifier path);
     MountProvisionInstance createOrGetMountPoint(InstanceIdentifier path);
-    
+
     ListenerRegistration<MountProvisionListener> registerProvisionListener(MountProvisionListener listener);
     ListenerRegistration<MountProvisionListener> registerProvisionListener(MountProvisionListener listener);
-    
-    public  interface MountProvisionListener extends EventListener {
-        
+
+    public interface MountProvisionListener extends EventListener {
+
         void onMountPointCreated(InstanceIdentifier path);
         void onMountPointCreated(InstanceIdentifier path);
-        
+
         void onMountPointRemoved(InstanceIdentifier path);
         void onMountPointRemoved(InstanceIdentifier path);
-        
+
     }
 }
     }
 }
index 3180271..6d1f172 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;
 
 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 {
 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);
 }
     MountInstance getMountPoint(InstanceIdentifier path);
 }
index dc554a0..f9f977e 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.sal.dom.broker;
 
 import java.util.List;
 import java.util.Set;
 
 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;
 
 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 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;
 public class MountPointImpl implements MountProvisionInstance, SchemaContextProvider {
 
     private final SchemaAwareRpcBroker rpcs;
@@ -135,7 +136,7 @@ public class MountPointImpl implements MountProvisionInstance, SchemaContextProv
 
 
     @Override
 
 
     @Override
-    public Future<RpcResult<CompositeNode>> rpc(QName type, CompositeNode input) {
+    public ListenableFuture<RpcResult<CompositeNode>> rpc(QName type, CompositeNode input) {
         return null;
     }
 
         return null;
     }
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.