org.edg.info
Class ConsumerConnection

java.lang.Object
  extended byorg.edg.info.ConsumerConnection

public class ConsumerConnection
extends java.lang.Object

Details of a single streaming connection to a consumer.


Constructor Summary
ConsumerConnection(java.nio.channels.SocketChannel socketChannel, Expression where, java.util.Vector select, org.edg.info.system.StreamRequest request)
          Creates a new ConsumerConnection object.
 
Method Summary
 int getConnectAttempts()
          Gets the number of connection attempts.
 int getConnectionId()
          Returns consumer connection ID
 java.nio.ByteBuffer getCurrentResultSetBytes()
          Gets the serialized bytes for the current ResultSet.
 long getLastWriteDurationMillis()
          Gets the duration of the last write.
 org.edg.info.system.StreamRequest getRequest()
          Returns stream request.
 java.util.Vector getSelect()
          Returns SELECT items.
 java.nio.channels.SocketChannel getSocketChannel()
          Returns socket channel.
 java.lang.String getUrl()
          Returns consumer URL.
 Expression getWhere()
          Returns WHERE clause.
 void incConnectAttempts()
          Increments the number of connection attempts by one.
 void resetConnectAttempts()
          Resets the number of connection attempts to zero.
 void setCurrentResultSetBytes(java.nio.ByteBuffer bytes)
          Sets the serialized bytes for the current ResultSet.
 void setLastWriteDurationMillis(long lastWriteDurationMS)
          Sets the duration of the last write.
 void setSocketChannel(java.nio.channels.SocketChannel channel)
          Sets socket channel.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConsumerConnection

public ConsumerConnection(java.nio.channels.SocketChannel socketChannel,
                          Expression where,
                          java.util.Vector select,
                          org.edg.info.system.StreamRequest request)
Creates a new ConsumerConnection object.

Parameters:
socketChannel - Socket channel connected to consumer (or null if not yet instantiated).
where - SQL WHERE clause.
select - SQL SELECT statement.
request - Consumer streaming details.
Method Detail

getCurrentResultSetBytes

public java.nio.ByteBuffer getCurrentResultSetBytes()
Gets the serialized bytes for the current ResultSet.

Returns:
Serialized bytes for the current ResultSet in a ByteBuffer.

setCurrentResultSetBytes

public void setCurrentResultSetBytes(java.nio.ByteBuffer bytes)
Sets the serialized bytes for the current ResultSet.

Parameters:
bytes - Serialized bytes for ResultSet in ByteBuffer.

getConnectionId

public int getConnectionId()
Returns consumer connection ID

Returns:
Consumer connection ID.

getRequest

public org.edg.info.system.StreamRequest getRequest()
Returns stream request.

Returns:
Stream request.

getSelect

public java.util.Vector getSelect()
Returns SELECT items.

Returns:
Parsed SELECT items.

setSocketChannel

public void setSocketChannel(java.nio.channels.SocketChannel channel)
Sets socket channel.

Parameters:
channel - Socket channel.

getSocketChannel

public java.nio.channels.SocketChannel getSocketChannel()
Returns socket channel.

Returns:
Socket channel for the consumer (can be null).

getUrl

public java.lang.String getUrl()
Returns consumer URL.

Returns:
Consumer URL.

getWhere

public Expression getWhere()
Returns WHERE clause.

Returns:
WHERE clause.

toString

public java.lang.String toString()
See Also:
Object.toString()

getConnectAttempts

public int getConnectAttempts()
Gets the number of connection attempts.

Returns:
Number of connection attempts

resetConnectAttempts

public void resetConnectAttempts()
Resets the number of connection attempts to zero.


incConnectAttempts

public void incConnectAttempts()
Increments the number of connection attempts by one.


getLastWriteDurationMillis

public long getLastWriteDurationMillis()
Gets the duration of the last write.

Returns:
Duration of the last write (in millis).

setLastWriteDurationMillis

public void setLastWriteDurationMillis(long lastWriteDurationMS)
Sets the duration of the last write.

Parameters:
lastWriteDurationMS - Duration of the last write (in millis).