All Packages Class Hierarchy This Package Previous Next Index
Interface edu.cmu.paid.network.INetwork_Api
- public interface INetwork_Api
This is the external API interface for the network subsystem.
- Author:
- Barrett Trask and Anthony Watkins
-
addObjectToAgent(IMulticastAgent, Object)
- Add an object to receive messages from the MulticastAgent.
-
clientStartup()
- Method for setting up machine as a client only.
-
connectAgents(IMulticastAgent, IMulticastAgent)
- Connect two MulticastAgents to send and receive messages with one another.
-
disconnectAgents(IMulticastAgent, IMulticastAgent)
- Disconnect two MulticastAgents from one another.
-
disconnectMachine()
- Method to stop machine from sending and receiving data.
-
getNewMulticastAgent()
- Creates a new, disconnected MulticastAgent.
-
getNewMulticastAgent(MulticastAgent[])
- Create a new, connected MulticastAgent.
-
getNewRemoteMulticastAgent(String)
- Create a new, remote MulticastAgent.
-
getNumObjects()
- Get number of objects being returned by current request.
-
getPercent()
- Get current percentage of transfer that's completed.
-
killDownload()
- Method for stopping an in-progress download.
-
multicastMessage(IMulticastAgent, String, Object[], String)
- Send a multicasted message to all objects or interfaces in a network
of connect MulticastAgents.
-
publishEvent(IMulticastAgent, EventObject, Topic)
- Publish an event to all objects contained within a set of connected
MulticastAgents.
-
remoteQuery(DataObject, String[])
- Method for requesting remote data from the database servers.
-
removeObjectFromAgent(IMulticastAgent, Object)
- Remove an object from a MulticastAgent.
-
serverStartup(String)
- Method for setting up machine as a server.
-
waitForDone()
- Waits until current download is complete.
-
waitForNum(int)
- Block until specified number of objects have been received
-
waitForPct(int)
- Block until specified percentage of transfer is comlete.
clientStartup
public abstract void clientStartup() throws VoyagerStartupPaidNetworkException
- Method for setting up machine as a client only.
- Throws: VoyagerStartupPaidNetworkException
- Throws exception if Voyager fails to startup.
serverStartup
public abstract void serverStartup(String url) throws VoyagerStartupPaidNetworkException
- Method for setting up machine as a server.
- Parameters:
- url - The specified URL for this machine.
- Throws: VoyagerStartupPaidNetworkException
- Throws exception if Voyager fails to startup.
disconnectMachine
public abstract void disconnectMachine()
- Method to stop machine from sending and receiving data.
remoteQuery
public abstract Vector remoteQuery(DataObject request,
String serverList[])
- Method for requesting remote data from the database servers.
- Parameters:
- request - DataObject containing request.
- serverList - An array (or list) of URL's of the servers that contain
the needed data.
- Returns:
- A vector of DataObjects satisfying request.
waitForDone
public abstract void waitForDone()
- Waits until current download is complete.
getNumObjects
public abstract int getNumObjects()
- Get number of objects being returned by current request.
- Returns:
- Number of objects being returned by current request; 0 if no request is being made.
getPercent
public abstract int getPercent()
- Get current percentage of transfer that's completed.
- Returns:
- Percent of transfer complete.
waitForPct
public abstract void waitForPct(int pct)
- Block until specified percentage of transfer is comlete.
waitForNum
public abstract void waitForNum(int num)
- Block until specified number of objects have been received
killDownload
public abstract void killDownload()
- Method for stopping an in-progress download.
getNewMulticastAgent
public abstract MulticastAgent getNewMulticastAgent()
- Creates a new, disconnected MulticastAgent.
- Returns:
- A reference to an uninitialized MulticastAgent.
getNewMulticastAgent
public abstract MulticastAgent getNewMulticastAgent(MulticastAgent neighborList[])
- Create a new, connected MulticastAgent.
- Parameters:
- neighborList - An array of MulticastAgents to be connected as
neighbors to this new agent.
- Returns:
- A reference to an initialized MulticastAgent.
getNewRemoteMulticastAgent
public abstract IMulticastAgent getNewRemoteMulticastAgent(String url) throws Exception
- Create a new, remote MulticastAgent.
- Parameters:
- url - The URL of the machine on which to create the object.
- Returns:
- A proxy to the newly create MulticastAgent.
- Throws: Exception
- Throws exception if there's a problem.
connectAgents
public abstract void connectAgents(IMulticastAgent agent1,
IMulticastAgent agent2) throws Exception
- Connect two MulticastAgents to send and receive messages with one another.
The connection is completely reciprocal.
- Parameters:
- agent1 - The first agent to connect.
- agent2 - The other agent to connect.
- Throws: AgentsAlreadyConnectedRuntimeException
- Thrown if the
two agents are already connected.
- Throws: Exception
- Used for errors when trying to connect agents.
disconnectAgents
public abstract void disconnectAgents(IMulticastAgent agent1,
IMulticastAgent agent2)
- Disconnect two MulticastAgents from one another. Only breaks the single
connection between them.
- Parameters:
- agent1 - The first agent.
- agent2 - The other agent.
- Throws: AgentsNotConnectedRuntimeException
- Thrown if the
two agents not connected.
addObjectToAgent
public abstract void addObjectToAgent(IMulticastAgent agent,
Object object)
- Add an object to receive messages from the MulticastAgent. In order to
receive events it must implement
com.objectspace.voyager.space.publishing.PublishedEventListener.
Multicasted messages can be received by any relevant object.
- Parameters:
- agent - The MulticastAgent to which to add the object.
- object - The object to be added to the agent.
- Throws: ObjectAlreadyInAgentRuntimeException
- The object has already
been added to this agent.
removeObjectFromAgent
public abstract void removeObjectFromAgent(IMulticastAgent agent,
Object object)
- Remove an object from a MulticastAgent.
- Parameters:
- agent - The MulticastAgent to which to remove the object.
- object - The object to be removed from the agent.
- Throws: ObjectNotInAgentRuntimeException
- The object has not
been added to this agent.
multicastMessage
public abstract void multicastMessage(IMulticastAgent initialAgent,
String methodSig,
Object args[],
String className)
- Send a multicasted message to all objects or interfaces in a network
of connect MulticastAgents. More general application of publishEvent.
- Parameters:
- initialAgent - This is the first agent to receive the message. The
agent will then propagate the message to all of its neighbors.
- methodSig - The name of the method to invoke if uniquely named.
Otherwise has the full signature "methodName(type1,type2,...)".
- args - The arguments to pass to the method.
- className - The class or interface on which to invoke the method.
publishEvent
public abstract void publishEvent(IMulticastAgent initialAgent,
EventObject event,
Topic topic)
- Publish an event to all objects contained within a set of connected
MulticastAgents. To receive the event, each object must implement
com.objectspace.voyager.space.publishing.PublishedEventListener.
- Parameters:
- initialAgent - This is the first agent to receive the event. The
agent will then propagate the event to each of its neighbors.
- event - The event being published.
- topic - A topic for the event that the listeners can use to screen
events for relevance. Topics are hierarchical and fields are separated by
'.'. Wildcards can be used: '*' matches current field; '<' matches all
remaining fields.
All Packages Class Hierarchy This Package Previous Next Index