|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.operations.portal.PortalConnection
public class PortalConnection
PortalConnection provides the interface and maintains state for one connection to a SIAM node from which data is retrieved (aka "target" node").
When Portal determines that the communications link to the target node is available, it calls attempts to "wake up" the node (which may be sleeping), and invokes PortalConnection.nodeLinkConnected() to retrieve data from the node's sensors. The retrieved packets are then distributed to shore clients, as well as saved in a file buffer. PortalConnection keeps track of which packets it has retrieved from each sensor; on subsequent retrievals it requests the "latest" data from the sensor.
PortalConnection stores client requests ("commands") until a communication link to the node is available, at which time PortalConnection sequentially forwards the requests to the node. Thus PortalConnection manages network traffic over the low-bandwidth link.
While interacting with a node on the MOOS network, the shore need only maintain a lease on the node from which data is being retrieved; the target node will ensure that any intermediate nodes/comms links are kept awake.
| Constructor Summary | |
|---|---|
PortalConnection(java.net.InetAddress remoteAddr,
java.net.InetAddress primaryAddr,
Portal portal)
Construct PortalConnection for node at specified address. |
|
| Method Summary | |
|---|---|
protected boolean |
connectNode()
Obtain the node proxy object and get a lease. |
boolean |
equals(java.lang.Object o)
Returns true if object is PortalConnection to same InetAddress or if object is InetAddress which equals our _targetNodeAddr |
java.net.InetAddress |
getInetAddress()
Return InetAddress of our remote connection |
Port[] |
getPortConfiguration()
Return descriptions of devices on node. |
PortalSession |
getSession()
get session tracker |
long |
getTargetDeviceID()
|
long |
getTargetNodeID()
|
int |
hashCode()
Return hashCode of the connection's InetAddress |
boolean |
nodeConnected()
Returns true if portal link is active and portal has valid RMI stub to remote node |
void |
nodeLinkConnected()
Called by portal when "link up" message received from node. |
void |
nodeLinkDisconnecting(long nextConnectTime)
Called by node when communication link is going down. |
void |
nodeLinkNotify(boolean on)
Notify PortalConnection that network link has come up/down |
protected DevicePacketSet |
retrieveData(long deviceID,
long startTime,
long endTime)
Retrieve data from specified device, within specified time-window. |
void |
setSession(PortalSession session)
set session tracker |
void |
startSession()
Get node server proxy, retrieve configuration, packets, etc. |
void |
terminateLease()
Terminate lease on the target node |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PortalConnection(java.net.InetAddress remoteAddr,
java.net.InetAddress primaryAddr,
Portal portal)
remoteAddr - Address of target nodeprimaryAddr - portal - Portal which contains this connection| Method Detail |
|---|
public java.net.InetAddress getInetAddress()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean nodeConnected()
public Port[] getPortConfiguration()
throws UnknownConfiguration
UnknownConfigurationpublic void setSession(PortalSession session)
public PortalSession getSession()
public void startSession()
throws java.lang.Exception
java.lang.Exceptionpublic void nodeLinkDisconnecting(long nextConnectTime)
public void nodeLinkConnected()
public void nodeLinkNotify(boolean on)
protected boolean connectNode()
protected DevicePacketSet retrieveData(long deviceID,
long startTime,
long endTime)
throws java.rmi.RemoteException,
DeviceNotFound,
NoDataException,
java.io.IOException,
TimeoutException
java.rmi.RemoteException
DeviceNotFound
NoDataException
java.io.IOException
TimeoutException
public void terminateLease()
throws LeaseRefused,
java.rmi.RemoteException
LeaseRefused
java.rmi.RemoteExceptionpublic long getTargetNodeID()
public long getTargetDeviceID()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||