kaos.autonomy
Class Kaa

java.lang.Object
  extended by kaos.core.service.boot.KAoSAgent
      extended by kaos.autonomy.Kaa
All Implemented Interfaces:
KAoSAgentHelper

public class Kaa
extends KAoSAgent


Field Summary
 
Fields inherited from class kaos.core.service.boot.KAoSAgent
_agentDescription, _agentDirectoryService, _agentNamingService, _agentNickname, _lctr, _logger, _messageTransportService, _name, _serviceRoot
 
Constructor Summary
Kaa()
           
 
Method Summary
protected  TransportMessage buildTransportMessage(AgentDescription agt, java.lang.Object content)
          build transport message given content to be sent
 void controlAdjustableAutonomy(java.lang.String appealerName, Locator appealerLocator, ActionInstanceDescription aid, java.lang.String policyID, java.lang.String policyType)
          call Kaa decision making module
protected  AgentDescription findAgent(java.lang.String agentName)
          find agent description for a given agent ID
 KAoSAgentDirectoryServiceProxy getDirectoryServiceProxy()
          get directory service proxy
 Locator getGuardLocator(java.lang.String actor)
          get the locator of Guard
static void main(java.lang.String[] args)
          main method
 void receiveMessage(TransportMessage tmsg)
          steps to take when receive message from agent
 void reinstateObligationPolicy(Locator guardLocator, java.lang.String policyID)
          tell a guard to reinstate an obligation policy
protected  void sendMessageToClassifier(Locator appealerLocator, java.lang.Object content)
          send given message content to classifier
protected  void sendRequestToGuard(Locator guardLocator, java.lang.String request, java.util.Vector args)
          send a request to the specified guard.
 void suspendObligationPolicy(Locator guardLocator, java.lang.String policyID)
          tell a guard to suspend an obligation policy
 
Methods inherited from class kaos.core.service.boot.KAoSAgent
acquireAgentDirectoryService, acquireAgentName, acquireAgentNamingService, acquireMessageTransportService, assertFalse, assertTrue, bindToMessageTransportService, checkPermission, createTransportMessage, equals, establishAgentDescription, findAgentDescriptionForID, findAgentDescriptionForNickname, getAgentID, getKAoSAgentDescription, hashCode, initialize, logMessage, logMessage, printTransportMessage, sendMessage, verifyRegistration
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Kaa

public Kaa()
Method Detail

controlAdjustableAutonomy

public void controlAdjustableAutonomy(java.lang.String appealerName,
                                      Locator appealerLocator,
                                      ActionInstanceDescription aid,
                                      java.lang.String policyID,
                                      java.lang.String policyType)
call Kaa decision making module

Parameters:
aid - Action instance description

receiveMessage

public void receiveMessage(TransportMessage tmsg)
steps to take when receive message from agent

Overrides:
receiveMessage in class KAoSAgent
Parameters:
tmsg - Transport message
See Also:
MessageListener, TransportMessage, "JAS Specification, Section(s) 3.4.2, 4.7.2"

sendMessageToClassifier

protected void sendMessageToClassifier(Locator appealerLocator,
                                       java.lang.Object content)
send given message content to classifier

Parameters:
content - Message to be sent

sendRequestToGuard

protected void sendRequestToGuard(Locator guardLocator,
                                  java.lang.String request,
                                  java.util.Vector args)
send a request to the specified guard.

Parameters:
guardLocator - locator of the guard to whom to send the request
request - Specific request to be sent
args - Necessary arguments for that request.

findAgent

protected AgentDescription findAgent(java.lang.String agentName)
find agent description for a given agent ID

Parameters:
agentName - Actor name
Returns:
Description of the actor

buildTransportMessage

protected TransportMessage buildTransportMessage(AgentDescription agt,
                                                 java.lang.Object content)
build transport message given content to be sent

Parameters:
agt - Description of an agent which will receive a message
content - Content of message to be sent
Returns:
TransportMessage

getGuardLocator

public Locator getGuardLocator(java.lang.String actor)
                        throws DirectoryFailure
get the locator of Guard

Parameters:
actor - A String specifying the name of agent
Returns:
Guard locator
Throws:
DirectoryFailure - If error in the D.S.

suspendObligationPolicy

public void suspendObligationPolicy(Locator guardLocator,
                                    java.lang.String policyID)
tell a guard to suspend an obligation policy

Parameters:
guardLocator - Locator of the guard to whom send the message to
policyID - ID of the policy that is to be suspended.

reinstateObligationPolicy

public void reinstateObligationPolicy(Locator guardLocator,
                                      java.lang.String policyID)
tell a guard to reinstate an obligation policy

Parameters:
guardLocator - Locator of the guard to whom send the message to
policyID - ID of the policy that is to be reinstated.

getDirectoryServiceProxy

public KAoSAgentDirectoryServiceProxy getDirectoryServiceProxy()
get directory service proxy

Returns:
directory service proxy

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
main method

Parameters:
name - Name of agent
transport - Method of transport
Throws:
java.lang.Exception