|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.mbari.siam.tests.moos.devices.TestNodeService
public class TestNodeService
TestNodeService implements the Node interface; instantiate, initialize, and run a device service. The service bytecode, any related classes, and properties file are contained within a standard SIAM instrument jar file or PUCK.
| Field Summary | |
|---|---|
static java.lang.String |
INSTRUMENT_URL
|
| Fields inherited from class java.rmi.server.RemoteObject |
|---|
ref |
| Fields inherited from interface org.mbari.siam.distributed.Node |
|---|
SERVER_NAME |
| Constructor Summary | |
|---|---|
TestNodeService()
|
|
| Method Summary | |
|---|---|
void |
addEventCallback(NodeEventCallback callback)
Register to receive notification of node events. |
byte[] |
addSchedule(byte[] port,
byte[] scheduleName,
byte[] schedule,
boolean overwrite)
Add Schedule |
void |
annotate(byte[] annotation)
Append annotation to node data stream. |
void |
cpuLease(int requestorID,
long when,
long howLong)
Request that the CPU come on at a certain time in the future and/or remain on for a certain duration. |
void |
enterSafeMode()
Put node and its devices into "safe" mode. |
void |
enterSafeMode(long wait)
Put node and its devices into "safe" mode. |
int |
establishLease(long leaseMillisec,
byte[] clientNote)
Request a lease of the Node's primary comms medium |
int |
establishLease(long leaseMillisec,
byte[] clientNote,
boolean usePrimary)
Request a lease of the Node's primary or auxillary comms medium |
void |
exitApplication()
Shutdown all services and exits the SIAM application. |
void |
exitApplication(boolean doSafemode,
boolean doHalt,
boolean enableBackups,
boolean doNotify,
boolean recursive,
int quitDelaySec,
int haltDelaySec,
java.lang.String msg)
Shutdown all services and exits the SIAM application. |
Device |
getDevice(byte[] commPortName)
Get device service (if any) associated with specified port. |
Device |
getDevice(long deviceId)
Get specified device service proxy. |
DevicePacketSet |
getDevicePackets(long sensorID,
long startTime,
long endTime)
Get DevicePacket objects, from specified sensor, within specified time window. |
DevicePacketSet |
getDevicePackets(long sensorID,
long startTime,
long endTime,
int typeMask)
Get DevicePacket objects, from specified sensor, within specified time window; only return packets of type specified in typemask parameter. |
Device[] |
getDevices()
Get all device service proxies. |
DpaPortStatus[] |
getDpaPortStatus()
Get status of all DPA ports. |
DpaPortStatus |
getDpaPortStatus(byte[] commPortName)
Get status of DPA port associated with specified comm port. |
long |
getId()
Unique identifier for Node instance |
LeaseDescription[] |
getLeases(boolean usePrimary)
Get list of all active leases managed by the node. |
org.mbari.isi.interfaces.Location |
getLocation()
Return Location of Node. |
byte[] |
getMetadata()
Get Node metadata. |
byte[] |
getName()
Name of Node service class. |
PortConfiguration[] |
getPortConfiguration()
Get configuration of Node ports. |
Port[] |
getPorts()
Get array of Node's Port objects. |
PowerSwitch[] |
getPowerSwitches()
Get array of Node's power switches. |
byte[] |
getProperties()
Return byte-string representation of service's NodeProperties object. |
RemoteSerialPort |
getRemoteSerialPort(byte[] portName)
Get remote serial port. |
RemoteSerialPort |
getRemoteSerialPort(byte[] portName,
int timeout)
Get remote serial port with specified timeout in milliseconds. |
byte[] |
getSchedule()
Get Printable Schedule |
byte[] |
getSchedule(byte[] port,
long lookAheadSeconds)
Get Printable Schedule for a specified device, lookahead |
byte[] |
getSchedule(long lookAheadSeconds)
Get Printable Schedule |
byte[] |
getStatus(boolean logPacket)
Return byte string with node health/status information. |
Subnode[] |
getSubnodeObjects()
Get list of immediate subnodes. |
java.net.InetAddress[] |
getSubnodes()
Get list of immediate subnodes. |
java.net.InetAddress |
host()
Return InetAddress of device service host. |
void |
initialize()
Initialize the device. |
static void |
main(java.lang.String[] args)
|
void |
powerDownPort(byte[] commPortName)
Power down specified port and enable the comms if a service is not already using it |
int |
powerOff()
Turn Node power off. |
void |
powerUpPort(byte[] commPortName,
int currentLimit)
Power up specified port and enable the comms if a service is not already using it |
byte[] |
readWDT()
Read watchdog time (WDT) status |
byte[] |
removeSchedule(byte[] port,
byte[] scheduleName)
Remove Schedule |
void |
removeSubnode(java.net.InetAddress address)
Remove specified subnode from list. |
void |
renewLease(int leaseID,
long leaseMillisec)
Renew a lease with the Node's primary comms medium |
void |
renewLease(int leaseID,
long leaseMillisec,
boolean usePrimary)
Renew a lease with the Node's primary or secondary comms medium |
byte[] |
renewWDT()
Keep watchdog from waking up and resetting Node |
void |
restartService(byte[] portName)
Restart service (if any) associated with specified port. |
void |
resumeNormalMode()
Return from "safe" mode; resume normal operations. |
byte[] |
resumeSchedule(byte[] port,
byte[] scheduleName)
Resume Schedule Entry |
void |
resumeService(byte[] portName)
Resume service (if any) associated with specified port. |
void |
run(java.lang.String jarFileName,
java.lang.String portName,
java.lang.String codebaseDirectory)
Run the test. |
byte[] |
runCommand(byte[] cmd,
int timeoutSec)
Tell node to execute a Linux or shell command. |
void |
scanPort(byte[] commPortName)
Scan specified ports, load service. |
void |
scanPort(byte[] commPortName,
byte[] source)
Scan specified ports, load service. |
void |
scanPorts()
Scan all ports, load services. |
void |
shoreLinkDownCallback(java.net.InetAddress localAddress,
java.net.InetAddress remoteAddress)
Called when IP link to shore is disconnected |
void |
shoreLinkUpCallback(java.net.InetAddress localAddress,
java.net.InetAddress remoteAddress)
Called when IP link to shore is connected |
byte[] |
shutdownDeviceService(byte[] commPortName)
Shutdown and remove device service from specified port. |
NodeSessionInfo |
startSession(boolean renewWDT,
byte[] initScript,
int scriptTimeoutSec)
Prepare for telemetry retrieval session |
boolean |
summarizing(long deviceID)
Return true if specified device can supply Summary packets. |
byte[] |
suspendSchedule(byte[] port,
byte[] scheduleName)
Suspend Schedule Entry |
void |
suspendService(byte[] portName)
Suspend service (if any) associated with specified port. |
byte[] |
syncSchedule(byte[] port,
byte[] scheduleName,
long delayMillis)
Synchronize a (default sample) schedule entry |
void |
terminateLease(int leaseID)
Terminate the session with the primary communications link. |
void |
terminateLease(int leaseID,
boolean usePrimary)
Terminate the session with the communications link. |
int |
test()
Run Node's self-test routine. |
void |
wakeupAllNodes()
Send signal to wakeup all nodes. |
void |
wakeupNode(java.net.InetAddress node)
Send signal to wakeup specified node. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
|---|
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
|---|
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
|---|
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.mbari.siam.distributed.Node |
|---|
getDevicePackets, getDevicePackets, getNodeInfo, instrumentRegistryStatus, lookupService, readLog4jConfig, setProperties, shoreLinkDownCallback, shoreLinkUpCallback, terminateLeases |
| Methods inherited from interface org.mbari.siam.distributed.RemoteService |
|---|
ping |
| Field Detail |
|---|
public static final java.lang.String INSTRUMENT_URL
| Constructor Detail |
|---|
public TestNodeService()
throws java.rmi.RemoteException
java.rmi.RemoteException| Method Detail |
|---|
public void run(java.lang.String jarFileName,
java.lang.String portName,
java.lang.String codebaseDirectory)
throws java.lang.Exception
java.lang.Exception
public boolean summarizing(long deviceID)
throws DeviceNotFound,
java.rmi.RemoteException
summarizing in interface NodeDeviceNotFound
java.rmi.RemoteException
public java.net.InetAddress host()
throws java.rmi.RemoteException,
java.net.UnknownHostException
host in interface Nodejava.rmi.RemoteException
java.net.UnknownHostException
public byte[] getName()
throws java.rmi.RemoteException
getName in interface Nodejava.rmi.RemoteException
public long getId()
throws java.rmi.RemoteException
getId in interface Nodejava.rmi.RemoteException
public void initialize()
throws java.rmi.RemoteException,
InitializeException
initialize in interface Nodejava.rmi.RemoteException
InitializeException
public int powerOff()
throws java.rmi.RemoteException
powerOff in interface Nodejava.rmi.RemoteException
public PortConfiguration[] getPortConfiguration()
throws java.rmi.RemoteException
getPortConfiguration in interface Nodejava.rmi.RemoteException
public Device getDevice(long deviceId)
throws java.rmi.RemoteException,
DeviceNotFound
getDevice in interface Nodejava.rmi.RemoteException
DeviceNotFound
public Device[] getDevices()
throws java.rmi.RemoteException
getDevices in interface Nodejava.rmi.RemoteException
public byte[] shutdownDeviceService(byte[] commPortName)
throws java.rmi.RemoteException,
PortNotFound,
DeviceNotFound
shutdownDeviceService in interface Nodejava.rmi.RemoteException
PortNotFound
DeviceNotFound
public void scanPorts()
throws java.rmi.RemoteException
scanPorts in interface Nodejava.rmi.RemoteException
public void scanPort(byte[] commPortName)
throws java.rmi.RemoteException,
PortNotFound,
DeviceNotFound,
java.io.IOException,
PortOccupiedException,
DuplicateIdException
scanPort in interface Nodejava.rmi.RemoteException
PortNotFound
DeviceNotFound
java.io.IOException
PortOccupiedException
DuplicateIdException
public void scanPort(byte[] commPortName,
byte[] source)
throws java.rmi.RemoteException,
PortNotFound,
DeviceNotFound,
java.io.IOException,
PortOccupiedException,
DuplicateIdException
scanPort in interface Nodejava.rmi.RemoteException
PortNotFound
DeviceNotFound
java.io.IOException
PortOccupiedException
DuplicateIdException
public Device getDevice(byte[] commPortName)
throws java.rmi.RemoteException,
PortNotFound,
DeviceNotFound
getDevice in interface Nodejava.rmi.RemoteException
PortNotFound
DeviceNotFound
public Port[] getPorts()
throws java.rmi.RemoteException
getPorts in interface Nodejava.rmi.RemoteException
public PowerSwitch[] getPowerSwitches()
throws java.rmi.RemoteException
getPowerSwitches in interface Nodejava.rmi.RemoteException
public DevicePacketSet getDevicePackets(long sensorID,
long startTime,
long endTime)
throws java.rmi.RemoteException,
DeviceNotFound,
NoDataException
getDevicePackets in interface Nodejava.rmi.RemoteException
DeviceNotFound
NoDataException
public DevicePacketSet getDevicePackets(long sensorID,
long startTime,
long endTime,
int typeMask)
throws java.rmi.RemoteException,
DeviceNotFound,
NoDataException
getDevicePackets in interface Nodejava.rmi.RemoteException
DeviceNotFound
NoDataException
public void suspendService(byte[] portName)
throws java.rmi.RemoteException,
PortNotFound,
DeviceNotFound
suspendService in interface Nodejava.rmi.RemoteException
PortNotFound
DeviceNotFound
public void resumeService(byte[] portName)
throws java.rmi.RemoteException,
PortNotFound,
DeviceNotFound
resumeService in interface Nodejava.rmi.RemoteException
PortNotFound
DeviceNotFound
public void restartService(byte[] portName)
throws java.rmi.RemoteException,
PortNotFound,
DeviceNotFound,
java.lang.Exception
restartService in interface Nodejava.rmi.RemoteException
PortNotFound
DeviceNotFound
java.lang.Exception
public RemoteSerialPort getRemoteSerialPort(byte[] portName)
throws java.rmi.RemoteException,
java.net.UnknownHostException,
PortNotFound,
PortOccupiedException,
java.io.IOException
getRemoteSerialPort in interface Nodejava.rmi.RemoteException
java.net.UnknownHostException
PortNotFound
PortOccupiedException
java.io.IOException
public RemoteSerialPort getRemoteSerialPort(byte[] portName,
int timeout)
throws java.rmi.RemoteException,
java.net.UnknownHostException,
PortNotFound,
PortOccupiedException,
RangeException,
java.io.IOException
getRemoteSerialPort in interface Nodejava.rmi.RemoteException
java.net.UnknownHostException
PortNotFound
PortOccupiedException
RangeException
java.io.IOException
public int test()
throws java.rmi.RemoteException
test in interface Nodejava.rmi.RemoteException
public org.mbari.isi.interfaces.Location getLocation()
throws java.rmi.RemoteException,
UnknownLocationException
getLocation in interface Nodejava.rmi.RemoteException
UnknownLocationException
public byte[] getMetadata()
throws java.rmi.RemoteException
getMetadata in interface Nodejava.rmi.RemoteException
public byte[] getSchedule()
throws java.rmi.RemoteException
getSchedule in interface Nodejava.rmi.RemoteException
public byte[] getSchedule(long lookAheadSeconds)
throws java.rmi.RemoteException
getSchedule in interface Nodejava.rmi.RemoteException
public byte[] getSchedule(byte[] port,
long lookAheadSeconds)
throws java.rmi.RemoteException
getSchedule in interface Nodejava.rmi.RemoteException
public byte[] addSchedule(byte[] port,
byte[] scheduleName,
byte[] schedule,
boolean overwrite)
throws java.rmi.RemoteException
addSchedule in interface Nodejava.rmi.RemoteException
public byte[] removeSchedule(byte[] port,
byte[] scheduleName)
throws java.rmi.RemoteException
removeSchedule in interface Nodejava.rmi.RemoteException
public byte[] suspendSchedule(byte[] port,
byte[] scheduleName)
throws java.rmi.RemoteException
suspendSchedule in interface Nodejava.rmi.RemoteException
public byte[] resumeSchedule(byte[] port,
byte[] scheduleName)
throws java.rmi.RemoteException
resumeSchedule in interface Nodejava.rmi.RemoteException
public byte[] syncSchedule(byte[] port,
byte[] scheduleName,
long delayMillis)
throws java.rmi.RemoteException
syncSchedule in interface Nodejava.rmi.RemoteException
public void addEventCallback(NodeEventCallback callback)
throws java.rmi.RemoteException
addEventCallback in interface Nodejava.rmi.RemoteException
public void shoreLinkUpCallback(java.net.InetAddress localAddress,
java.net.InetAddress remoteAddress)
throws java.rmi.RemoteException,
java.lang.Exception
java.rmi.RemoteException
java.lang.Exception
public void shoreLinkDownCallback(java.net.InetAddress localAddress,
java.net.InetAddress remoteAddress)
throws java.rmi.RemoteException,
java.lang.Exception
java.rmi.RemoteException
java.lang.Exception
public int establishLease(long leaseMillisec,
byte[] clientNote)
throws java.rmi.RemoteException,
LeaseRefused
establishLease in interface NodeleaseMillisec - lease period in millisecondsclientNote - note attached by client
java.rmi.RemoteException
LeaseRefused
public int establishLease(long leaseMillisec,
byte[] clientNote,
boolean usePrimary)
throws java.rmi.RemoteException,
LeaseRefused
establishLease in interface Nodejava.rmi.RemoteException
LeaseRefused
public void renewLease(int leaseID,
long leaseMillisec)
throws java.rmi.RemoteException,
LeaseRefused
renewLease in interface NodeleaseID - lease ID returned by establishLease()leaseMillisec - lease period in milliseconds
java.rmi.RemoteException
LeaseRefused
public void renewLease(int leaseID,
long leaseMillisec,
boolean usePrimary)
throws java.rmi.RemoteException,
LeaseRefused
renewLease in interface NodeleaseID - lease ID returned by establishLease()leaseMillisec - lease period in milliseconds
java.rmi.RemoteException
LeaseRefused
public void terminateLease(int leaseID)
throws java.rmi.RemoteException
terminateLease in interface NodeleaseID - lease ID returned by establishLease()
java.rmi.RemoteException
public void terminateLease(int leaseID,
boolean usePrimary)
throws java.rmi.RemoteException
terminateLease in interface NodeleaseID - lease ID returned by establishLease()
java.rmi.RemoteException
public void cpuLease(int requestorID,
long when,
long howLong)
throws java.rmi.RemoteException
cpuLease in interface NoderequestorID - Unique ID (externally assigned) to identify who is requesting
the CPU to remain on. Allows for multiple requestors each
requesting that the CPU be on.when - Milliseconds until the requestor needs the CPU on. Use 0
(zero) to request that the CPU remain on starting now.howLong - Number of milliseconds that the CPU should remain on. Use 0
(zero) to cancel an earlier request.
java.rmi.RemoteException
public byte[] getStatus(boolean logPacket)
throws java.rmi.RemoteException
getStatus in interface Nodejava.rmi.RemoteException
public void exitApplication()
throws java.rmi.RemoteException
exitApplication in interface Nodejava.rmi.RemoteException
public void powerUpPort(byte[] commPortName,
int currentLimit)
throws java.rmi.RemoteException,
PortOccupiedException,
PortNotFound,
RangeException,
NotSupportedException
powerUpPort in interface Nodejava.rmi.RemoteException
PortOccupiedException
PortNotFound
RangeException
NotSupportedException
public void powerDownPort(byte[] commPortName)
throws java.rmi.RemoteException,
PortOccupiedException,
PortNotFound
powerDownPort in interface Nodejava.rmi.RemoteException
PortOccupiedException
PortNotFound
public java.net.InetAddress[] getSubnodes()
throws java.rmi.RemoteException
getSubnodes in interface Nodejava.rmi.RemoteException
public Subnode[] getSubnodeObjects()
throws java.rmi.RemoteException
getSubnodeObjects in interface Nodejava.rmi.RemoteException
public void removeSubnode(java.net.InetAddress address)
throws java.rmi.RemoteException,
java.lang.Exception
removeSubnode in interface Nodejava.rmi.RemoteException
java.lang.Exception
public LeaseDescription[] getLeases(boolean usePrimary)
throws java.rmi.RemoteException
getLeases in interface Nodejava.rmi.RemoteException
public byte[] renewWDT()
throws java.rmi.RemoteException,
java.io.IOException,
java.io.FileNotFoundException
renewWDT in interface MOOSNodejava.rmi.RemoteException
java.io.IOException
java.io.FileNotFoundException
public byte[] readWDT()
throws java.rmi.RemoteException,
java.io.IOException,
java.io.FileNotFoundException
readWDT in interface MOOSNodejava.rmi.RemoteException
java.io.IOException
java.io.FileNotFoundException
public DpaPortStatus getDpaPortStatus(byte[] commPortName)
throws NotSupportedException,
DeviceNotFound,
java.rmi.RemoteException
getDpaPortStatus in interface MOOSNodeNotSupportedException
DeviceNotFound
java.rmi.RemoteException
public DpaPortStatus[] getDpaPortStatus()
throws java.rmi.RemoteException
getDpaPortStatus in interface MOOSNodejava.rmi.RemoteException
public byte[] getProperties()
throws java.rmi.RemoteException
getProperties in interface Nodejava.rmi.RemoteException
public void wakeupNode(java.net.InetAddress node)
throws java.rmi.RemoteException,
java.io.IOException
wakeupNode in interface MOOSNodejava.rmi.RemoteException
java.io.IOException
public void wakeupAllNodes()
throws java.rmi.RemoteException,
java.io.IOException
wakeupAllNodes in interface MOOSNodejava.rmi.RemoteException
java.io.IOException
public byte[] runCommand(byte[] cmd,
int timeoutSec)
throws java.rmi.RemoteException,
java.io.IOException,
TimeoutException
runCommand in interface Nodejava.rmi.RemoteException
java.io.IOException
TimeoutException
public void enterSafeMode()
throws java.rmi.RemoteException,
java.lang.Exception
enterSafeMode in interface Nodejava.rmi.RemoteException
java.lang.Exception
public void enterSafeMode(long wait)
throws java.rmi.RemoteException,
java.lang.Exception
enterSafeMode in interface Nodejava.rmi.RemoteException
java.lang.Exception
public void resumeNormalMode()
throws java.rmi.RemoteException,
java.lang.Exception
resumeNormalMode in interface Nodejava.rmi.RemoteException
java.lang.Exception
public void annotate(byte[] annotation)
throws java.rmi.RemoteException
annotate in interface Nodejava.rmi.RemoteException
public void exitApplication(boolean doSafemode,
boolean doHalt,
boolean enableBackups,
boolean doNotify,
boolean recursive,
int quitDelaySec,
int haltDelaySec,
java.lang.String msg)
throws java.rmi.RemoteException,
java.lang.Exception
exitApplication in interface Nodejava.rmi.RemoteException
java.lang.Exception
public NodeSessionInfo startSession(boolean renewWDT,
byte[] initScript,
int scriptTimeoutSec)
throws java.lang.Exception
startSession in interface Nodejava.lang.Exceptionpublic static void main(java.lang.String[] args)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||