mam.agent
Class UrlKnowledgeAgent

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--mam.agent.Agent
              |
              +--mam.agent.UrlKnowledgeAgent

public class UrlKnowledgeAgent
extends Agent

Description of the Class

Author:
nideffer
created October 4, 2001

Field Summary
 protected final static StringAGENT_ATTRIBUTE_KNOWLEDGE_METADATA_REFRESH_PROBABILITY
           
 protected final static StringAGENT_ATTRIBUTE_TIMES_QUERIED
           
 protected final static StringAGENT_ATTRIBUTE_TIMES_QUERIED_SUCCESSFULLY
           
 protected final static StringAGENT_KNOWLEDGE_METADATA_TAG_NAME
           
 final static doubleDEFAULT_STARTING_FUNDS
           
 final static RoutingTagKNOWLEDGE_AGENT_ROUTING_TAG
           
 protected final static StringKNOWLEDGE_URL_TAG_NAME
           
 protected Datem_attrKnowledgeLastChanged
           
 protected Stringm_attrKnowledgeMetadata
           
 protected URLm_attrKnowledgeUrl
           
 protected Stringm_temporaryKnowledgeMetadata
           
 protected final static intMAX_LINES_EXAMINED
           
 protected final static StringORIGIN_TAG_NAME
           

Fields inherited from class mam.agent.Agent
AGENT_ACCESS_STATISTICS_TAG_NAME, AGENT_PROPERTIES_TAG_NAME, AGENT_TRAITS_TAG_NAME, ALL_AGENTS_ROUTING_TAG, DEFAULT_TAG_NAME, m_accessStatisticsGroup, m_agentProperties, m_facility, m_incomingMessageQueue, m_shutdown, m_sleepManager, ROLE_TAG_NAME

Fields inherited from class java.lang.Thread
MIN_PRIORITY, NORM_PRIORITY, MAX_PRIORITY

Constructor Summary
UrlKnowledgeAgent()
          Constructor for the UrlKnowledgeAgent object
UrlKnowledgeAgent(URL knowledgeUrl, String knowledgeMetadata)
          Constructor for the UrlKnowledgeAgent object
UrlKnowledgeAgent(String knowledgeUrl, String knowledgeMetadata)
          Constructor for the UrlKnowledgeAgent object
UrlKnowledgeAgent(Facility facility, AgentProperties defaultAgentProperties)
          Constructor for the UrlKnowledgeAgent object

Method Summary
 protected intdoQuery(String queryPhrase, String filter)
          Description of the Method
 synchronized voidenqueueMessage(AgentMessage incomingMessage)
          Description of the Method
 StringgetKnowledgeMetadata()
          Gets the KnowledgeMetadata attribute of the UrlKnowledgeAgent object
 URLgetKnowledgeUrl()
          Gets the KnowledgeUrl attribute of the UrlKnowledgeAgent object
 StringgetOrigin()
          Gets the Origin attribute of the UrlKnowledgeAgent object
 protected StringgetTemporaryKnowledgeMetadata()
          Gets the TemporaryKnowledgeMetadata attribute of the UrlKnowledgeAgent object
 voidhandleDoDestroyAgentMessage(AgentMessage m)
          Description of the Method
 voidhandleDoQueryKnowledgeMessage(AgentMessage m)
          doQueryKnowledge Message For now, assume that we only handle ASCII text.
 voidhandleGetKnowledgeMessage(AgentMessage m)
          Description of the Method
 protected voidregisterRoutingTags()
          Description of the Method
 protected voidrewriteLocalUrls()
          Description of the Method
 voidsetKnowledgeMetadata(String knowledgeMetadata)
          Sets the KnowledgeMetadata attribute of the UrlKnowledgeAgent object
 voidsetKnowledgeUrl(String knowledgeUrlString)
          Sets the KnowledgeUrl attribute of the UrlKnowledgeAgent object
 voidsetKnowledgeUrl(URL knowledgeUrl)
          Sets the KnowledgeUrl attribute of the UrlKnowledgeAgent object
 voidsetOrigin(String origin)
          Sets the Origin attribute of the UrlKnowledgeAgent object
 protected voidsetTemporaryKnowledgeMetadata(String temporaryKnowledgeMetadata)
          Sets the TemporaryKnowledgeMetadata attribute of the UrlKnowledgeAgent object
 StringtoString()
          Description of the Method
 ElementtoXmlElement(String tagName)
          Description of the Method
 protected voidunregisterRoutingTags()
          Description of the Method
 protected voidupdateTemporaryKnowledgeMetadata()
          Description of the Method

