com.autonomy.aci.businessobjects
Class Agent

java.lang.Object
  extended bycom.autonomy.aci.businessobjects.AciBusinessObject
      extended bycom.autonomy.aci.businessobjects.BaseAgent
          extended bycom.autonomy.aci.businessobjects.Agent
All Implemented Interfaces:
java.io.Serializable

public class Agent
extends BaseAgent

Class to represent a user agent as created on and managed by IDOL server. The agent's ID, to be used when identifying the agent to IDOL using the 'aid' parameter in agent type actions, is obtained using:

String sID = agent.getAgentID()

Under most circumstances, an Agent should be read from IDOL using the AgentFunctionality interface:

	IDOLService idolService = new IDOLService();
	...
	AgentFunctionality agentFun = idolService.useAgentFunctionality();
 	Agent agent = agentFun.getAgent(sAgentID)
 

Modifying the agent's training and details using the public access methods only changes the values for these agent parameters on the local object:

agent.setTraining("document management");
agent.addDatabase("Archive");

To update the agent details on the IDOL service you then need to send the modified agent object using the AgentFunctionality interface:

	agentFun.updateAgent(agent)
 

See Also:
IDOLService, AgentFunctionality, Serialized Form

Field Summary
static java.lang.String CREATIONDATE_FIELD_NAME
           
static int DEFAULT_NUM_RESULTS
           
static int DEFAULT_THRESHOLD
           
 
Constructor Summary
Agent()
          Construct an agent with no name, ID or information.
Agent(java.lang.String sAID)
          Construct an agent with a given ID but with no name or retrieval information.
 
Method Summary
 void addDatabase(java.lang.String sDatabasename)
          Add a database to those which will be queried when performing an e.g.
 void addTrainingDoc(Document doc)
          Add a document to the agent's training.
 void clearAgentFields()
          Deletes all existing agent fields and their values.
 void clearDatabases()
          Remove all database names from those which will be queried when performing an e.g.
 void clearTrainingDocs()
          Remove all documents from the agent's training.
 java.util.Set getAgentFieldNames()
          Read the names of all the fields that have been set on this agent.
 java.util.HashMap getAgentFields()
          Read all the fields that have been set on this agent.
 java.lang.String getAgentFieldValue(java.lang.String sFieldname)
          Read the value of an agent field.
 java.lang.String getAgentFieldValue(java.lang.String sFieldname, java.lang.String sDefaultValue)
          Read the value of an agent field.
 java.lang.String getAgentID()
          Read the unique ID of the agent.
 java.lang.String getAgentname()
          Read the name of the agent.
 java.util.ArrayList getDatabases()
          Obtains the list of databases that this agent is set to retrieve documents from.
 int getMaxAgeOfResults()
          Read the maximum age documents can have to be retrieved as part of this agent's result set.
 int getNumResults()
          Read the maximum number of results that will be returned within a agent's result set.
 int getThreshold()
          Read the minimum relevence to the agent's training that documents must have to be retrieved as part of this agent's result set.
 java.lang.String getTraining()
          Read the textual training for this agent.
 java.util.ArrayList getTrainingDocs()
          Obtains the list of documents that this agent is trained on.
 boolean isAlerting()
          Read whether or not the agent emails matching results on an alerting basis.
 boolean isEmailing()
          Read whether or not the agent emails matching results on a scheduled basis.
 boolean isRetrained()
          Read whether or not the agent has been retrained.
 boolean isSharedCopy()
          Read whether or not the agent is a copy of another shared agent.
 boolean isShownInCommunity()
          Read whether or not the agent appears in the IDOL community.
 boolean isTrainedFromDoc()
          Read whether or not the agent's training contains documents.
 void removeAgentField(java.lang.String sFieldname)
          Deletes the agent field entry for the specified field, if it exists.
 void removeDatabase(java.lang.String sDatabasename)
          Remove a database from those which will be queried when performing an e.g.
 void removeTrainingDoc(Document doc)
          Remove a document to the agent's training.
 void setAgentField(java.lang.String sFieldname, java.lang.String sFieldValue)
          Set the value of an agent field.
 void setAgentFields(java.util.Map fieldMap)
          Replaces any existing agent fields with those provided.
 void setAgentID(java.lang.String sAID)
          Set the unique ID of an agent.
 void setAgentname(java.lang.String sAgentname)
          Set the name of an agent.
 void setAlerting(boolean bAlerting)
          Specify whether this agent sends documents that match its training on an alerting basis (as they are indexed into the IDOL server).
 void setDatabases(java.util.ArrayList databaseList)
          Specify which databases the agent will query when performing an e.g.
 void setEmailing(boolean bEmailing)
          Specify whether this agent sends documents that match its training on a scheluded basis.
 void setMaxAgeOfResults(int nDays)
          Specify the maximum age of results that will be retrieved by this agent.
 void setNumResults(int nNumResults)
          Specify the number of documents that as retrieved in the agent's result set.
 void setRetrained(boolean bRetrained)
          Specify whether the original training of this agent has been modified by retraining this agent on other documents.
 void setSharedCopy(boolean bShared)
          Specify whether this agent has been copied from another, shared, agent in the community.
 void setShownInCommunity(boolean bShown)
          Specify whether this agent belongs to and can be seen in the IDOL community.
 void setThreshold(int nThreshold)
          Specify the minimum relevence to the agent training that documents must have to be retrieved when generating agent results.
 void setTrainedFromDoc(boolean bTrainedFromDoc)
          Specify whether at least part of this agent's training is documental or not.
 void setTraining(java.lang.String sTrainingText)
          Set the textual training of the agent.
 void setTrainingDocs(java.util.ArrayList trainingDocsList)
          Set the document training of the agent.
 java.lang.String toString()
           
 
