ADK CVS

tryllian.are.persistence.spi
Interface AgentSerializer


public interface AgentSerializer

The AgentSerializer is an interface by which persistence plugins can obtain data about an agent. This abstracts the actual agent-datastructures inside the ARE from the persistence implementation.

For each agent, a separate AgentSerializer is provided by the ARE.


Field Summary
static java.lang.String CATEGORY_RUNTIME
          The category for runtime attributes.
static java.lang.String CATEGORY_STATISTICAL
          The category for statistical attributes.
static java.lang.String TYPE_BINARY
          The type for binary serialization.
static java.lang.String TYPE_LOGICAL
          The type for logical serialization.
 
Method Summary
 java.lang.String getAgent()
          Returns an encoded String containing the storable data of an agent.
 java.util.Map getAgentAttributes(java.lang.String category)
          Returns the agent's attributes in the form of a map containing key-value pair combinations.
 byte[] getAgentBytes()
          Returns an array of bytes containing the storable data of an agent.
 java.lang.String getAgentID()
          Returns the agentID encoded as a string.
 ARLSerializer getARL()
          Returns the AgentResourceLocator Serializer which represents the current agent's AgentResourceLocator.
 java.lang.String getSerializationType()
          Returns an identifier signifying the serialization type of the agent.
 

Field Detail

CATEGORY_RUNTIME

public static final java.lang.String CATEGORY_RUNTIME
The category for runtime attributes.

See Also:
Constant Field Values

CATEGORY_STATISTICAL

public static final java.lang.String CATEGORY_STATISTICAL
The category for statistical attributes.

See Also:
Constant Field Values

TYPE_BINARY

public static final java.lang.String TYPE_BINARY
The type for binary serialization.

See Also:
Constant Field Values

TYPE_LOGICAL

public static final java.lang.String TYPE_LOGICAL
The type for logical serialization.

See Also:
Constant Field Values
Method Detail

getAgent

public java.lang.String getAgent()
                          throws PersistenceException
Returns an encoded String containing the storable data of an agent.

Returns:
an encoded String containing the storable data of an agent.
Throws:
PersistenceException - if an error occurred while serializing.

getAgentBytes

public byte[] getAgentBytes()
                     throws PersistenceException
Returns an array of bytes containing the storable data of an agent.

Returns:
a byte-array containing the storable data of an agent.
Throws:
PersistenceException - if an error occurred while serializing.

getSerializationType

public java.lang.String getSerializationType()
                                      throws PersistenceException
Returns an identifier signifying the serialization type of the agent.

Returns:
either TYPE_BINARY or TYPE_LOGICAL
Throws:
PersistenceException - if the agent is not serializable

getAgentID

public java.lang.String getAgentID()
Returns the agentID encoded as a string.

Returns:
an encoded string containing the agent ID

getAgentAttributes

public java.util.Map getAgentAttributes(java.lang.String category)
                                 throws PersistenceException
Returns the agent's attributes in the form of a map containing key-value pair combinations. Key and value are both strings.

Parameters:
category - the category as defined above
Returns:
a (String, String) Map.
Throws:
PersistenceException - if the category is unknown, or there was a problem obtaining one of the attributes

getARL

public ARLSerializer getARL()
Returns the AgentResourceLocator Serializer which represents the current agent's AgentResourceLocator.

Returns:
the ARLSerializer related to this agent.

Copyright 2005, Tryllian Solutions B.V.