com.continuent.tungsten.common.directory
Class Directory

java.lang.Object
  extended by com.continuent.tungsten.common.cluster.resource.Resource
      extended by com.continuent.tungsten.common.directory.ResourceTree
          extended by com.continuent.tungsten.common.directory.Directory
All Implemented Interfaces:
ResourceNotifier, java.io.Serializable, java.lang.Runnable

public class Directory
extends ResourceTree
implements java.io.Serializable, ResourceNotifier

This class provides a means to organize cluster resources in an intuitive, hierarchical form. It allows us to, effectively, extend the resources that can be referred to, directly, in the Tungsten ResourceManager.

Version:
1.0
Author:
Ed Archibald
See Also:
Serialized Form

Field Summary
protected  boolean absolute
           
static java.lang.String AMPERSAND
           
static java.lang.String ANY_ELEMENT
           
static java.lang.String CD
           
static java.lang.String CHKEXEC
           
protected  java.lang.String clusterName
           
static java.lang.String CONNECT
           
static java.lang.String CP
           
static java.lang.String CREATE
           
protected  boolean createParents
           
static java.lang.String CURRENT_ELEMENT
           
protected  java.lang.Long currentVersion
           
static java.lang.String DEFAULT_CLUSTER_NAME
           
protected  boolean detailed
           
static java.lang.String DIRECTORY
           
static java.lang.String[] directoryCommands
           
static java.lang.String DISCONNECT
           
static java.lang.String DISCONNECT_ALL
           
static java.lang.String EXECUTE
           
static java.lang.String EXTENSION
           
static char FLAG_ABSOLUTE
           
static char FLAG_LONG
           
static char FLAG_PARENTS
           
static char FLAG_RECURSIVE
           
static java.lang.String KEY_COMMAND
           
protected  java.lang.Long lastMergedVersion
           
static java.lang.String LIST
           
protected static java.util.ArrayList<ResourceNotificationListener> listeners
           
static java.lang.String LOCATE_SERVICE
           
protected  java.lang.String memberName
           
static java.lang.String MERGE
           
protected  boolean merging
           
static java.lang.String PARENT_ELEMENT
           
static java.lang.String PATH_SEPARATOR
           
static java.lang.String PROTOCOL
           
static java.lang.String PWD
           
protected  boolean recursive
           
static java.lang.String RM
           
static java.lang.String ROOT_ELEMENT
           
static java.lang.String SERVICE
           
protected  java.util.Map<java.lang.String,ResourceNode> servicesFolders
           
protected  java.util.Map<java.lang.String,java.util.Map<java.lang.Long,java.util.Vector<java.lang.String>>> sessionsByDomain
           
protected  java.util.Map<java.lang.String,DirectorySession> sessionsByID
           
protected  java.lang.String systemSessionID
           
static java.lang.String WHICH
           
 
Fields inherited from class com.continuent.tungsten.common.directory.ResourceTree
rootNode
 
Fields inherited from class com.continuent.tungsten.common.cluster.resource.Resource
childType, compositeMember, description, isContainer, isExecutable, name, type
 
Constructor Summary
Directory()
           
 
Method Summary
 void addListener(ResourceNotificationListener listener)
           
 ResourceNode cd(java.lang.String sessionID, java.lang.String path)
           
 java.lang.String connect(java.lang.String domain, long handle, java.lang.String sessionID)
           
 void cp(java.lang.String sessionID, java.lang.String sourcePath, java.lang.String destinationPath)
          Makes a copy of a specific resource node in the destination.
 ResourceNode create(java.lang.String sessionID, java.lang.String name, boolean createParents)
           
 ResourceNode create(java.lang.String sessionID, java.lang.String name, ResourceNode parent)
           
 ResourceNode create(java.lang.String sessionID, java.lang.String path, ResourceNode startNode, boolean createParents)
           
