kaos.core.csi.usecase.policy
Class ObligationActorForNotificationAction

java.lang.Object
  extended by kaos.core.service.util.MethodCallRequestHandler
      extended by kaos.core.csi.KAoSActorImpl
          extended by kaos.core.csi.request.ObligationRequestReceiverImpl
              extended by kaos.core.csi.usecase.policy.ObligationActorForNotificationAction
All Implemented Interfaces:
KAoSActor, ObligationRequestReceiver

public class ObligationActorForNotificationAction
extends kaos.core.csi.request.ObligationRequestReceiverImpl

This class is an example of an actor, performing obligations for NotificationAction defined by: http://ontology.ihmc.us/Notification/NotificationAction.owl#NotificationAction. To support the functionality of ObligationActorForNotificationAction, the classe has been placed in the following hierarchy: KAoSActorImpl | ObligationRequestReceiverImpl | ObligationActorForNotificationAction Obligation actors are required to implement the kaos.core.csi.request.ObligationRequestReceiver defining the method for receiving and procesing obligations: processObligationRequest(ActionInstanceDescription obligationAID, ActionInstanceDescription triggerAID) The above method is called remotely by the guard as a part of the obligation policy enforcement. ObligationActorForNotificationAction's superclass, ObligationRequestReceiverImpl, implements this method, however, it relies on the subclasses to complete the obligation enforcement. In particular, ObligationRequestReceiverImpl only initiates processing of obligations in its implementation of "processObligationRequest": it accepts the obligation in the form of the ActionInstanceDescription, it retrieves the name of the obligation action and then, to complete obligation enforcement, it calls a method with the action name and the following arguments: obligationActionName(ActionInstanceDescription obligationAID, ActionInstanceDescription triggerAID) In the case of ObligationActorForNotificationAction, the method is: NotificationAction(ActionInstanceDescription obligationAID, ActionInstanceDescription triggerAID) The NotificationAction() method is the starting point to the implementation of NotificationAction enforcement. For messaging, ObligationActorForNotificationAction implements the javax.agent.service.transport.MessageListener, implemented by KAoSActorImpl.

Author:
rjeffers, lbunch

Field Summary
protected  kaos.notification.email.EmailClient _emailClient
           
protected  kaos.notification.gui.NotifyWnd _notifyWnd
           
protected  kaos.notification.pager.PagerClient _pagerClient
           
protected  QueryState _queryState
           
protected  java.util.Hashtable _sentNotifications
           
 
Fields inherited from class kaos.core.csi.KAoSActorImpl
_actorDesc, _autoCommit, _lctr, _logger, _preferredTransportName, _propertiesToModify, _registered, _registration, _transports, _transportSupport
 
Fields inherited from class kaos.core.service.util.MethodCallRequestHandler
_methodCallProxy, myAgentDescription, myHelper, myLocator, myMessageReceiver, myMessageSender, myMts, myNickName
 
Constructor Summary
ObligationActorForNotificationAction(java.lang.String[] args)
          The command line arguments required to bootstrap an instance of ObligationActorForNotificationAction are: -name NotifyAgent -guid NotifyAgent -transport tcp -domains NotifyDomain The -name keyword is followed by the agent's nickname, NotifyAgent.
 
Method Summary
static void main(java.lang.String[] args)
          The command line arguments required to instantiate the ObligationActorForNotificationAction are: -name NotifyAgent -guid NotifyAgent -transport tcp -domains NotifyDomain The -name keyword is followed by the agent's nickname, NotifyAgent - required.
 void NotificationAction(ActionInstanceDescription obligationAID, ActionInstanceDescription triggerAID)
          This method is called by the superclass, ObligationRequestReceiverImpl, in order to complete the enforcement of an obligation, which in this case is the NotificationAction.
 void start()
          In this method, this obligation actor continues its policy- and application-specific instantiation: - specifies ontological type of a NotificationAgent in its KAoSAgentDescription - registers with KAoS - initializes its vars - creates its gui - obtains a reference the CSI Query Service needed to obtain addresses to send notifications via email - initializes the notification modes
 
Methods inherited from class kaos.core.csi.request.ObligationRequestReceiverImpl
processObligationRequest, receiveMessage
 
