kaos.notification
Class NotifyAgent

java.lang.Object
  extended by kaos.notification.KaosAgent
      extended by kaos.notification.KaosEnforcerAgent
          extended by kaos.notification.NotifyAgent
All Implemented Interfaces:
Enforcer, TriggerConditionListener

public class NotifyAgent
extends KaosEnforcerAgent


Field Summary
protected  EmailClient _emailClient
           
protected  JabberClient _imClient
           
protected  NotifyWnd _notifyWnd
           
protected  PagerClient _pagerClient
           
protected  java.util.Hashtable _sentNotifications
           
static KAoSAgentDirectoryServiceProxy _staticKadsp
           
static java.lang.String DEFAULT_PORT
           
static java.lang.String LOCAL_HOST
           
 
Fields inherited from class kaos.notification.KaosEnforcerAgent
_controlledActions, _policyTriggerActions
 
Fields inherited from class kaos.notification.KaosAgent
_ads, _agentDesc, _agentName, _agentNickname, _ans, _domainName, _guard, _kadsp, _kaosEnabled, _lctr, _logger, _msgTransport, _mts, _sr, COABSGRID_TRANSPORT, CORBA_TRANSPORT, TCP_TRANSPORT, TRANSPORT_PROPERTY_KEY
 
Constructor Summary
NotifyAgent()
           
 
Method Summary
protected  KAoSAgentDescription getAgentDescription()
          Includes this agent as an instance of the NotificationAgent ontological class.
static KAoSAgentDirectoryServiceProxy getDirectoryServiceProxy()
           
 void initialize(java.lang.String domainName, java.lang.String agentNickname, java.lang.String parentDomainName)
          Constructor relies on superclass to register the agent with KAoS, then initializes each mode of notification.
static java.lang.String lookupAgentNickname(java.lang.String agentUUID)
           
static void main(java.lang.String[] args)
          Start the NotificationAgent in a specified domain with the given agent nickname.
 void notify(NotifyRequest nReq)
          Entry point to the notification process.
 void receiveMessage(TransportMessage tmsg)
          Implements the receiveMessage method mandated by the MessageListener interface.
protected  boolean recipientIsURI(NotifyRequest nReq)
          returns true if the recipient in the NotifyRequest is a URI, implying an ontology ref.
protected  void removeAgent()
          Called to perform cleanup activities before the agent is terminated.
protected  void sendDefaultNotification(NotifyRequest nReq)
          Called when the NotifyReqest includes both a recipient and a mode Sends the requested notification without checking obligation policies
 void updateTriggerCondition(BasicActionDescription triggerCondition)
          This method is called by Guard upon receiving an obligation policy containing the specified triggerACD.
 
Methods inherited from class kaos.notification.KaosEnforcerAgent
addEnforcedAction, checkObligations, getControlledActionClasses, getName
 
Methods inherited from class kaos.notification.KaosAgent
assertFalse, assertTrue, equals, getDirectoryService, getDomainName, hashCode, logMessage, logMessage, printTransportMessage, registerWithKaos, sendMessageTo, start
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_HOST

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

DEFAULT_PORT

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

_emailClient

protected EmailClient _emailClient

_imClient

protected JabberClient _imClient

_pagerClient

protected PagerClient _pagerClient

_sentNotifications

protected java.util.Hashtable _sentNotifications

_notifyWnd

protected NotifyWnd _notifyWnd

_staticKadsp

public static KAoSAgentDirectoryServiceProxy _staticKadsp
Constructor Detail

NotifyAgent

public NotifyAgent()
Method Detail

main

public static void main(java.lang.String[] args)
Start the NotificationAgent in a specified domain with the given agent nickname. args - domainName, agentNickname, [host, port, [parentDomain]]


initialize

public void initialize(java.lang.String domainName,
                       java.lang.String agentNickname,
                       java.lang.String parentDomainName)
                throws java.lang.Exception
Constructor relies on superclass to register the agent with KAoS, then initializes each mode of notification.

Overrides:
initialize in class KaosEnforcerAgent
Parameters:
domainName -
parentDomainName -
agentNickname -
Throws:
java.lang.Exception

removeAgent

protected void removeAgent()
Called to perform cleanup activities before the agent is terminated.

Overrides:
removeAgent in class KaosEnforcerAgent

getAgentDescription

protected KAoSAgentDescription getAgentDescription()
Includes this agent as an instance of the NotificationAgent ontological class.

Overrides:
getAgentDescription in class KaosAgent
Returns:
an AgentDescription for this use-case.
See Also:
AgentDescription, AgentDirectoryService#createAgentDescription, "JAS Specification, Section(s) 2.2.2.6, 4.5.1"

receiveMessage

public void receiveMessage(TransportMessage tmsg)
Implements the receiveMessage method mandated by the MessageListener interface. This method requires the TransportMessage contain a NotifyMessage object.

Overrides:
receiveMessage in class KaosAgent
See Also:
MessageListener, TransportMessage, "JAS Specification, Section(s) 3.4.2, 4.7.2"

notify

public void notify(NotifyRequest nReq)
Entry point to the notification process. Checks whether the request included both a recipient and a mode to send a notification without obligation policies Then checks for policies obliging NotificationActions and fulfills those obligations as well

Parameters:
nReq -

sendDefaultNotification

protected void sendDefaultNotification(NotifyRequest nReq)
Called when the NotifyReqest includes both a recipient and a mode Sends the requested notification without checking obligation policies

Parameters:
nReq -

updateTriggerCondition

public void updateTriggerCondition(BasicActionDescription triggerCondition)
Description copied from interface: TriggerConditionListener
This method is called by Guard upon receiving an obligation policy containing the specified triggerACD. The listener will now start monitoring agent actions in order to detect the occurrence of the trigger condition.

Specified by:
updateTriggerCondition in interface TriggerConditionListener
Overrides:
updateTriggerCondition in class KaosEnforcerAgent
Parameters:
triggerCondition - BasicActionDescription describes the trigger condition the listener has registered for.

recipientIsURI

protected boolean recipientIsURI(NotifyRequest nReq)
returns true if the recipient in the NotifyRequest is a URI, implying an ontology ref. to a Human Instance

Parameters:
nReq -

getDirectoryServiceProxy

public static KAoSAgentDirectoryServiceProxy getDirectoryServiceProxy()

lookupAgentNickname

public static java.lang.String lookupAgentNickname(java.lang.String agentUUID)