static Directory createLocalInstance(java.lang.String clusterName, java.lang.String memberName)
          Creates a local directory instance that caller is responsible for managing.
 ResourceNode createProcessNode(java.lang.String sessionID, java.lang.String siteName, java.lang.String clusterName, java.lang.String memberName, java.lang.String componentName, java.lang.String resourceManagerName, int port)
           
 void disconnect(java.lang.String sessionID)
           
 void disconnect(java.lang.String domain, long handle, java.lang.String sessionID)
           
 void disconnectAll(java.lang.String domain)
           
 void disconnectAll(java.lang.String domain, long handle)
           
 java.lang.String executeExtension(ResourceType extensionType, java.lang.String extensionName, java.lang.String commandPrefix, java.lang.String command, java.lang.String[] args)
          Execute an 'extension' by looking it up in the appropriate cluster configuration directory.
 boolean exists(java.lang.String sessionID, java.lang.String path)
           
 void flush()
           
static java.lang.String formatEntries(java.util.List<ResourceNode> entries, ResourceNode startNode, boolean detailed, boolean absolute)
           
 java.lang.String formatPath(Directory directory, java.lang.String sessionID, ResourceNode node)
           
static java.lang.String formatPath(java.util.List<ResourceNode> pathElements, boolean reverseOrder)
           
 java.util.List<ResourceNode> getAbsolutePath(Directory directory, java.lang.String sessionID, ResourceNode node)
           
static java.util.List<ResourceNode> getAbsolutePath(ResourceNode fromNode, ResourceNode toNode, boolean includeFromNode)
           
 java.lang.String getClusterName()
           
 ResourceNode getCurrentNode(java.lang.String sessionID)
           
 java.util.List<ResourceNode> getCwd(java.lang.String sessionID)
           
 java.util.List<ResourceNode> getEntries(ResourceNode nodeToSearch, java.util.List<ResourceNode> entries, boolean doRecurse)
           
static Directory getInstance(java.lang.String clusterName, java.lang.String memberName)
          Returns a global instance.
 ResourceNode getManagerNode(java.lang.String sessionID, java.lang.String siteName, java.lang.String clusterName, java.lang.String host, java.lang.String beanServiceName, int port, java.lang.String component, java.lang.String managerName)
           
 java.lang.String getMemberName()
           
 java.util.Map<java.lang.String,NotificationGroupMember> getNotificationGroupMembers()
           
 ResourceNode getProcessNode(java.lang.String sessionID, java.lang.String clusterName, java.lang.String memberName, java.lang.String processName)
          Processes are found at: /////
 java.util.List<TungstenProperties> getServiceConfig(java.lang.String sessionID, java.lang.String hostName, java.lang.String name)
          Returns one or more service configurations as property instances.
 ResourceNode getServiceFolder(java.lang.String hostName)
          Returns services folder which is created upon construction of this directory and which holds services to execute commands upon.
 DirectorySession getSession(java.lang.String sessionID)
          Returns an existing session or throws an exception.
 java.util.Map<java.lang.String,DirectorySession> getSessionMap()
           
 java.util.Map<java.lang.String,java.util.Map<java.lang.Long,java.util.Vector<java.lang.String>>> getSessionsByDomain()
           
 java.util.Map<java.lang.String,DirectorySession> getSessionsByID()
           
 java.lang.String getSystemSessionID()
           
 long getVersion()
           