Methods inherited from class kaos.core.csi.KAoSActorImpl
addCapability, addOntologicalType, addOntologicalType, addProperty, addProperty, addPropertyValue, addTransport, commitPropertyValues, deregisterFromKAoS, equals, getAgentDescription, getCapabilities, getConceptMappingName, getDomainNames, getEntityOntologicalTypeNames, getEntityOntologicalTypes, getGUID, getName, getProperties, getProperty, getPropertyValue, getTransport, getTransports, hashCode, isAutoPropertyValueCommit, isGuarded, isRegistered, logMessage, logMessage, printTransportMessage, registerWithKAoS, registerWithKAoS, removeCapability, removeOntologicalType, removeProperty, removePropertyValue, removeTransport, sendMessage, sendMessage, setAutoPropertyValueCommit, setCapabilities, setConceptMappingName, setGUID, setMyDescription, setName, setOntologicalTypes, setProperties, setPropertyValue, setRegistered
 
Methods inherited from class kaos.core.service.util.MethodCallRequestHandler
bindToTransport, initialize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_emailClient

protected kaos.notification.email.EmailClient _emailClient

_pagerClient

protected kaos.notification.pager.PagerClient _pagerClient

_sentNotifications

protected java.util.Hashtable _sentNotifications

_notifyWnd

protected kaos.notification.gui.NotifyWnd _notifyWnd

_queryState

protected QueryState _queryState
Constructor Detail

ObligationActorForNotificationAction

public ObligationActorForNotificationAction(java.lang.String[] args)
                                     throws java.lang.Exception
The command line arguments required to bootstrap an instance of ObligationActorForNotificationAction are: -name NotifyAgent -guid NotifyAgent -transport tcp -domains NotifyDomain The -name keyword is followed by the agent's nickname, NotifyAgent. Required. The -guid keyword is followed by the agent's guid, NotifyAgent. Ooptional. In tis case, the nickname and the guid are the same to allow re-using the same policy snapshot. In most cases the guid would be assigned by the registration service in KAoS. The -transport keyword is followed by the name of the requested transport. Optional, the default is "tcp". The -domains keyword is followed by the name of the domain to register the NotifyAgent in. Required. This constructor instantiates a new KAoS-aware ObligationActorForNotificationAction using JAS services for transport, naming and agent directory. During the bootstrapping steps the instance: - obtains a reference to CSI Registration - binds itself to CSI Transport - asks CSI Registration to create a KAoSAgentDescription for itself

Parameters:
args - - containing the arguments described above.
Throws:
java.lang.Exception - if some of the required arguments are missing or KAoS Registration or transport services are not available.
Method Detail

start

public void start()
           throws java.lang.Exception
In this method, this obligation actor continues its policy- and application-specific instantiation: - specifies ontological type of a NotificationAgent in its KAoSAgentDescription - registers with KAoS - initializes its vars - creates its gui - obtains a reference the CSI Query Service needed to obtain addresses to send notifications via email - initializes the notification modes

Throws:
java.lang.Exception - if the connection to the Directory Service cannot be established, or if the registering instance has been already registered in the Directory Service, or if the QueryState service cannot be obtained.

NotificationAction

public void NotificationAction(ActionInstanceDescription obligationAID,
                               ActionInstanceDescription triggerAID)
This method is called by the superclass, ObligationRequestReceiverImpl, in order to complete the enforcement of an obligation, which in this case is the NotificationAction.

Parameters:
obligationAID - is an ActionInstanceDescription containing the NotificationAction and its properties.
triggerAID - is an ActionInstanceDescription containing the trigger action name and its properties. The trigger action provides more information about the context, in which the trigger action has occurred.

main

public static void main(java.lang.String[] args)
The command line arguments required to instantiate the ObligationActorForNotificationAction are: -name NotifyAgent -guid NotifyAgent -transport tcp -domains NotifyDomain The -name keyword is followed by the agent's nickname, NotifyAgent - required. The -guid keyword is followed by the agent's guid, NotifyAgent - optional. In tis case, the nickname and the guid are the same to allow re-using the same policy snapshot. In most cases the guid would be assigned by the registration service in KAoS. The -transport keyword is followed by the name of the requested transport - optional, the default is "tcp". The -domains keyword is followed by the name of the domain to register the NotifyAgent in - required.

Parameters:
args - - described above


Copyright © 2006 IHMC All Rights Reserved.