agentland.info.news.newsWall
Class NewsModelAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.resource.ManagedAgent
|
+--agentland.info.news.newsWall.NewsModelAgent
- All Implemented Interfaces:
- Agent, Good, Managed, MetagluePrimitives, NewsModel, Observer, Remote, Serializable, Spy
- public class NewsModelAgent
- extends ManagedAgent
- implements NewsModel, Observer
- See Also:
- Serialized Form
Methods inherited from class agentland.resource.ManagedAgent |
connect, getAlert, getNeed, isAvailable, isAvailable, reliesOn, reliesOn, replace, replace, request, request, request, requestAgent, requestAgent, resources, resourcesByAgentID, setNeed, tiedTo, yank, yank, yank |
Methods inherited from class agentland.util.GoodAgent |
addSpy, addSpy, alert, alertString, beep, error, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName, tell |
Methods inherited from class metaglue.AgentAgent |
addMonitor, alive, buildEHAFor, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getOldLogs, getProperties, getProxyHandlerClass, getSociety, installAPH, log, log, lookupClass, reliesOn, reliesOnSynch, removeAPHFromCatalog, removeFrozen, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, toString, whereAreYou |
Methods inherited from interface agentland.util.Spy |
tell |
storiesByCategory
protected TranslatorEngine storiesByCategory
storiesBySource
protected TranslatorEngine storiesBySource
stories
protected Vector stories
SERVER_URL
public static String SERVER_URL
- Identifies hardwired address of server's web files for client.
model
protected news.models.NewsStoryModel model
NewsModelAgent
public NewsModelAgent()
throws RemoteException
getCurrentStories
public Vector getCurrentStories()
throws RemoteException
- Specified by:
getCurrentStories
in interface NewsModel
getSources
public Collection getSources()
throws RemoteException
- Specified by:
getSources
in interface NewsModel
getCategories
public Collection getCategories()
throws RemoteException
- Specified by:
getCategories
in interface NewsModel
getServerURL
public String getServerURL()
throws RemoteException
- Returns the URL of the server that the stories are being fetched
from -- this should eventually be embedded in Story object, I
think.
- Specified by:
getServerURL
in interface NewsModel
initNews
protected void initNews()
update
public void update(Observable observable,
Object arg)
- This method receives updates from the data structure
representing the incoming news stories. It should send out
notifications to all UIs to let them know they should update
their view.
- Specified by:
update
in interface Observer
retrieveNews
public void retrieveNews()
- Retrieves all stories from the server and updates the local
collection of stories. It then sorts stories in chronological
order.
addNewStory
protected void addNewStory(news.models.Story story)
updateStoriesFromServerSource
public void updateStoriesFromServerSource()
- Triggers the update process. If new stories have arrived, the
update method will be called automatically.
updateStoriesUI
protected void updateStoriesUI()
- Sends out a notification to all interested parties letting them
know that new news items have become available.