org.mbari.siam.tests.linkBenchmark2.client
Class SocketBenchmarkProxy

java.lang.Object
  extended by org.mbari.siam.tests.linkBenchmark2.client.SocketBenchmarkProxy
All Implemented Interfaces:
java.rmi.Remote, Benchmark2

public class SocketBenchmarkProxy
extends java.lang.Object
implements Benchmark2

Benchmark2Test that uses RMI for communication with server.


Field Summary
protected static org.apache.log4j.Logger _logger
          Log4j logger
 
Fields inherited from interface org.mbari.siam.tests.linkBenchmark2.interfaces.Benchmark2
RMI_SERVER_NAME, SOCKET_TCP_PORT
 
Constructor Summary
SocketBenchmarkProxy()
           
 
Method Summary
protected  void checkReturn(java.lang.Object obj, java.lang.Class cl)
           
 void connectNode(java.lang.String serverName, int port)
          Connect to the Node Server.
 void disconnectNode()
          Disconnect from the Node Server
protected  java.lang.Object getAndCheckRemoteObject(java.lang.String cmd, java.lang.Class cl)
           
 byte[] getCompressedPackets(long startKey, long endKey, int maxEntries)
          Gets compressed DevicePacketSets from DeviceLog named in setDeviceLog()
 DevicePacketSet getPackets(long startKey, long endKey, int maxEntries)
          Gets DevicePacketSets from DeviceLog named in setDeviceLog()
protected  long getRemoteLong(java.lang.String cmd)
          Internal function to send string and return Long
protected  java.lang.Object getRemoteObject(java.lang.String cmd)
          Internal function to send string and return Object
 boolean nodeConnected()
          Returns true if portal currently has "live" connection to remote node.
 int setDeviceLog(long sensorId, java.lang.String directory)
          Sets DeviceLog for later getPackets(), returns total number of entries in DeviceLog
 int setFilteredDeviceLog(long sensorId, java.lang.String directory)
          Uses FilteredDeviceLog for later getPackets(), returns total number of entries in DeviceLog
 void setupStreams()
          Set up the ObjectxxxStreams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

protected static org.apache.log4j.Logger _logger
Log4j logger

Constructor Detail

SocketBenchmarkProxy

public SocketBenchmarkProxy()
Method Detail

connectNode

public void connectNode(java.lang.String serverName,
                        int port)
                 throws java.lang.Exception
Connect to the Node Server. Return true on success, false on error.

Throws:
java.lang.Exception

setupStreams

public void setupStreams()
                  throws java.io.IOException,
                         java.lang.Exception
Set up the ObjectxxxStreams

Throws:
java.io.IOException
java.lang.Exception

disconnectNode

public void disconnectNode()
Disconnect from the Node Server


nodeConnected

public boolean nodeConnected()
Returns true if portal currently has "live" connection to remote node.


getRemoteObject

protected java.lang.Object getRemoteObject(java.lang.String cmd)
                                    throws java.io.IOException
Internal function to send string and return Object

Throws:
java.io.IOException

checkReturn

protected void checkReturn(java.lang.Object obj,
                           java.lang.Class cl)
                    throws java.rmi.UnexpectedException
Throws:
java.rmi.UnexpectedException

getAndCheckRemoteObject

protected java.lang.Object getAndCheckRemoteObject(java.lang.String cmd,
                                                   java.lang.Class cl)
                                            throws java.io.IOException,
                                                   java.rmi.UnexpectedException
Throws:
java.io.IOException
java.rmi.UnexpectedException

getRemoteLong

protected long getRemoteLong(java.lang.String cmd)
                      throws java.io.IOException,
                             java.rmi.UnexpectedException
Internal function to send string and return Long

Throws:
java.io.IOException
java.rmi.UnexpectedException

setDeviceLog

public int setDeviceLog(long sensorId,
                        java.lang.String directory)
                 throws java.io.IOException,
                        java.io.FileNotFoundException
Sets DeviceLog for later getPackets(), returns total number of entries in DeviceLog

Specified by:
setDeviceLog in interface Benchmark2
Throws:
java.io.IOException
java.io.FileNotFoundException

setFilteredDeviceLog

public int setFilteredDeviceLog(long sensorId,
                                java.lang.String directory)
                         throws java.io.IOException,
                                java.io.FileNotFoundException
Uses FilteredDeviceLog for later getPackets(), returns total number of entries in DeviceLog

Specified by:
setFilteredDeviceLog in interface Benchmark2
Throws:
java.io.IOException
java.io.FileNotFoundException

getPackets

public DevicePacketSet getPackets(long startKey,
                                  long endKey,
                                  int maxEntries)
                           throws java.io.IOException,
                                  NoDataException
Gets DevicePacketSets from DeviceLog named in setDeviceLog()

Specified by:
getPackets in interface Benchmark2
Throws:
java.io.IOException
NoDataException

getCompressedPackets

public byte[] getCompressedPackets(long startKey,
                                   long endKey,
                                   int maxEntries)
                            throws NoDataException,
                                   java.io.InvalidClassException,
                                   java.io.NotSerializableException,
                                   java.io.IOException
Gets compressed DevicePacketSets from DeviceLog named in setDeviceLog()

Specified by:
getCompressedPackets in interface Benchmark2
Throws:
NoDataException
java.io.InvalidClassException
java.io.NotSerializableException
java.io.IOException


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.