static boolean isDirectoryCommand(java.lang.String command)
           
 boolean isExecutable(java.lang.String sessionID, java.lang.String path)
          A primitive that indicates whether or not the resource associated with a node is executable.
 ResourceNode locate(java.lang.String sessionID, java.lang.String path)
          Locates a given resource node, given a path.
 ResourceNode locate(java.lang.String sessionID, java.lang.String path, ResourceNode startNode)
          Locates a given resource give a path and a starting node.
 ResourceNode locateRelative(java.lang.String sessionID, int levels)
          Traverse back the indicated number of levels, starting at the current node, and return the node found there.
 ResourceNode locateRelative(java.lang.String sessionID, int levels, ResourceNode startNode)
          Traverse back the indicated number of levels, starting at the current node, and return the node found there.
 java.util.List<ResourceNode> ls(java.lang.String sessionID, java.lang.String path, boolean doRecurse)
          Returns a list of resource nodes according to the path passed in.
 Directory merge(Directory source, Directory destination)
          This method merges the current directory with another directory such that the current directory has all elements, by name, which exist in both directories and any elements that have identical names remain in the current directory.
 void notifyListeners(ClusterResourceNotification notification)
           
 void prepare()
           
 java.lang.String procedure(java.lang.String procedureSpec, java.lang.String command)
          Executes a command on a service.
 java.io.Serializable processCommand(java.lang.String sessionID, java.lang.String commandLine)
          This is the main interface for the directory with respect to text-based operations.
 java.lang.String pwd(java.lang.String sessionID)
           
 void removeSession(java.lang.String sessionID)
          Removes an existing Directory session.
 void rm(java.lang.String sessionID, ResourceNode node)
           
 void rm(java.lang.String sessionID, java.lang.String path)
           
 void run()
           
 java.lang.String service(java.lang.String serviceSpec, java.lang.String serviceCmd)
          Executes a command on a service.
 void setClusterName(java.lang.String clusterName)
           
 void setCurrentNode(java.lang.String sessionID, ResourceNode currentNode)
           
 void setMemberName(java.lang.String memberName)
           
 void setSessionsByID(java.util.Map<java.lang.String,DirectorySession> sessionsByID)
           
 void setSystemSessionID(java.lang.String systemSessionID)
           
 java.lang.String toString()
          Return a representation of this tree in string form.
 java.lang.String which(java.lang.String sessionID, java.lang.String path)
          This command returns the full path to a given resource, as long as the resource exists
 
Methods inherited from class com.continuent.tungsten.common.directory.ResourceTree
getRootNode, setRootNode, toMap
 
Methods inherited from class com.continuent.tungsten.common.cluster.resource.Resource
copyTo, describe, getChildType, getCompositeMember, getKey, getName, getType, isContainer, isExecutable, setChildType, setCompositeMember, setContainer, setExecutable, setName, setType, toJSON, toProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_CLUSTER_NAME

public static final java.lang.String DEFAULT_CLUSTER_NAME
See Also:
Constant Field Values

PROTOCOL

public static final java.lang.String PROTOCOL
See Also:
Constant Field Values

ROOT_ELEMENT

public static final java.lang.String ROOT_ELEMENT
See Also:
Constant Field Values

CURRENT_ELEMENT

public static final java.lang.String CURRENT_ELEMENT
See Also:
Constant Field Values

PARENT_ELEMENT

public static final java.lang.String PARENT_ELEMENT
See Also:
Constant Field Values

ANY_ELEMENT

public static final java.lang.String ANY_ELEMENT
See Also:
Constant Field Values

AMPERSAND

public static final java.lang.String AMPERSAND
See Also:
Constant Field Values

PATH_SEPARATOR

public static final java.lang.String PATH_SEPARATOR
See Also:
Constant Field Values

DIRECTORY

public static final java.lang.String DIRECTORY
See Also:
Constant Field Values

EXECUTE

public static final java.lang.String EXECUTE
See Also:
Constant Field Values

LIST

public static final java.lang.String LIST
See Also:
Constant Field Values

CD

public static final java.lang.String CD
See Also:
Constant Field Values

CP

public static final java.lang.String CP
See Also:
Constant Field Values

RM

public static final java.lang.String RM
See Also:
Constant Field Values

CREATE

public static final java.lang.String CREATE
See Also:
Constant Field Values

PWD

public static final java.lang.String PWD
See Also:
Constant Field Values

CHKEXEC

public static final java.lang.String CHKEXEC
See Also:
Constant Field Values

WHICH

public static final java.lang.String WHICH
See Also:
Constant Field Values

CONNECT

public static final java.lang.String CONNECT
See Also:
Constant Field Values

DISCONNECT

public static final java.lang.String DISCONNECT
See Also:
Constant Field Values

DISCONNECT_ALL

public static final java.lang.String DISCONNECT_ALL
See Also:
Constant Field Values

MERGE

public static final java.lang.String MERGE
See Also:
Constant Field Values

SERVICE

