infofilter
Class URLReaderAgent

java.lang.Object
  |
  +--ciagent.CIAgent
        |
        +--infofilter.URLReaderAgent

public class URLReaderAgent
extends CIAgent

The URLReaderAgent class implements an agent that reads web pages and optionally pass parameters to the page.

See Also:
Serialized Form

Field Summary
(package private)  java.lang.String contents
           
(package private)  java.lang.String paramString
           
(package private)  java.net.URL url
           
 
Fields inherited from class ciagent.CIAgent
agentPlatform, children, DEFAULT_ASYNCTIME, DEFAULT_SLEEPTIME, name, parent, traceLevel
 
Constructor Summary
URLReaderAgent()
          Creates a URLReaderAgent object.
URLReaderAgent(java.lang.String name)
          Creates a URLReaderAgent object with the given name.
 
Method Summary
 java.lang.String getContents()
          Retrieves the contents of the web page.
 java.lang.String getParamString()
          Retrieves the web page parameter string.
 java.lang.String getTaskDescription()
          Retrieves the task description for this agent.
 java.net.URL getURL()
          Retrieves the URL of the web page.
protected  java.lang.String getURLText()
          Reads a single URl and optionally passes a paramString to it (if it is a CGI bin).
 void initialize()
          Initializes the agent by setting the sleep time to 5 seconds.
 void process()
          Does nothing.
 void processCIAgentEvent(CIAgentEvent event)
          Processes a CIAgentEvent (trace or getURLText).
 void processTimerPop()
          Does nothing.
protected  void sendArticleToListeners(NewsArticle article)
          Sends the URL text to anyone listening for it.
 void setParamString(java.lang.String paramString)
          Sets the parameter string to be sent to the web page .
 void setURL(java.net.URL url)
          Sets the URL of the web page.
 
Methods inherited from class ciagent.CIAgent
addAgent, addCIAgentEventListener, addPropertyChangeListener, getAgent, getAgentPlatform, getAgents, getAsyncTime, getChildren, getCustomizerClass, getDisplayName, getName, getParent, getSleepTime, getState, getTraceLevel, notifyCIAgentEventListeners, postCIAgentEvent, processAsynchronousEvents, removeAgent, removeCIAgentEventListener, removePropertyChangeListener, reset, resumeAgentProcessing, setAgentPlatform, setAsyncTime, setName, setParent, setSleepTime, setState, setTraceLevel, startAgentProcessing, stopAgentProcessing, suspendAgentProcessing, trace
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

java.net.URL url

paramString

java.lang.String paramString

contents

java.lang.String contents
Constructor Detail

URLReaderAgent

public URLReaderAgent()
Creates a URLReaderAgent object.

URLReaderAgent

public URLReaderAgent(java.lang.String name)
Creates a URLReaderAgent object with the given name.
Parameters:
name - the String object that contains the name of the agent
Method Detail

setURL

public void setURL(java.net.URL url)
Sets the URL of the web page.
Parameters:
url - the URL object for the web page

getURL

public java.net.URL getURL()
Retrieves the URL of the web page.
Returns:
the URL object for the web page

setParamString

public void setParamString(java.lang.String paramString)
Sets the parameter string to be sent to the web page .
Parameters:
paramString - the String object that contains the parameters

getParamString

public java.lang.String getParamString()
Retrieves the web page parameter string.
Returns:
the String object that contains the parameters

getContents

public java.lang.String getContents()
Retrieves the contents of the web page.
Returns:
the String object that contains the web page contents

getTaskDescription

public java.lang.String getTaskDescription()
Retrieves the task description for this agent.
Returns:
the String object that contains the task description
Overrides:
getTaskDescription in class CIAgent

initialize

public void initialize()
Initializes the agent by setting the sleep time to 5 seconds.
Overrides:
initialize in class CIAgent

process

public void process()
Does nothing.
Overrides:
process in class CIAgent

processTimerPop

public void processTimerPop()
Does nothing.
Overrides:
processTimerPop in class CIAgent

processCIAgentEvent

public void processCIAgentEvent(CIAgentEvent event)
Processes a CIAgentEvent (trace or getURLText).
Parameters:
event - the CIAgentEvent object to be processed
Overrides:
processCIAgentEvent in class CIAgent

sendArticleToListeners

protected void sendArticleToListeners(NewsArticle article)
Sends the URL text to anyone listening for it.
Parameters:
article - the NewArticle object that contains the URL text

getURLText

protected java.lang.String getURLText()
Reads a single URl and optionally passes a paramString to it (if it is a CGI bin).
Returns:
the String object that contains the web page content