org.oddjob.webapp.model
Class JobInfoLookup

java.lang.Object
  extended by org.oddjob.webapp.model.JobInfoLookup

public class JobInfoLookup
extends Object

Provide a lookup facility for job information.

Author:
Rob Gordon.

Constructor Summary
JobInfoLookup(IconRegistry iconRegistry, ArooaSession session)
          Constructor.
 
Method Summary
 WebJobActions actionsFor(String refId)
          Get the WebJobActions for a node.
 List<LogEvent> consoleEventsFor(String refId)
          Provide a list of console LogEvents.
 void destroy()
          Free up resources.
 int getJobCount()
          The number of jobs cached.
 String getRootRefId()
          Get the root reference id.
 List<LogEvent> logEventsFor(String refId)
          Provide a list of logger LogEvents.
 NodeInfo nodeInfoFor(String refId)
          Get NodeInfo for the given refId.
 Map<String,String> propertiesFor(String refId)
          Get a map of properties for the properties tab.
 void setRoot(Object root, ExplorerContext eContext)
          Set the root node.
 StateEvent stateFor(String refId)
          Get the last state event for the given refId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobInfoLookup

public JobInfoLookup(IconRegistry iconRegistry,
                     ArooaSession session)
Constructor.

Parameters:
iconRegistry - The icon registry.
Method Detail

setRoot

public void setRoot(Object root,
                    ExplorerContext eContext)
Set the root node. This method must be called before the lookup can be used. Setting logFormat and other such properties must be done before this method is called.

Parameters:
root - The root node.

getRootRefId

public String getRootRefId()
Get the root reference id.

Returns:
The reference id.

stateFor

public StateEvent stateFor(String refId)
Get the last state event for the given refId.

Parameters:
refId - The refId.
Returns:
The last state event. Null if it isn't Stateful.

nodeInfoFor

public NodeInfo nodeInfoFor(String refId)
Get NodeInfo for the given refId.

Parameters:
refId - The refId.
Returns:
Node Info. Never null.

propertiesFor

public Map<String,String> propertiesFor(String refId)
Get a map of properties for the properties tab.

Parameters:
refId - The refId.
Returns:
A map of properties. May be null if the node has been destroyed by Oddjob.

consoleEventsFor

public List<LogEvent> consoleEventsFor(String refId)
Provide a list of console LogEvents.

Parameters:
refId - The refId of the job.
Returns:
A list of LogEvent objects.

logEventsFor

public List<LogEvent> logEventsFor(String refId)
Provide a list of logger LogEvents.

Parameters:
refId - The refId of the job.
Returns:
A list of LogEVent objects.

actionsFor

public WebJobActions actionsFor(String refId)
Get the WebJobActions for a node.

Parameters:
refId -
Returns:

getJobCount

public int getJobCount()
The number of jobs cached.

Returns:

destroy

public void destroy()
Free up resources.