public static final java.lang.String SERVICE
See Also:
Constant Field Values

EXTENSION

public static final java.lang.String EXTENSION
See Also:
Constant Field Values

LOCATE_SERVICE

public static final java.lang.String LOCATE_SERVICE
See Also:
Constant Field Values

FLAG_LONG

public static final char FLAG_LONG
See Also:
Constant Field Values

FLAG_RECURSIVE

public static final char FLAG_RECURSIVE
See Also:
Constant Field Values

FLAG_ABSOLUTE

public static final char FLAG_ABSOLUTE
See Also:
Constant Field Values

FLAG_PARENTS

public static final char FLAG_PARENTS
See Also:
Constant Field Values

KEY_COMMAND

public static final java.lang.String KEY_COMMAND
See Also:
Constant Field Values

directoryCommands

public static final java.lang.String[] directoryCommands

clusterName

protected java.lang.String clusterName

memberName

protected java.lang.String memberName

recursive

protected boolean recursive

absolute

protected boolean absolute

detailed

protected boolean detailed

createParents

protected boolean createParents

listeners

protected static java.util.ArrayList<ResourceNotificationListener> listeners

sessionsByID

protected java.util.Map<java.lang.String,DirectorySession> sessionsByID

sessionsByDomain

protected java.util.Map<java.lang.String,java.util.Map<java.lang.Long,java.util.Vector<java.lang.String>>> sessionsByDomain

systemSessionID

protected java.lang.String systemSessionID

servicesFolders

protected java.util.Map<java.lang.String,ResourceNode> servicesFolders

currentVersion

protected java.lang.Long currentVersion

lastMergedVersion

protected java.lang.Long lastMergedVersion

merging

protected boolean merging
Constructor Detail

Directory

public Directory()
Method Detail

getInstance

public static Directory getInstance(java.lang.String clusterName,
                                    java.lang.String memberName)
                             throws ResourceException,
                                    DirectoryNotFoundException
Returns a global instance. This is the standard method to access a single process-wide directory.

Parameters:
clusterName - Name of the cluster
memberName - Name of the cluster member
Returns:
Returns the global directory
Throws:
ResourceException
DirectoryNotFoundException

createLocalInstance

public static Directory createLocalInstance(java.lang.String clusterName,
                                            java.lang.String memberName)
                                     throws ResourceException,
                                            DirectoryNotFoundException
Creates a local directory instance that caller is responsible for managing. This method allows creation of directories for unit tests.

Parameters:
clusterName - Name of the cluster
memberName - Name of the cluster member
Returns:
Returns A new directory instance
Throws:
ResourceException
DirectoryNotFoundException

connect

public java.lang.String connect(java.lang.String domain,
                                long handle,
                                java.lang.String sessionID)
                         throws DirectoryNotFoundException
Throws:
DirectoryNotFoundException

disconnect

public void disconnect(java.lang.String domain,
                       long handle,
                       java.lang.String sessionID)

disconnectAll

public void disconnectAll(java.lang.String domain,
                          long handle)

disconnectAll

public void disconnectAll(java.lang.String domain)

getSession

public DirectorySession getSession(java.lang.String sessionID)
                            throws DirectoryNotFoundException
Returns an existing session or throws an exception.

Parameters:
sessionID -
Returns:
a context for a given session
Throws:
DirectoryNotFoundException

removeSession

public void removeSession(java.lang.String sessionID)
                   throws DirectoryException
Removes an existing Directory session.

Parameters:
sessionID -
Throws:
DirectoryException

processCommand

public java.io.Serializable processCommand(java.lang.String sessionID,
                                           java.lang.String commandLine)
                                    throws java.lang.Exception
This is the main interface for the directory with respect to text-based operations.

Parameters:
sessionID -
Returns:
the output for a given command
Throws:
java.lang.Exception

disconnect

public void disconnect(java.lang.String sessionID)

which

public java.lang.String which(java.lang.String sessionID,
                              java.lang.String path)
                       throws DirectoryNotFoundException
This command returns the full path to a given resource, as long as the resource exists

