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.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();
}
@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);
-
+
}
}
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);
}
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.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;
@Override
- public Future<RpcResult<CompositeNode>> rpc(QName type, CompositeNode input) {
+ public ListenableFuture<RpcResult<CompositeNode>> rpc(QName type, CompositeNode input) {
return null;
}