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

Method Index

 o addObjectToAgent(IMulticastAgent, Object)
Add an object to receive messages from the MulticastAgent.
 o clientStartup()
Method for setting up machine as a client only.
 o connectAgents(IMulticastAgent, IMulticastAgent)
Connect two MulticastAgents to send and receive messages with one another.
 o disconnectAgents(IMulticastAgent, IMulticastAgent)
Disconnect two MulticastAgents from one another.
 o disconnectMachine()
Method to stop machine from sending and receiving data.
 o getNewMulticastAgent()
Creates a new, disconnected MulticastAgent.
 o getNewMulticastAgent(MulticastAgent[])
Create a new, connected MulticastAgent.
 o getNewRemoteMulticastAgent(String)
Create a new, remote MulticastAgent.
 o getNumObjects()
Get number of objects being returned by current request.
 o getPercent()
Get current percentage of transfer that's completed.
 o killDownload()
Method for stopping an in-progress download.
 o multicastMessage(IMulticastAgent, String, Object[], String)
Send a multicasted message to all objects or interfaces in a network of connect MulticastAgents.
 o publishEvent(IMulticastAgent, EventObject, Topic)
Publish an event to all objects contained within a set of connected MulticastAgents.
 o remoteQuery(DataObject, String[])
Method for requesting remote data from the database servers.
 o removeObjectFromAgent(IMulticastAgent, Object)
Remove an object from a MulticastAgent.
 o serverStartup(String)
Method for setting up machine as a server.
 o waitForDone()
Waits until current download is complete.
 o waitForNum(int)
Block until specified number of objects have been received
 o waitForPct(int)
Block until specified percentage of transfer is comlete.

Methods

 o 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.
 o 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.
 o disconnectMachine
 public abstract void disconnectMachine()
Method to stop machine from sending and receiving data.

 o 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.
 o waitForDone
 public abstract void waitForDone()
Waits until current download is complete.

 o 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.
 o getPercent
 public abstract int getPercent()
Get current percentage of transfer that's completed.

Returns:
Percent of transfer complete.
 o waitForPct
 public abstract void waitForPct(int pct)
Block until specified percentage of transfer is comlete.

 o waitForNum
 public abstract void waitForNum(int num)
Block until specified number of objects have been received

 o killDownload
 public abstract void killDownload()
Method for stopping an in-progress download.

 o getNewMulticastAgent
 public abstract MulticastAgent getNewMulticastAgent()
Creates a new, disconnected MulticastAgent.

Returns:
A reference to an uninitialized MulticastAgent.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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