Methods inherited from class com.autonomy.aci.businessobjects.BaseAgent
getName, getOwnerID, getOwnername, setName, setOwnerID, setOwnername
 
Methods inherited from class com.autonomy.aci.businessobjects.AciBusinessObject
getUID, setUID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATIONDATE_FIELD_NAME

public static final java.lang.String CREATIONDATE_FIELD_NAME
See Also:
Constant Field Values

DEFAULT_THRESHOLD

public static final int DEFAULT_THRESHOLD
See Also:
Constant Field Values

DEFAULT_NUM_RESULTS

public static final int DEFAULT_NUM_RESULTS
See Also:
Constant Field Values
Constructor Detail

Agent

public Agent()
Construct an agent with no name, ID or information.


Agent

public Agent(java.lang.String sAID)
Construct an agent with a given ID but with no name or retrieval information.

Parameters:
sAID - the unique ID of the agent, usually as read from the NoreConstants.AGENT_ID_TAG ("autn:aid") entry of an AgentRead, UserReadAgentList, ... action.
Method Detail

setAgentID

public void setAgentID(java.lang.String sAID)
Set the unique ID of an agent.

Parameters:
sAID - the unique ID of the agent, usually as read from the NoreConstants.AGENT_ID_TAG ("autn:aid") entry of an AgentRead, UserReadAgentList, ... action.

setAgentname

public void setAgentname(java.lang.String sAgentname)
Set the name of an agent.

Parameters:
sAgentname - the name of the agent, usually as read from the NoreConstants.AGENT_NAME_TAG ("autn:agentname") entry of an AgentRead, UserReadAgentList, ... action.

setTraining

public void setTraining(java.lang.String sTrainingText)
Set the textual training of the agent.

Parameters:
sTrainingText - the textual training of the agent.

setAgentFields

public void setAgentFields(java.util.Map fieldMap)
Replaces any existing agent fields with those provided. Both the keys and the values assosciated in the Map must be Strings.

Parameters:
fieldMap - a Map assosciating String pairs representing the field names and values.

setAgentField

public void setAgentField(java.lang.String sFieldname,
                          java.lang.String sFieldValue)
Set the value of an agent field. If the specified field does not already exist, a new one is created. If the field is already set, it's value is overwritten with the new value.

Parameters:
sFieldname - the name of the user field to set.
sFieldValue - the value to give the field.

removeAgentField

public void removeAgentField(java.lang.String sFieldname)
Deletes the agent field entry for the specified field, if it exists.

Parameters:
sFieldname - the name of the field to delete.

clearAgentFields

public void clearAgentFields()
Deletes all existing agent fields and their values.


setTrainingDocs

public void setTrainingDocs(java.util.ArrayList trainingDocsList)
Set the document training of the agent. This replaces all the current training documents with the ones supplied. The documents specified must all be indexed the IDOL server for them to be valid agent training documents.

Parameters:
trainingDocsList - an ArrayList of Documents specifying which documents the agent should be trained on. The Documents must have at least a reference set on them.

addTrainingDoc

public void addTrainingDoc(Document doc)
Add a document to the agent's training. The document specified must be indexed the IDOL server for it to be a valid agent training document.

Parameters:
doc - the document which should be added to the agent's training. The Document must have at least a reference set on it.

removeTrainingDoc

public void removeTrainingDoc(Document doc)
Remove a document to the agent's training. The document specified must be indexed the IDOL server for it to be a valid agent training document.

Parameters:
doc - the document which should be removed from the agent's training. The Document must have at least a reference set on it.

clearTrainingDocs

public void clearTrainingDocs()
Remove all documents from the agent's training.


setDatabases

public void setDatabases(java.util.ArrayList databaseList)
Specify which databases the agent will query when performing an e.g. AgentGetResults action.

Parameters:
databaseList - an ArrayList of Strings giving the names of the databases that the agent can retrieve results from.

addDatabase

public void addDatabase(java.lang.String sDatabasename)
Add a database to those which will be queried when performing an e.g. AgentGetResults action.

Parameters:
sDatabasename - the name of the databases to add to those that the agent can retrieve results from.

removeDatabase

public void removeDatabase(java.lang.String sDatabasename)
Remove a database from those which will be queried when performing an e.g. AgentGetResults action.

Parameters:
sDatabasename - the name of the databases to remove from those that the agent can retrieve results from.

clearDatabases

public void clearDatabases()
Remove all database names from those which will be queried when performing an e.g. AgentGetResults action.


setMaxAgeOfResults

public void setMaxAgeOfResults(int nDays)
Specify the maximum age of results that will be retrieved by this agent. If 0 or < 0, the agent will not use any age restriction when retreiving results.

Parameters:
nDays - the maximum age of results in days.

setThreshold

public void setThreshold(int nThreshold)
Specify the minimum relevence to the agent training that documents must have to be retrieved when generating agent results.

Parameters:
nThreshold - the minimum document relevence to retrieve.

setNumResults

public void setNumResults(int nNumResults)
Specify the number of documents that as retrieved in the agent's result set.

Parameters:
nNumResults - the number of documents to retrieve.

setSharedCopy

public void setSharedCopy(boolean bShared)
Specify whether this agent has been copied from another, shared, agent in the community.

Parameters:
bShared - whether this agent is a copy.

setRetrained

public void setRetrained(boolean bRetrained)
Specify whether the original training of this agent has been modified by retraining this agent on other documents.

Parameters:
bRetrained - whether this agent has been retrained.

setTrainedFromDoc

public void setTrainedFromDoc(boolean bTrainedFromDoc)
Specify whether at least part of this agent's training is documental or not.

Parameters:
bTrainedFromDoc - whether this agent has been trained with documents or not.

setShownInCommunity

public void setShownInCommunity(boolean bShown)
Specify whether this agent belongs to and can be seen in the IDOL community.

Parameters:
bShown - whether this agent belongs to the community.

setEmailing

public void setEmailing(boolean bEmailing)
Specify whether this agent sends documents that match its training on a scheluded basis.

Parameters:
bEmailing - whether this agent emails results.

setAlerting

public void setAlerting(boolean bAlerting)
Specify whether this agent sends documents that match its training on an alerting basis (as they are indexed into the IDOL server).

Parameters:
bAlerting - whether this agent alerts for results.

getAgentname

public java.lang.String getAgentname()
Read the name of the agent.

Returns:
the agent's name.

getAgentID

public java.lang.String getAgentID()
Read the unique ID of the agent. This can be used to identify the agent with the "aid" parameter.

Returns:
the agent's unique ID.

getTraining

public java.lang.String getTraining()
Read the textual training for this agent.

Returns:
the agent's textual training.

getAgentFields

public java.util.HashMap getAgentFields()
Read all the fields that have been set on this agent.

Returns:
a HashMap of all the field names and values. The field names act as the keys for the hashmap entries.

getAgentFieldNames

public java.util.Set getAgentFieldNames()
Read the names of all the fields that have been set on this agent.

Returns:
a Set over all the field names (stored as Strings).

getAgentFieldValue

public java.lang.String getAgentFieldValue(java.lang.String sFieldname,
                                           java.lang.String sDefaultValue)
Read the value of an agent field.

Parameters:
sFieldname - the name of the agent field
sDefaultValue - the value to return of no field with this name is found or if it does not have a value. Can be null.
Returns:
the value of the specified field or the default provided if no value is found.

getAgentFieldValue

public java.lang.String getAgentFieldValue(java.lang.String sFieldname)
Read the value of an agent field.

Parameters:
sFieldname - the name of the agent field
Returns:
the value of the specified field or the default provided if no value is found. null is the field does not exist or does not have a value.

getTrainingDocs

public java.util.ArrayList getTrainingDocs()
Obtains the list of documents that this agent is trained on.

Returns:
an ArrayList of Documents representing the training documents.

getDatabases

public java.util.ArrayList getDatabases()
Obtains the list of databases that this agent is set to retrieve documents from.

Returns:
an ArrayList of Strings giving the database names.

getMaxAgeOfResults

public int getMaxAgeOfResults()
Read the maximum age documents can have to be retrieved as part of this agent's result set.

Returns:
the maximum age of results.

getThreshold

public int getThreshold()
Read the minimum relevence to the agent's training that documents must have to be retrieved as part of this agent's result set.

Returns:
the minimum relevence for results.

getNumResults

public int getNumResults()
Read the maximum number of results that will be returned within a agent's result set.

Returns:
the maximum number of results.

isSharedCopy

public boolean isSharedCopy()
Read whether or not the agent is a copy of another shared agent.

Returns:
whether or not the agent is a copy of another shared agent.

isRetrained

public boolean isRetrained()
Read whether or not the agent has been retrained.

Returns:
whether or not the agent has been retrained.

isTrainedFromDoc

public boolean isTrainedFromDoc()
Read whether or not the agent's training contains documents.

Returns:
whether or not the agent's training contains documents.

isShownInCommunity

public boolean isShownInCommunity()
Read whether or not the agent appears in the IDOL community.

Returns:
whether or not the agent appears in the IDOL community.

isEmailing

public boolean isEmailing()
Read whether or not the agent emails matching results on a scheduled basis.

Returns:
whether or not the agent emails matching results on a scheduled basis.

isAlerting

public boolean isAlerting()
Read whether or not the agent emails matching results on an alerting basis.

Returns:
whether or not the agent emails matching results on an alerting basis.

toString

public java.lang.String toString()