kaos.policy.guard
Class KaaEnabler

java.lang.Object
  extended by kaos.policy.guard.KaaEnabler

public class KaaEnabler
extends java.lang.Object

This class is used when some action fails. The agent then uses this class to check with human and kaa if this action could somehow be performed.


Field Summary
protected  java.util.Vector _actionsForAppeal
           
protected  java.lang.String _firstContact
           
protected  Locator _kaaLocator
           
protected  KAoSAgentDirectoryServiceProxy _kaosDirectoryService
           
protected  java.util.Vector _msgQueue
           
protected  Locator _myLocator
           
protected  java.lang.String _nickName
           
protected  java.lang.String _secondContact
           
protected  Locator _slikLocator
           
protected  int _timeoutUnit
           
protected  TransportSupport _transport
           
protected  java.lang.String _transportType
           
static java.lang.String KAA
           
static java.lang.String SLIK
           
 
Constructor Summary
KaaEnabler(KAoSAgentDirectoryServiceProxy dirProxy, java.lang.String transportType, java.util.Vector actions)
           
 
Method Summary
 boolean enableAction(MethodCallRequestMsg request)
           
 Locator getLocatorForAgentNickname(java.lang.String nickName)
          A method for sending a query to directory service to find an agent's description, and from that, its locator.
protected  void printDebugString(java.lang.String msg, int loggerDisplayLevel)
           
 void receiveMessage(TransportMessage tm)
           
 void setFirstContact(java.lang.String contact)
          A method for specifying whom the classifier should contact first for appealing.
 void setSecondContact(java.lang.String contact)
          A method for specifying whom the classifier should contact if the first contact does not respond.
 void setTimeoutUnitValue(int timeoutUnit)
          A method for specifying the amount of time (in miliseconds) this classifier should wait for reply after contacting slik or Kaa.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_nickName

protected java.lang.String _nickName

_transportType

protected java.lang.String _transportType

_kaosDirectoryService

protected KAoSAgentDirectoryServiceProxy _kaosDirectoryService

_transport

protected TransportSupport _transport

_myLocator

protected Locator _myLocator

_msgQueue

protected java.util.Vector _msgQueue

_actionsForAppeal

protected java.util.Vector _actionsForAppeal

_slikLocator

protected Locator _slikLocator

_kaaLocator

protected Locator _kaaLocator

_firstContact

protected java.lang.String _firstContact

_secondContact

protected java.lang.String _secondContact

_timeoutUnit

protected int _timeoutUnit

SLIK

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

KAA

public static final java.lang.String KAA
See Also:
Constant Field Values
Constructor Detail

KaaEnabler

public KaaEnabler(KAoSAgentDirectoryServiceProxy dirProxy,
                  java.lang.String transportType,
                  java.util.Vector actions)
Method Detail

setFirstContact

public void setFirstContact(java.lang.String contact)
A method for specifying whom the classifier should contact first for appealing. The default first contact is slik.

Parameters:
contact - A String specifying either slik or Kaa. null if no one is to be contacted as first contact.

setSecondContact

public void setSecondContact(java.lang.String contact)
A method for specifying whom the classifier should contact if the first contact does not respond. The default second contact is Kaa.

Parameters:
contact - A String specifying either slik or Kaa. null if no one is to be contacted as second contact.

setTimeoutUnitValue

public void setTimeoutUnitValue(int timeoutUnit)
A method for specifying the amount of time (in miliseconds) this classifier should wait for reply after contacting slik or Kaa. The default is 5000.

Parameters:
timeout - the timeout value

getLocatorForAgentNickname

public Locator getLocatorForAgentNickname(java.lang.String nickName)
A method for sending a query to directory service to find an agent's description, and from that, its locator.

Parameters:
nickName - the nickname of the agent whose locator we want to find.
Returns:
Locator the locator of the given agent.

enableAction

public boolean enableAction(MethodCallRequestMsg request)

receiveMessage

public void receiveMessage(TransportMessage tm)

printDebugString

protected void printDebugString(java.lang.String msg,
                                int loggerDisplayLevel)