Parameters:
sessionID -
path -
Returns:
a string representing the full, absolute path for a given path element
Throws:
DirectoryNotFoundException

isExecutable

public boolean isExecutable(java.lang.String sessionID,
                            java.lang.String path)
                     throws DirectoryNotFoundException
A primitive that indicates whether or not the resource associated with a node is executable.

Parameters:
sessionID -
path -
Returns:
true if the path is executable, otherwise false
Throws:
DirectoryNotFoundException

getServiceFolder

public ResourceNode getServiceFolder(java.lang.String hostName)
Returns services folder which is created upon construction of this directory and which holds services to execute commands upon.


getServiceConfig

public java.util.List<TungstenProperties> getServiceConfig(java.lang.String sessionID,
                                                           java.lang.String hostName,
                                                           java.lang.String name)
Returns one or more service configurations as property instances.

Parameters:
sessionID - Session ID
hostName - Name of host on which service abides
name - Name of the service or null to select all available services

locateRelative

public ResourceNode locateRelative(java.lang.String sessionID,
                                   int levels)
                            throws DirectoryException,
                                   DirectoryNotFoundException
Traverse back the indicated number of levels, starting at the current node, and return the node found there.

Parameters:
levels -
Returns:
the resource that is relative to the current node, proceeding via the parents, by the indicated levels
Throws:
DirectoryException
DirectoryNotFoundException

locateRelative

public ResourceNode locateRelative(java.lang.String sessionID,
                                   int levels,
                                   ResourceNode startNode)
                            throws DirectoryException,
                                   DirectoryNotFoundException
Traverse back the indicated number of levels, starting at the current node, and return the node found there.

Parameters:
levels -
Returns:
the resource that is relative to the current node, proceeding via the parents, by the indicated levels, starting at the indicated node.
Throws:
DirectoryException
DirectoryNotFoundException

locate

public ResourceNode locate(java.lang.String sessionID,
                           java.lang.String path)
                    throws DirectoryNotFoundException
Locates a given resource node, given a path. This method takes into account the 'current' working node.

Parameters:
sessionID -
path -
Returns:
the resource specified by path
Throws:
DirectoryNotFoundException - if the resource cannot be found

locate

public ResourceNode locate(java.lang.String sessionID,
                           java.lang.String path,
                           ResourceNode startNode)
                    throws DirectoryNotFoundException
Locates a given resource give a path and a starting node.

Parameters:
path -
startNode -
Returns:
the resource specified by path
Throws:
DirectoryNotFoundException - if the resource cannot be found

ls

public java.util.List<ResourceNode> ls(java.lang.String sessionID,
                                       java.lang.String path,
                                       boolean doRecurse)
                                throws DirectoryNotFoundException
Returns a list of resource nodes according to the path passed in.

Parameters:
path -
Returns:
a list of resources as indicated by the path.
Throws:
DirectoryNotFoundException - if the specified resources cannot be found

cp

public void cp(java.lang.String sessionID,
               java.lang.String sourcePath,
               java.lang.String destinationPath)
        throws DirectoryException,
               DirectoryNotFoundException
Makes a copy of a specific resource node in the destination.

Parameters:
sourcePath -
destinationPath -
Throws:
DirectoryException
DirectoryNotFoundException

getEntries

public java.util.List<ResourceNode> getEntries(ResourceNode nodeToSearch,
                                               java.util.List<ResourceNode> entries,
                                               boolean doRecurse)
Parameters:
nodeToSearch -
entries -
Returns:
all of the entries in the nodes below the node to search

cd

public ResourceNode cd(java.lang.String sessionID,
                       java.lang.String path)
                throws DirectoryNotFoundException,
                       DirectoryException
Parameters:
path -
Throws:
DirectoryNotFoundException
DirectoryException

service

public java.lang.String service(java.lang.String serviceSpec,
                                java.lang.String serviceCmd)
                         throws java.lang.Exception
Executes a command on a service. The command must be defined in the service configuration like this for eg.:
command.start=../../tungsten-replicator/bin/replicator start

