Explanation
This interface is used by a custom adaptor to receive tuples from the SDP server.
The following two types of APIs are available for receiving tuples:
The polling method is used by a custom adaptor to dynamically acquire tuples from the SDP server. The get method and getAll method are available. The get method is for receiving a single tuple, and the getAll method is for receiving multiple tuples in a batch.
The callback method is called to passively acquire tuples as they are generated in the SDP server. To receive data using the callback method, you must pre-register an object (listener object) in the SDP server that defines the method to be called by the SDP server when a tuple is generated.
A listener object is an object in which the StreamEventListener interface is implemented. The StreamOutput interface provides the registerForNotification method for registering a listener object in the SDP server. The unregisterForNotification method is available to cancel registration of a listener object.
Method
The following table shows the StreamOutput interface method list.
Return value | Method name | Function |
---|---|---|
void | close() | Closes the connection to the output stream. |
StreamTuple | get() | Acquires a single tuple registered in the SDP server. |
ArrayList<StreamTuple> | get(int count) | Acquires the number of tuples specified by the count parameter from the SDP server. |
ArrayList<StreamTuple> | get(int count, long timeout) | Acquires the number of tuples specified by the count parameter from the SDP server. If there is no result data in the SDP server, this method waits until result data arrives or until the time specified in the timeout parameter elapses. |
ArrayList<StreamTuple> | getAll() | Acquires all tuples registered in the SDP server. |
ArrayList<StreamTuple> | getAll(long timeout) | Acquires all tuples registered in the SDP server. If there is no result data in the SDP server, this method waits until result data arrives or until the time specified in the timeout parameter elapses. |
int | getFreeQueueSize() | Acquires the amount of free space in the output stream queue. |
int | getMaxQueueSize() | Acquires the maximum size of the output stream queue. |
void | registerForNotification(StreamEventListener n) | Registers a listener object for callback. |
void | unregisterForNotification(StreamEventListener n) | Cancels a registered listener object to prevent further execution of the callback process. |
Notes
None.