public class LocalClusterSessionFactory.LocalSession extends Object implements ClusterInfoSession, DisruptibleSession
| Constructor and Description |
|---|
LocalSession() |
| Modifier and Type | Method and Description |
|---|---|
void |
disrupt() |
boolean |
exists(String path,
ClusterInfoWatcher watcher)
Check if a path has already been created.
|
Object |
getData(String path,
ClusterInfoWatcher watcher)
If data is stored at the node indicated by the path, then the data will be returned.
|
Collection<String> |
getSubdirs(String path,
ClusterInfoWatcher watcher)
Show all of the subdirectories of the given directory.
|
String |
mkdir(String path,
Object data,
DirMode mode)
This will create a node at the given path.
|
void |
rmdir(String path)
This will remove the directory stored at the path.
|
void |
setData(String path,
Object data)
Set the data associated with the tree node identified by the path.
|
void |
stop()
Stop the session.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, recursiveMkdirpublic String mkdir(String path, Object data, DirMode mode) throws ClusterInfoException
ClusterInfoSessionmkdir in interface ClusterInfoSessionpath - a '/' separated path to a directory in the cluster information manager to create.data - optional data to set for that directorymode - is the mode to set for the new directory. See DirMode.null if the directory cannot be created
or already exists. If the DirMode is sequential then the result will satisfy the SEQUENTIAL
requirements (see DirMode for the details).ClusterInfoException - on an error which can include the fact that the parent directory doesn't exist (when it
should throw a ClusterInfoException.NoParentException) or if you add a directory as a subdir of an
EPHEMERAL directory.public void rmdir(String path) throws ClusterInfoException
ClusterInfoSessionrmdir in interface ClusterInfoSessionpath - is the directory to delete.ClusterInfoException - if there is no node at the given path.public boolean exists(String path, ClusterInfoWatcher watcher) throws ClusterInfoException
ClusterInfoSessionexists in interface ClusterInfoSessionpath - is the directory to checkwatcher - if non-null, and the path exists, then the watcher will be called back whenever the node at the path has data added to it, or is deleted.ClusterInfoException - if there is an unforeseen problem.public Object getData(String path, ClusterInfoWatcher watcher) throws ClusterInfoException
ClusterInfoSessiongetData in interface ClusterInfoSessionpath - place to put the data.watcher - if non-null, and the path exists, then the watcher will be called back whenever the node at the path has data added to it, or is deleted.ClusterInfoExceptionpublic void setData(String path, Object data) throws ClusterInfoException
ClusterInfoSessionsetData in interface ClusterInfoSessionpath - identify the directory/tree node of the place to store the datadata - the data to put at the given location.ClusterInfoExceptionpublic Collection<String> getSubdirs(String path, ClusterInfoWatcher watcher) throws ClusterInfoException
ClusterInfoSessiongetSubdirs in interface ClusterInfoSessionpath - where the subdirectories to show are.watcher - if non-null, and the path exists, then the watcher will be called back whenever the node at the path has data added to it, or is deleted.ClusterInfoExceptionpublic void stop()
ClusterInfoSessionstop in interface ClusterInfoSessionpublic void disrupt()
disrupt in interface DisruptibleSessionCopyright © 2018. All rights reserved.