Parameters:
serviceSpec - Name of the service.
serviceCmd - Command name to execute on a service.
Returns:
Stdout of the process have been executed.
Throws:
java.lang.Exception - If service node not found, or service does not support the requested command.

procedure

public java.lang.String procedure(java.lang.String procedureSpec,
                                  java.lang.String command)
                           throws java.lang.Exception
Executes a command on a service. The command must be defined in the service configuration like this for eg.:
command.start=../../tungsten-replicator/bin/replicator start

Parameters:
procedureSpec - Name of the service.
command - Command name to execute on a service.
Returns:
standard output of the process have been executed.
Throws:
java.lang.Exception - If service node not found, or service does not support the requested command.

executeExtension

public java.lang.String executeExtension(ResourceType extensionType,
                                         java.lang.String extensionName,
                                         java.lang.String commandPrefix,
                                         java.lang.String command,
                                         java.lang.String[] args)
                                  throws java.lang.Exception
Execute an 'extension' by looking it up in the appropriate cluster configuration directory. This is a generic facility that can execute any previously configured command at the OS level and includes the ability to execute concurrently across a set of nodes. The arguments passed in determine where we will look for the 'extension' and what we will execute.

Parameters:
extensionType - - the type of the extension. This determines the directory that is searched for the extension.
extensionName - - the name of the .properties file to look for in the extension directory.
commandPrefix - - the string to look for, in the extension properties file as an 'introducer' to a specific operation. This may vary depending on the function of the extension.
command - - the command 'key' to use to find the command to execute.
args - - any args required by the command. These are treated positionally
Throws:
java.lang.Exception

create

public ResourceNode create(java.lang.String sessionID,
                           java.lang.String name,
                           boolean createParents)
                    throws DirectoryException,
                           DirectoryNotFoundException
Throws:
DirectoryException
DirectoryNotFoundException

create

public ResourceNode create(java.lang.String sessionID,
                           java.lang.String name,
                           ResourceNode parent)
                    throws DirectoryException
Parameters:
name -
parent -
Returns:
the resource that was created
Throws:
DirectoryException - if the parent cannot be found

create

public ResourceNode create(java.lang.String sessionID,
                           java.lang.String path,
                           ResourceNode startNode,
                           boolean createParents)
                    throws DirectoryException
Parameters:
path -
startNode -
createParents -
Returns:
the resource that was created
Throws:
DirectoryException - if the startNode cannot be found

rm

public void rm(java.lang.String sessionID,
               java.lang.String path)
        throws DirectoryNotFoundException,
               DirectoryException
Parameters:
sessionID -
path -
Throws:
DirectoryNotFoundException
DirectoryException

pwd

public java.lang.String pwd(java.lang.String sessionID)
                     throws DirectoryNotFoundException
Parameters:
sessionID -
Returns:
a string representing the working directory/resourceNode
Throws:
DirectoryNotFoundException

formatPath

public static java.lang.String formatPath(java.util.List<ResourceNode> pathElements,
                                          boolean reverseOrder)
Parameters:
pathElements -
reverseOrder -
Returns:
a formatted representation of the path

formatEntries

public static java.lang.String formatEntries(java.util.List<ResourceNode> entries,
                                             ResourceNode startNode,
                                             boolean detailed,
                                             boolean absolute)
Parameters:
entries -
detailed -
Returns:
string representation of the entries

getAbsolutePath

public static java.util.List<ResourceNode> getAbsolutePath(ResourceNode fromNode,
                                                           ResourceNode toNode,
                                                           boolean includeFromNode)

getCurrentNode

public ResourceNode getCurrentNode(java.lang.String sessionID)
                            throws DirectoryNotFoundException
Throws:
DirectoryNotFoundException

setCurrentNode

public void setCurrentNode(java.lang.String sessionID,
                           ResourceNode currentNode)
                    throws DirectoryNotFoundException
Throws:
DirectoryNotFoundException

getCwd

public java.util.List<ResourceNode> getCwd(java.lang.String sessionID)
                                    throws DirectoryNotFoundException
Throws:
DirectoryNotFoundException

merge

public Directory merge(Directory source,
                       Directory destination)
                throws DirectoryException