Methods inherited from class mam.agent.Agent
fromXmlElement, getAccessStatisticsGroup, getAccount, getAgentProperties, getAgentTraits, getDescription, getFacility, getMamId, getNickname, getQuote, getRole, getRoutingTagToSelf, getXmlSerializable, handleDoAgentShutdownMessage, handleGetAccessStatisticsMessage, handleGetAgentPropertiesMessage, handleGetAgentTraitsMessage, handleGetQuoteMessage, handleMessages, handleSetDescriptionMessage, handleSetNicknameMessage, idleActivity, invokeMessageHandler, requiresPersistence, run, setAccount, setAgentTraits, setDescription, setFacility, setMamId, setNickname, setRole, setXmlSerializable, toXmlElement

Methods inherited from class java.lang.Thread
currentThread, yield, sleep, sleep, start, stop, stop, interrupt, interrupted, isInterrupted, destroy, isAlive, suspend, resume, setPriority, getPriority, setName, getName, getThreadGroup, activeCount, enumerate, countStackFrames, join, join, join, dumpStack, setDaemon, isDaemon, checkAccess, getContextClassLoader, setContextClassLoader

Methods inherited from class java.lang.Object
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize

Field Detail

AGENT_ATTRIBUTE_KNOWLEDGE_METADATA_REFRESH_PROBABILITY

protected final static String AGENT_ATTRIBUTE_KNOWLEDGE_METADATA_REFRESH_PROBABILITY

AGENT_ATTRIBUTE_TIMES_QUERIED

protected final static String AGENT_ATTRIBUTE_TIMES_QUERIED

AGENT_ATTRIBUTE_TIMES_QUERIED_SUCCESSFULLY

protected final static String AGENT_ATTRIBUTE_TIMES_QUERIED_SUCCESSFULLY

AGENT_KNOWLEDGE_METADATA_TAG_NAME

protected final static String AGENT_KNOWLEDGE_METADATA_TAG_NAME

DEFAULT_STARTING_FUNDS

public final static double DEFAULT_STARTING_FUNDS

KNOWLEDGE_AGENT_ROUTING_TAG

public final static RoutingTag KNOWLEDGE_AGENT_ROUTING_TAG

KNOWLEDGE_URL_TAG_NAME

protected final static String KNOWLEDGE_URL_TAG_NAME

m_attrKnowledgeLastChanged

protected Date m_attrKnowledgeLastChanged

m_attrKnowledgeMetadata

protected String m_attrKnowledgeMetadata

m_attrKnowledgeUrl

protected URL m_attrKnowledgeUrl

m_temporaryKnowledgeMetadata

protected String m_temporaryKnowledgeMetadata

MAX_LINES_EXAMINED

protected final static int MAX_LINES_EXAMINED

ORIGIN_TAG_NAME

protected final static String ORIGIN_TAG_NAME
Constructor Detail

UrlKnowledgeAgent

public UrlKnowledgeAgent()
Constructor for the UrlKnowledgeAgent object
Since:

UrlKnowledgeAgent

public UrlKnowledgeAgent(URL knowledgeUrl, String knowledgeMetadata)
Constructor for the UrlKnowledgeAgent object
Parameters:
knowledgeUrl - Description of Parameter
Since:

UrlKnowledgeAgent

public UrlKnowledgeAgent(String knowledgeUrl, String knowledgeMetadata)
Constructor for the UrlKnowledgeAgent object
Parameters:
knowledgeUrl - Description of Parameter
Since:

