com.streambase.sb.client
Class DequeueResult

java.lang.Object
  extended by com.streambase.sb.client.DequeueResult
All Implemented Interfaces:
Iterable

public class DequeueResult
extends Object
implements Iterable

Encapsulates the data returned from a dequeue() operation. Contains references to the originating stream, and a list of tuples.


Field Summary
static int CLOSED
          Status code indicating that the connection was closed
static int GOOD
          Status code indicating a normal dequeue
static int TIMEOUT
          Status code indicating a timeout during dequeue
 
Method Summary
 Schema getSchema()
          Returns the schema for the tuples dequeued
 int getStatus()
          Return the status of this DequeueResult.
 String getStreamName()
          Returns the name of the stream on which tuples were dequeued.
 StreamProperties getStreamProperties()
          Return the StreamProperties for this DequeueResult
 Tuple getTuple()
          Deprecated.  
 Tuple getTuple(int index)
          Deprecated. please use iterator() to access Tuples sequentially
 int getTupleCount()
          Returns the number of tuples dequeued.
 Iterator iterator()
          Returns an iterator of all tuples.
 void reuseTuple()
          Deprecated.  
 void reuseTuple(Tuple tuple)
          Deprecated.  
 List tuples()
          Deprecated. use iterator() instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GOOD

public static final int GOOD
Status code indicating a normal dequeue

See Also:
Constant Field Values

TIMEOUT

public static final int TIMEOUT
Status code indicating a timeout during dequeue

See Also:
Constant Field Values

CLOSED

public static final int CLOSED
Status code indicating that the connection was closed

See Also:
Constant Field Values
Method Detail

reuseTuple

public void reuseTuple()
Deprecated. 

This is a no-op that is maintained only for backwards compatibility.


reuseTuple

public void reuseTuple(Tuple tuple)
Deprecated. 

This is a no-op that is maintained only for backwards compatibility.

The semantics of this call in earlier version are difficult to rely upon safely and should be removed.


getStreamName

public String getStreamName()
Returns the name of the stream on which tuples were dequeued.

Returns:
the unqualified name of the stream

getTupleCount

public int getTupleCount()
Returns the number of tuples dequeued.

Returns:
number of tuples

getSchema

public Schema getSchema()
Returns the schema for the tuples dequeued

Since:
5.0

getStreamProperties

public StreamProperties getStreamProperties()
Return the StreamProperties for this DequeueResult

Returns:
StreamProperties

getTuple

public Tuple getTuple(int index)
Deprecated. please use iterator() to access Tuples sequentially

Returns the indexth tuple.


getTuple

public Tuple getTuple()
Deprecated. 

Returns the first tuple.


tuples

public List tuples()
Deprecated. use iterator() instead

Returns a list of all tuples dequeued. This method may have poor performance as it will create a new Tuple element in the List.


iterator

public Iterator iterator()
Returns an iterator of all tuples.

Specified by:
iterator in interface Iterable

getStatus

public int getStatus()
Return the status of this DequeueResult.

Returns:
DequeueResult.GOOD if the DequeueResult contains tuples.