This method merges the current directory with another directory such that the current directory has all elements, by name, which exist in both directories and any elements that have identical names remain in the current directory.

Parameters:
source -
destination -
Returns:
the count of the number of nodes merged
Throws:
DirectoryException

getSessionMap

public java.util.Map<java.lang.String,DirectorySession> getSessionMap()

getSessionsByDomain

public java.util.Map<java.lang.String,java.util.Map<java.lang.Long,java.util.Vector<java.lang.String>>> getSessionsByDomain()

toString

public java.lang.String toString()
Description copied from class: ResourceTree
Return a representation of this tree in string form.

Overrides:
toString in class ResourceTree

exists

public boolean exists(java.lang.String sessionID,
                      java.lang.String path)

isDirectoryCommand

public static boolean isDirectoryCommand(java.lang.String command)

getSystemSessionID

public java.lang.String getSystemSessionID()
Returns:
the systemSessionID

setSystemSessionID

public void setSystemSessionID(java.lang.String systemSessionID)
Parameters:
systemSessionID - the systemSessionID to set

addListener

public void addListener(ResourceNotificationListener listener)
Specified by:
addListener in interface ResourceNotifier

notifyListeners

public void notifyListeners(ClusterResourceNotification notification)
                     throws ResourceNotificationException
Specified by:
notifyListeners in interface ResourceNotifier
Throws:
ResourceNotificationException

run

public void run()
Specified by:
run in interface java.lang.Runnable

flush

public void flush()

getVersion

public long getVersion()

getNotificationGroupMembers

public java.util.Map<java.lang.String,NotificationGroupMember> getNotificationGroupMembers()
Specified by:
getNotificationGroupMembers in interface ResourceNotifier

getSessionsByID

public java.util.Map<java.lang.String,DirectorySession> getSessionsByID()

setSessionsByID

public void setSessionsByID(java.util.Map<java.lang.String,DirectorySession> sessionsByID)

getClusterName

public java.lang.String getClusterName()

setClusterName

public void setClusterName(java.lang.String clusterName)

getMemberName

public java.lang.String getMemberName()

setMemberName

public void setMemberName(java.lang.String memberName)

prepare

public void prepare()
             throws java.lang.Exception
Specified by:
prepare in interface ResourceNotifier
Throws:
java.lang.Exception

getManagerNode

public ResourceNode getManagerNode(java.lang.String sessionID,
                                   java.lang.String siteName,
                                   java.lang.String clusterName,
                                   java.lang.String host,
                                   java.lang.String beanServiceName,
                                   int port,
                                   java.lang.String component,
                                   java.lang.String managerName)
                            throws java.lang.Exception
Parameters:
siteName - TODO
clusterName -
host -
beanServiceName -
port -
component -
managerName -
Throws:
java.lang.Exception

getProcessNode

public ResourceNode getProcessNode(java.lang.String sessionID,
                                   java.lang.String clusterName,
                                   java.lang.String memberName,
                                   java.lang.String processName)
Processes are found at: /////

Parameters:
sessionID -
clusterName -
memberName -

rm

public void rm(java.lang.String sessionID,
               ResourceNode node)
See Also:
rm(java.lang.String, com.continuent.tungsten.common.directory.ResourceNode)

createProcessNode

public ResourceNode createProcessNode(java.lang.String sessionID,
                                      java.lang.String siteName,
                                      java.lang.String clusterName,
                                      java.lang.String memberName,
                                      java.lang.String componentName,
                                      java.lang.String resourceManagerName,
                                      int port)
                               throws DirectoryException
Throws:
DirectoryException

formatPath

public java.lang.String formatPath(Directory directory,
                                   java.lang.String sessionID,
                                   ResourceNode node)
                            throws DirectoryNotFoundException
Throws:
DirectoryNotFoundException

getAbsolutePath

public java.util.List<ResourceNode> getAbsolutePath(Directory directory,
                                                    java.lang.String sessionID,
                                                    ResourceNode node)
                                             throws DirectoryNotFoundException
Throws:
DirectoryNotFoundException