UrlKnowledgeAgent

public UrlKnowledgeAgent(Facility facility, AgentProperties defaultAgentProperties)
Constructor for the UrlKnowledgeAgent object
Parameters:
facility - Description of Parameter
defaultAgentProperties - Description of Parameter
Since:
Method Detail

doQuery

protected int doQuery(String queryPhrase, String filter)
Description of the Method
Parameters:
queryPhrase - Description of Parameter
filter - Description of Parameter
Returns: Description of the Returned Value
Since:

enqueueMessage

public synchronized void enqueueMessage(AgentMessage incomingMessage)
Description of the Method
Parameters:
incomingMessage - Description of Parameter
Since:

getKnowledgeMetadata

public String getKnowledgeMetadata()
Gets the KnowledgeMetadata attribute of the UrlKnowledgeAgent object
Returns: The KnowledgeMetadata value
Since:

getKnowledgeUrl

public URL getKnowledgeUrl()
Gets the KnowledgeUrl attribute of the UrlKnowledgeAgent object
Returns: The KnowledgeUrl value
Since:

getOrigin

public String getOrigin()
Gets the Origin attribute of the UrlKnowledgeAgent object
Returns: The Origin value
Since:

getTemporaryKnowledgeMetadata

protected String getTemporaryKnowledgeMetadata()
Gets the TemporaryKnowledgeMetadata attribute of the UrlKnowledgeAgent object
Returns: The TemporaryKnowledgeMetadata value
Since:

handleDoDestroyAgentMessage

public void handleDoDestroyAgentMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleDoQueryKnowledgeMessage

public void handleDoQueryKnowledgeMessage(AgentMessage m)
doQueryKnowledge Message For now, assume that we only handle ASCII text. Parameters: Required: QueryPhrase: Response Message: eventQueryKnowledgeResponse Parameters: Required: QueryPhrase: Relevance:, in the range 0-100 inclusive
Parameters:
m - Description of Parameter
Since:

handleGetKnowledgeMessage

public void handleGetKnowledgeMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

registerRoutingTags

protected void registerRoutingTags()
Description of the Method
Since:

rewriteLocalUrls

protected void rewriteLocalUrls()
Description of the Method
Since:

setKnowledgeMetadata

public void setKnowledgeMetadata(String knowledgeMetadata)
Sets the KnowledgeMetadata attribute of the UrlKnowledgeAgent object
Parameters:
knowledgeMetadata - The new KnowledgeMetadata value
Since:

setKnowledgeUrl

public void setKnowledgeUrl(String knowledgeUrlString)
Sets the KnowledgeUrl attribute of the UrlKnowledgeAgent object
Parameters:
knowledgeUrlString - The new KnowledgeUrl value
Since:

setKnowledgeUrl

public void setKnowledgeUrl(URL knowledgeUrl)
Sets the KnowledgeUrl attribute of the UrlKnowledgeAgent object
Parameters:
knowledgeUrl - The new KnowledgeUrl value
Since:

setOrigin

public void setOrigin(String origin)
Sets the Origin attribute of the UrlKnowledgeAgent object
Parameters:
origin - The new Origin value
Since:

setTemporaryKnowledgeMetadata

protected void setTemporaryKnowledgeMetadata(String temporaryKnowledgeMetadata)
Sets the TemporaryKnowledgeMetadata attribute of the UrlKnowledgeAgent object
Parameters:
temporaryMetadata - The new TemporaryKnowledgeMetadata value
Since:

toString

public String toString()
Description of the Method
Returns: Description of the Returned Value
Since:

toXmlElement

public Element toXmlElement(String tagName)
Description of the Method
Parameters:
tagName - Description of Parameter
Returns: Description of the Returned Value
Since:

unregisterRoutingTags

protected void unregisterRoutingTags()
Description of the Method
Since:

updateTemporaryKnowledgeMetadata

protected void updateTemporaryKnowledgeMetadata()
Description of the Method
Since: