4. Defined Agents
This section describes the purpose of each agent, how it can be used to
achieve goals and what its restrictions are.
4.1 Queriable Agents
A queriable agent allows other agents to find out about knowledge it collected
already. They are defined in the class QueriableAgent.
All queriable agents understand the following messages:
-
( type:getLinks, sendTo:<aid> )
Retrieve all links to other queriable agents that this agent collected
so far.
Returns ( type: getlinksresult, links: <AgentLink[]> )
to <aid>.
-
( type:getAlias, sendTo:<aid> )
Retrieve the user-defined alias name of this agent.
Returns ( type: getaliasresult, presenter: <MinPresenter> )
to <aid>.
-
( type:setAlias, alias:<text> )
Change the user-defined alias name of this agent.
-
( type:getData, handle:<handle>, sendTo:<aid> )
Retrieve the data unit associated with a certain agent link handle.
Returns ( type: getdataresult, presenter: <MaxPresenter> ) to
<aid>.
-
( type:query, querytext:<text>, sendTo:<aid> )
Perform a query on the data of this agent. The query is specified
by <text>.
Returns ( type: queryresult, handle: <Long> ) to <aid>.
The handle can be used to create an agent link.
-
( type:updateStatistics, agentlink:<al> )
Increment the counter associated with the agent link <al>.
-
( type:getStatistics, agentlink:<al>, sendTo:<aid> )
Retrieve the counter associated with the agent link <al>.
Returns ( type: statistics, agentlink:<al>, traversals:<Long>
) to <aid>.
4.2 Data Source Agents
Data source agents represent certain types of data that can be queried.
All data source agents are subtypes of the class QueryAgent
(which again is a subtype of QueriableAgent).
Currently, two types of data are supported: plain text (in a local
file or at a URL) and JDBC compliant databases. These agents are defined
in the classes TextfileQueryAgent and JDBCQueryAgent,
respectively.
Both agent types understand the same messages as the queriable agent.
Additionally, the textfile query agent understands this message:
-
( type:setParameters, filepath:<path> )
Set the path to the textfile represented by this agent. <path>
can also be a URL.
The JDBC query agent understands this additional message:
-
( type:setParameters, dbdriver:<classname>, dburl:<url>, username:<name>,
password:<password> )
Set the database driver, the URL to the database, the username
and the password.
4.3 Search Agents
Search agents perform the search for data. In order to do so, they start
at one agent, follow its links to other agents (according to some traversal
strategy), and query each agent they encounter in order to collect the
requested data. Search agents are subtypes of QueriableAgent.
Additionally, search agents understand the following messages:
-
( type:setParameters, itinerary:<class name>, start:<aid>
)
Set the traversal strategy and the starting point of the traversal.
-
( type:setSearchText, searchtext:<text>, ipagent:<aid> )
Set the text to search for. If <aid> is set, a message (
type: searchdone ) is sent to <aid>.
4.4 IP Agent
The IP agent represents a certain user but is also a QueriableAgent.
Additionally, IP agents maintain user information and a cache of the agent
links accessible from this agent.
IP agents understand these messages:
-
( type:getCache, sendto:<aid> )
Retrieve the cache of this IP agent.
Returns ( type: getcacheresult, cache:<IP_Cache> ) to
<aid>.
-
( type:runQuery, querytext:<string>, sendto:<aid> )
Perform a query starting at this IP agent. The IP agent launches
new search agents for this task.
Returns ( type: querydone ) to <aid>.
-
( type:searchdone )
A previously launched query is done.
-
( type: collectiondone )
A previously launched statistics collection (see below) is done.
-
( type:login, userid:<string>, sendto:<aid> )
Request for password by a login agent.
Returns ( type: loginresult, password: <String>, ipid: <aid>
) to <aid>.
-
( type:init, userid:<string>, password:<string> )
Initialize this IP agent with a user name and password.
4.5 Statistics Collector Agents
Every time data is accessed or links are traversed, the local cache of
an IP agent may become inconsistent, i.e. it no longer represents the "real
world" outside of the IP agent. In this case, a statistics collector agent
is launched that rebuilds the cache by traversing all links and collecting
the counters associated with them.
The statistics collector agents understand this message:
-
( type:setOriginator, originator:<aid> )
Set the agent to inform at the end of the collection by a (
type: collectiondone ) message.
4.6 Display Agents
Display agents allow for user interaction and present the cache of any
IP agent graphically.
Display agents understand these messages:
-
( type:querydone )
A previously launched query is done.
-
( type: setOriginator, originator: <aid> )
Set the ID of IP agent whose cache should be displayed.
4.7 Login Agent
Before a user can use the system, s/he has to login. This is done by the
login agent. It asks the user for his/her name and password and then tries
to detect the IP agent matching this name and password in order to display
it.
Login agents understand this message:
-
( type: loginresult, password: <String>, ipid: <aid> )
A previously issued login request returned this password and IP
agent ID.