HPSearch

cgl.hpsearch.engine.URIBindings
Class NBNativePersistantStreamHandler

java.lang.Object
  extended byjava.io.OutputStream
      extended bycgl.hpsearch.engine.URIBindings.NBNativePersistantStreamHandler
All Implemented Interfaces:
NBEventListener, SystemConstants

public class NBNativePersistantStreamHandler
extends OutputStream
implements SystemConstants, NBEventListener

Created on Mar 17, 2006

Author:
Harshawardhan Gadgil (hgadgil@grids.ucs.indiana.edu)

Field Summary
 
Fields inherited from interface cgl.hpsearch.common.SystemConstants
ABANDON_HANDLER, ABANDONED, BROKER_HOST, BROKER_PORT, BUF_SIZE, EOT, EXCEPTION, FAILURE, FILESEPARTOR, FLOW_LOGGING_MANAGER, FLOW_MANAGER, HPSEARCH_CONFIG, HPSEARCH_HOME, HPSEARCH_SHELL, HPSEARCH_WS, MARKER, NB_HOME, NB_PERFORMANCE_DATA_TOPIC, OS_TYPE, OS_UNIX, OS_WIN, PORT, PROTOCOL, READY, RESUME, RUNNING, SCRIPT_ARGS, SCRIPT_PATH, SHELLWS_PORT, START_HANDLER, STREAM_MARKER_DATA, STREAM_MARKER_EOF, STX, SUCCESS, SUSPEND, TASK_DEFINED, TASK_SCHEDULER_ENGINE, TASKSCHEDULER_AUTO_CONNECT_COMM_LINK, TASKSCHEDULER_ENGINE_COMM_LINK, THREAD_SLEEP_INTERVAL, UNKNOWN, WAITING, WSCONTEXT_RESULT_BIN, WSCONTEXT_SERVICE
 
Constructor Summary
NBNativePersistantStreamHandler(String connectionURI)
           
NBNativePersistantStreamHandler(String hostName, int portNum, String transportType, String brokerStream)
           
NBNativePersistantStreamHandler(String hostName, int portNum, String transportType, String brokerStream, String configFilePath)
           
NBNativePersistantStreamHandler(String connectionURI, String configFilePath)
           
 
Method Summary
 void close()
          Closes the Broker connection and terminated Client services.
 void flush()
          NOT IMPLEMENTED...
 InputStream getInputStream()
          Get the Input stream
 OutputStream getOutputStream()
          Get the Output Stream
static void main(String[] args)
           
 void onEvent(NBEvent nbEvent)
           
 void write(byte[] buf)
          Writes buf to the topic to which this instance is subscribed to
 void write(byte[] buf, int offset, int len)
          Writes a part of the byte buffer buf to the topic to which this instance is subscribed to
 void write(int i)
          NOT IMPLEMENTED...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NBNativePersistantStreamHandler

public NBNativePersistantStreamHandler(String connectionURI)

NBNativePersistantStreamHandler

public NBNativePersistantStreamHandler(String connectionURI,
                                       String configFilePath)

NBNativePersistantStreamHandler

public NBNativePersistantStreamHandler(String hostName,
                                       int portNum,
                                       String transportType,
                                       String brokerStream)

NBNativePersistantStreamHandler

public NBNativePersistantStreamHandler(String hostName,
                                       int portNum,
                                       String transportType,
                                       String brokerStream,
                                       String configFilePath)
Method Detail

getInputStream

public InputStream getInputStream()
Get the Input stream

Returns:
The input stream, Null on error

getOutputStream

public OutputStream getOutputStream()
Get the Output Stream

Returns:
The output stream, Null on error

onEvent

public void onEvent(NBEvent nbEvent)
Specified by:
onEvent in interface NBEventListener

write

public void write(byte[] buf,
                  int offset,
                  int len)
           throws IOException
Writes a part of the byte buffer buf to the topic to which this instance is subscribed to

Parameters:
buf - A byte array containing the data to publish
offset - An int representing the offset in the buffer buf
len - An int representing the length of array to send.
Throws:
IOException

write

public void write(byte[] buf)
           throws IOException
Writes buf to the topic to which this instance is subscribed to

Parameters:
buf - A byte array containing the data to publish
Throws:
IOException

write

public void write(int i)
           throws IOException
NOT IMPLEMENTED...

Throws:
IOException
See Also:
OutputStream.write(int)

flush

public void flush()
           throws IOException
NOT IMPLEMENTED...

Throws:
IOException
See Also:
OutputStream.flush()

close

public void close()
Closes the Broker connection and terminated Client services.
NOTE: We do not terminate connection to the broker but merely unsubscribe from profile. This is so that closing one instance of the clientService should not disallow other clients in same JVM from using the client service and existing connection

See Also:
OutputStream.close()

main

public static void main(String[] args)

HPSearch

For comments and suggestions please send e-mail to Harshawardhan Gadgil
Last updated: June 9 2006