unsw.cse.mica.blackboard
Interface BlackboardActions

All Known Subinterfaces:
Blackboard
All Known Implementing Classes:
DefaultBlackboard, SimpleBlackboard, SQLBlackboard

public interface BlackboardActions

The interface definfes the agent Actions that must be handled by a blackboard

Author:
jhw

Method Summary
 java.lang.String connect(java.lang.String proposedName)
          The connect message should be the first message sent once the agent connects to the Blackboard.
 java.lang.String deleteMob(java.lang.String agentName, java.lang.String mobName)
          Delete a frame from the blackboard.
 java.lang.String disconnect(java.lang.String agentName)
          Disconnect the agent from the Blackboard
 TypeManager getTypeManager()
          Get the blackboard's type manager
 java.util.List mobSearch(java.lang.String agentName, java.lang.String query)
          Finds all frame meeting the criteria.
 Mob readMob(java.lang.String agentName, java.lang.String mobName)
          Retrieve a mob by its name.
 java.lang.String register(java.lang.String agentName, java.lang.String mobType)
          Register the agent for notification of blackboard events involving a particular mobType.
 java.lang.String replaceMob(java.lang.String agentName, Mob mob)
          replace a mob on the blackboard.
 java.lang.String unregister(java.lang.String agentName, java.lang.String mobType)
          Forget that we were interested in this frame type.
 java.lang.String writeMob(java.lang.String agentName, Mob mob)
          Makes a frame on the blackboard.
 

Method Detail

getTypeManager

TypeManager getTypeManager()
Get the blackboard's type manager

Returns:
the blackboard's type manager (which should never be null, although it could initially be empty)

connect

java.lang.String connect(java.lang.String proposedName)
The connect message should be the first message sent once the agent connects to the Blackboard.

Parameters:
proposedName - The agent name proposed by the agent.
Returns:
The actual agent name (usually the requested name with a suffix) or MicaConstants.RESULT_ERROR if an error occurred

disconnect

java.lang.String disconnect(java.lang.String agentName)
Disconnect the agent from the Blackboard

Parameters:
agentName - the name of the agent that is disconnecting
Returns:
MicaConstants.RESULT_SUCCESS, MicaConstants.RESULT_NOSUCHAGENT or MicaConstants.RESULT_ERROR

register

java.lang.String register(java.lang.String agentName,
                          java.lang.String mobType)
Register the agent for notification of blackboard events involving a particular mobType. Once registered, the agent will be notified whenever changes are made

Parameters:
agentName - the agent that wants to register
mobType - The mob type we are interested in listening to.
Returns:
MicaConstants.RESULT_SUCCESS, MicaConstants.RESULT_NOSUCHAGENT or MicaConstants.RESULT_ERROR

unregister

java.lang.String unregister(java.lang.String agentName,
                            java.lang.String mobType)
Forget that we were interested in this frame type.

Parameters:
mobType -
Returns:
MicaConstants.RESULT_SUCCESS, MicaConstants.RESULT_NOSUCHAGENT or MicaConstants.RESULT_ERROR

readMob

Mob readMob(java.lang.String agentName,
            java.lang.String mobName)
Retrieve a mob by its name.

Parameters:
agentName - the agent requesting the mob
mobName - the name of the desired mob
Returns:
The desired mob, or null if it was not found or an error occurred

writeMob

java.lang.String writeMob(java.lang.String agentName,
                          Mob mob)
Makes a frame on the blackboard.

Parameters:
agentName - the name of the agent that sent the mob
mob - the mob to write to the blackboard
Returns:
The name that has been given to the frame, or MicaConstants.RESULT_ERROR if an error occurred.

deleteMob

java.lang.String deleteMob(java.lang.String agentName,
                           java.lang.String mobName)
Delete a frame from the blackboard.

Parameters:
agentName - the name of the agent that wants the mob deleted
mobName - the name of the mob to delete
Returns:
MicaConstants.RESULT_SUCCESS, MicaConstants.RESULT_NOSUCHMOB or MicaConstants.RESULT_ERROR

replaceMob

java.lang.String replaceMob(java.lang.String agentName,
                            Mob mob)
replace a mob on the blackboard.

Parameters:
agentName - the name of the agent that wants the mob replaced
mob - the new value for the mob
Returns:
MicaConstants.RESULT_SUCCESS, MicaConstants.RESULT_NOSUCHMOB or MicaConstants.RESULT_ERROR

mobSearch

java.util.List mobSearch(java.lang.String agentName,
                         java.lang.String query)
Finds all frame meeting the criteria.

Parameters:
query -
Returns:
A (possibly empty) list of mobs matching the criteria, or null if an error occurred