org.almendra.janet.cas.node
Class AbstractClusterImage

java.lang.Object
  extended by org.almendra.janet.cas.node.AbstractClusterImage
Direct Known Subclasses:
CentralClusterImage, NodeClusterImage

public abstract class AbstractClusterImage
extends java.lang.Object

Author:
Oliver

Field Summary
protected  AbstractNodeImage localNodeImage
           
protected  EDU.oswego.cs.dl.util.concurrent.ReentrantLock lock
           
protected  java.util.Map nodeImages
           
 
Constructor Summary
AbstractClusterImage()
           
 
Method Summary
 AbstractNodeImage addLocalNode(IAgentDispatcher dispatcher, NodeLocation nodeLocation)
           
abstract  AbstractNodeImage addNodeImage(IAgentDispatcher agentDispatcher, NodeLocation nodeLocation)
           
protected abstract  AbstractNodeImage createLocalNode(IAgentDispatcher dispatcher, NodeLocation nodeLocation)
           
 void deregisterAllApplications(java.lang.String nodeName)
           
 java.util.List existingCapabilitiesOnOtherNodes(java.util.List localCapabilityPaths, java.util.List excludingNodeNames)
           
protected  boolean existsCapabilityOnOtherNodes(LocalCapabilityPath path, java.util.List excludingNodeNames)
           
 int getAgentCount(java.lang.String applicationName, java.lang.String capabilityName)
           
 IAgentDispatcher getAgentDispatcher(AgentPath path)
           
 java.util.List getAgentPaths(CapabilityPath path)
           
 java.util.List getAgentPaths(java.lang.String applicationName, java.lang.String capabilityName)
           
 java.util.List getAgentPaths(java.lang.String applicationName, java.lang.String capabilityName, java.lang.String agentName)
           
 java.util.Map getAgentsQueueSizes(LocalAgentPath agentPath)
           
 java.util.List getAllAgents(LocalAgentPath localPath)
           
 java.util.List getAllApplicationCapabilitesOn(java.lang.String nodeName)
           
 java.util.List getAllForeignAgents(LocalAgentPath localPath)
           
 java.util.List getAllForeignAgents(LocalAgentPath localPath, boolean onlyForeign)
           
 java.util.List getAllForeignNodeLocations()
           
 java.util.List getAllForeignNodeNames()
           
 java.util.List getAllForeignSystemAgentPaths(java.lang.String applicationName)
           
 java.util.List getAllNodeNamesWithCapability(LocalCapabilityPath path, java.util.List nodeNamesToConsider)
           
 java.util.List getForeignNodeNamesWithApplication(java.lang.String applicationName)
           
 int getForeignNodesCount()
           
 java.util.List getForeignNodesWithApplication(java.lang.String applicationName)
           
 AbstractNodeImage getLocalNodeImage()
           
 AbstractNodeImage getNodeImage(NodeLocation locationOrNull, java.lang.String nodeName)
           
 AbstractNodeImage getNodeImage(java.lang.String nodeName)
           
 boolean hasApplication(java.lang.String nodeName, java.lang.String applicationName)
           
 boolean hasCapability(java.lang.String nodeName, java.lang.String applicationName, java.lang.String capabilityName)
           
 AbstractNodeImage removeNodeImage(java.lang.String nodeName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeImages

protected java.util.Map nodeImages

lock

protected EDU.oswego.cs.dl.util.concurrent.ReentrantLock lock

localNodeImage

protected AbstractNodeImage localNodeImage
Constructor Detail

AbstractClusterImage

public AbstractClusterImage()
Method Detail

removeNodeImage

public AbstractNodeImage removeNodeImage(java.lang.String nodeName)
Parameters:
nodeImage -

deregisterAllApplications

public void deregisterAllApplications(java.lang.String nodeName)
Parameters:
nodeImage -

addNodeImage

public abstract AbstractNodeImage addNodeImage(IAgentDispatcher agentDispatcher,
                                               NodeLocation nodeLocation)

getAgentDispatcher

public IAgentDispatcher getAgentDispatcher(AgentPath path)
                                    throws NoSuchAgentException
Parameters:
path -
Returns:
Throws:
NoSuchAgentException

getAllForeignNodeNames

public java.util.List getAllForeignNodeNames()
Returns:

getNodeImage

public AbstractNodeImage getNodeImage(java.lang.String nodeName)

getNodeImage

public AbstractNodeImage getNodeImage(NodeLocation locationOrNull,
                                      java.lang.String nodeName)
                               throws java.rmi.AccessException,
                                      java.rmi.RemoteException,
                                      java.rmi.NotBoundException
Throws:
java.rmi.AccessException
java.rmi.RemoteException
java.rmi.NotBoundException

getForeignNodeNamesWithApplication

public java.util.List getForeignNodeNamesWithApplication(java.lang.String applicationName)
Parameters:
string -
Returns:

getAgentCount

public int getAgentCount(java.lang.String applicationName,
                         java.lang.String capabilityName)

getAgentPaths

public java.util.List getAgentPaths(java.lang.String applicationName,
                                    java.lang.String capabilityName,
                                    java.lang.String agentName)
Parameters:
string -
Returns:

getAgentPaths

public java.util.List getAgentPaths(java.lang.String applicationName,
                                    java.lang.String capabilityName)
Parameters:
string -
Returns:

getForeignNodesWithApplication

public java.util.List getForeignNodesWithApplication(java.lang.String applicationName)
Parameters:
string -
Returns:

getAllForeignNodeLocations

public java.util.List getAllForeignNodeLocations()
Returns:

getAllAgents

public java.util.List getAllAgents(LocalAgentPath localPath)

getAllForeignAgents

public java.util.List getAllForeignAgents(LocalAgentPath localPath)

getAllForeignAgents

public java.util.List getAllForeignAgents(LocalAgentPath localPath,
                                          boolean onlyForeign)
Parameters:
string -
capabilityName -
agentName -
Returns:

getForeignNodesCount

public int getForeignNodesCount()

getAllForeignSystemAgentPaths

public java.util.List getAllForeignSystemAgentPaths(java.lang.String applicationName)

addLocalNode

public AbstractNodeImage addLocalNode(IAgentDispatcher dispatcher,
                                      NodeLocation nodeLocation)
Parameters:
dispatcher -
nodeLocation -

createLocalNode

protected abstract AbstractNodeImage createLocalNode(IAgentDispatcher dispatcher,
                                                     NodeLocation nodeLocation)
Parameters:
dispatcher -
nodeLocation -
Returns:

getLocalNodeImage

public AbstractNodeImage getLocalNodeImage()
Returns:

getAgentsQueueSizes

public java.util.Map getAgentsQueueSizes(LocalAgentPath agentPath)
Parameters:
agentPath -
Returns:

hasCapability

public boolean hasCapability(java.lang.String nodeName,
                             java.lang.String applicationName,
                             java.lang.String capabilityName)
Parameters:
nodeName -
capabilityName -
Returns:

hasApplication

public boolean hasApplication(java.lang.String nodeName,
                              java.lang.String applicationName)

getAllNodeNamesWithCapability

public java.util.List getAllNodeNamesWithCapability(LocalCapabilityPath path,
                                                    java.util.List nodeNamesToConsider)
Parameters:
path -
Returns:

getAgentPaths

public java.util.List getAgentPaths(CapabilityPath path)
Parameters:
path -
Returns:

getAllApplicationCapabilitesOn

public java.util.List getAllApplicationCapabilitesOn(java.lang.String nodeName)
Parameters:
nodeName -
Returns:

existingCapabilitiesOnOtherNodes

public java.util.List existingCapabilitiesOnOtherNodes(java.util.List localCapabilityPaths,
                                                       java.util.List excludingNodeNames)
Parameters:
localCapabilityPaths -
excludingNodeNames -
Returns:

existsCapabilityOnOtherNodes

protected boolean existsCapabilityOnOtherNodes(LocalCapabilityPath path,
                                               java.util.List excludingNodeNames)
Parameters:
path -
excludingNodeNames -
Returns: