org.apache.airavata.ws.monitor
Class Monitor

java.lang.Object
  extended by org.apache.airavata.ws.monitor.event.EventProducer
      extended by org.apache.airavata.ws.monitor.Monitor

public class Monitor
extends EventProducer


Field Summary
protected  MonitorConfiguration configuration
           
protected static String DEFAULT_MODEL_KEY
           
protected  Map<String,EventDataRepository> eventDataMap
           
protected static org.slf4j.Logger logger
           
protected  long messagePullTimeout
           
protected  boolean monitoring
           
protected  boolean printRawMessages
           
protected  WsmgClient wsmgClient
           
 
Constructor Summary
Monitor(MonitorConfiguration configuration)
           
 
Method Summary
 MonitorConfiguration getConfiguration()
           
 EventDataRepository getEventData()
          Deprecated. - Use getEventDataRepository() instead
 EventDataRepository getEventData(String nodeID)
          Deprecated. - Use getEventDataRepository(...) instead
 EventDataRepository getEventDataRepository()
          Return the event data repository containing all the notifications
 EventDataRepository getEventDataRepository(String nodeID)
          Return the event data repository containing all the notifications for the node
 String getExperimentId()
          Return the id of the experiment which the monitoring is done
 long getMessagePullTimeout()
          Retrieve the timeout in milliseconds for pulling messages
protected  void handleNotification(org.xmlpull.infoset.XmlElement event)
           
 boolean isMonitoring()
          is the monitoring active
 void printRawMessage(boolean print)
          Print the raw notification messages to the console as they arrive
 void resetEventData()
          Resets the graph and clear the monitoring table.
 void setMessagePullTimeout(long timeout)
          Set the timeout in milliseconds for pulling messages
 void setPrint(boolean print)
          Deprecated. - Use printRawMessage(...) instead
 void start()
           
 void startMonitoring()
          Start monitoring asynchronously
 void stop()
          Stops monitoring without using a thread.
 void stopMonitoring()
          Stop monitoring asynchronously
 void waitForCompletion()
          Wait until the monitoring is completed
 
Methods inherited from class org.apache.airavata.ws.monitor.event.EventProducer
addEventListener, removeEventListener, sendEvent, sendSafeEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.slf4j.Logger logger

configuration

protected MonitorConfiguration configuration

DEFAULT_MODEL_KEY

protected static final String DEFAULT_MODEL_KEY
See Also:
Constant Field Values

eventDataMap

protected Map<String,EventDataRepository> eventDataMap

wsmgClient

protected WsmgClient wsmgClient

printRawMessages

protected boolean printRawMessages

messagePullTimeout

protected long messagePullTimeout

monitoring

protected boolean monitoring
Constructor Detail

Monitor

public Monitor(MonitorConfiguration configuration)
Method Detail

getConfiguration

public MonitorConfiguration getConfiguration()
Returns:
The configuration for monitoring

getEventDataRepository

public EventDataRepository getEventDataRepository()
Return the event data repository containing all the notifications

Returns:

getEventDataRepository

public EventDataRepository getEventDataRepository(String nodeID)
Return the event data repository containing all the notifications for the node

Parameters:
nodeID -
Returns:

start

public void start()
           throws MonitorException
Throws:
MonitorException

stop

public void stop()
          throws MonitorException
Stops monitoring without using a thread.

Throws:
MonitorException

startMonitoring

public void startMonitoring()
Start monitoring asynchronously


stopMonitoring

public void stopMonitoring()
Stop monitoring asynchronously


resetEventData

public void resetEventData()
Resets the graph and clear the monitoring table. Remove all the extra table models available


handleNotification

protected void handleNotification(org.xmlpull.infoset.XmlElement event)
Parameters:
event -

waitForCompletion

public void waitForCompletion()
Wait until the monitoring is completed


printRawMessage

public void printRawMessage(boolean print)
Print the raw notification messages to the console as they arrive

Parameters:
print - - if true raw notifications are printed

getMessagePullTimeout

public long getMessagePullTimeout()
Retrieve the timeout in milliseconds for pulling messages

Returns:

setMessagePullTimeout

public void setMessagePullTimeout(long timeout)
Set the timeout in milliseconds for pulling messages

Parameters:
timeout -

isMonitoring

public boolean isMonitoring()
is the monitoring active

Returns:

getExperimentId

public String getExperimentId()
Return the id of the experiment which the monitoring is done

Returns:

getEventData

public EventDataRepository getEventData()
Deprecated. - Use getEventDataRepository() instead

Returns:

getEventData

public EventDataRepository getEventData(String nodeID)
Deprecated. - Use getEventDataRepository(...) instead

Parameters:
nodeID -
Returns:

setPrint

public void setPrint(boolean print)
Deprecated. - Use printRawMessage(...) instead

Parameters:
print - - if true raw notifications are printed


Copyright © 2011-2013 The Apache Software Foundation. All Rights Reserved.