All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class kraft.monitor.adapter.KraftAgent

java.lang.Object
   |
   +----kraft.monitor.adapter.KraftAgent

public class KraftAgent
extends Object
implements Monitorable
Implements the requirements for a Monitorable object. Used to represent a Kraft Agent so it can be registered by the Monitor
Class could be extended to allow the Monitor to 'callback' this object, which would act as a proxy for the actual (possibly Prolog) agent, communicate the monitor's request to the agent, and receive replies from the agent

Author:
Ted Francis

Constructor Index

 o KraftAgent(String)
Create a KraftAgent with the given name

Method Index

 o addInfoPair(String, String)
Adds more info to the agent, in a similar way to resource: type, protocol: type, This info is used when getDisplayString(2) is called.
 o getDisplayName(int)
Gets the name of this agent in a formatted form.
 o getFullName()
The unformatted name of the agent
 o getResourceProtocol()
The protocol used between the agent and its resource (if any).
 o getResourceType()
The name of the resource this agent wraps onto (if any).
 o getType()
The Monitorable type of the agent.
 o setResource(String, String)
Sets the type of resource, and protocol this agent uses to communicate with that resource Set either param to null or "" if required.
 o setRole(String)
Set the KRAFT role of this agent.

Constructors

 o KraftAgent
 KraftAgent(String n) throws NullPointerException
Create a KraftAgent with the given name

Methods

 o getDisplayName
 public String getDisplayName(int detail_level)
Gets the name of this agent in a formatted form.

Parameters:
detail_level - if 1, returns just the name of the agent if 2, returns more detail about the agent
 o getFullName
 public String getFullName()
The unformatted name of the agent

 o getType
 public int getType()
The Monitorable type of the agent. eg. BROKER, USER, MIDDLE, SERVER

 o getResourceType
 public String getResourceType()
The name of the resource this agent wraps onto (if any). Otherwise returns ""

 o getResourceProtocol
 public String getResourceProtocol()
The protocol used between the agent and its resource (if any). Otherwise returns ""

 o setRole
 public void setRole(String role)
Set the KRAFT role of this agent. Used to discern the Monitorable type of the agent for display purposes. The agent will be displayed on the screen in different areas depending on the role

Parameters:
role - Any one of "ontology_agent", "ontologyagent", "facilitator", "user_agent", "useragent", "auxiliary", "mediator", "resource", "wrapper"
See Also:
getType
 o setResource
 public void setResource(String resource,
                         String protocol)
Sets the type of resource, and protocol this agent uses to communicate with that resource Set either param to null or "" if required.

 o addInfoPair
 public void addInfoPair(String field,
                         String value)
Adds more info to the agent, in a similar way to resource: type, protocol: type, This info is used when getDisplayString(2) is called.

Parameters:
field - any label
value - any label -- the info pair will be shown thus ( field : value )

All Packages  Class Hierarchy  This Package  Previous  Next  Index