org.teiid.transport
Class PgBackendProtocol

java.lang.Object
  extended by org.teiid.transport.PgBackendProtocol
All Implemented Interfaces:
org.jboss.netty.channel.ChannelDownstreamHandler, org.jboss.netty.channel.ChannelHandler, ODBCClientRemote

public class PgBackendProtocol
extends java.lang.Object
implements org.jboss.netty.channel.ChannelDownstreamHandler, ODBCClientRemote

Represents the messages going from Server --> PG ODBC Client Some parts of this code is taken from H2's implementation of ODBC


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
PgBackendProtocol(int maxLobSize, int maxBufferSize, SSLConfiguration config)
           
 
Method Summary
 void authenticationSucess(int processId, int screctKey)
           
 void bindComplete()
           
 void emptyQueryReceived()
           
 void errorOccurred(java.lang.String msg)
           
 void errorOccurred(java.lang.Throwable t)
           
static void escapeQuote(java.io.Writer sb, java.lang.String s)
           
 void flush()
           
 void functionCallResponse(byte[] data)
           
 void functionCallResponse(int data)
           
 void handleDownstream(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelEvent evt)
           
 void initialized(java.util.Properties props)
           
 void prepareCompleted(java.lang.String preparedName)
           
 void ready(boolean inTransaction, boolean failedTransaction)
           
 void sendCommandComplete(java.lang.String sql, int updateCount)
           
 void sendCursorResults(ResultSetImpl rs, java.util.List<PGUtil.PgColInfo> cols, ResultsFuture<java.lang.Integer> result, int rowCount)
           
 void sendMoveCursor(ResultSetImpl rs, int rowCount, ResultsFuture<java.lang.Integer> results)
           
 void sendParameterDescription(java.sql.ParameterMetaData meta, int[] paramType)
           
 void sendPortalResults(java.lang.String sql, ResultSetImpl rs, java.util.List<PGUtil.PgColInfo> cols, ResultsFuture<java.lang.Integer> result, int rowCount, boolean portal)
           
 void sendPortalSuspended()
           
 void sendResults(java.lang.String sql, ResultSetImpl rs, java.util.List<PGUtil.PgColInfo> cols, ResultsFuture<java.lang.Integer> result, boolean describeRows)
           
 void sendResultSetDescription(java.util.List<PGUtil.PgColInfo> cols)
           
 void sendSslResponse()
           
 void sendUpdateCount(java.lang.String sql, int updateCount)
           
 void setEncoding(java.lang.String value)
           
 void statementClosed()
           
 void terminated()
           
 void useClearTextAuthentication()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PgBackendProtocol

public PgBackendProtocol(int maxLobSize,
                         int maxBufferSize,
                         SSLConfiguration config)
Method Detail

handleDownstream

public void handleDownstream(org.jboss.netty.channel.ChannelHandlerContext ctx,
                             org.jboss.netty.channel.ChannelEvent evt)
                      throws java.lang.Exception
Specified by:
handleDownstream in interface org.jboss.netty.channel.ChannelDownstreamHandler
Throws:
java.lang.Exception

initialized

public void initialized(java.util.Properties props)
Specified by:
initialized in interface ODBCClientRemote

useClearTextAuthentication

public void useClearTextAuthentication()
Specified by:
useClearTextAuthentication in interface ODBCClientRemote

authenticationSucess

public void authenticationSucess(int processId,
                                 int screctKey)
Specified by:
authenticationSucess in interface ODBCClientRemote

prepareCompleted

public void prepareCompleted(java.lang.String preparedName)
Specified by:
prepareCompleted in interface ODBCClientRemote

bindComplete

public void bindComplete()
Specified by:
bindComplete in interface ODBCClientRemote

errorOccurred

public void errorOccurred(java.lang.String msg)
Specified by:
errorOccurred in interface ODBCClientRemote

errorOccurred

public void errorOccurred(java.lang.Throwable t)
Specified by:
errorOccurred in interface ODBCClientRemote

ready

public void ready(boolean inTransaction,
                  boolean failedTransaction)
Specified by:
ready in interface ODBCClientRemote

setEncoding

public void setEncoding(java.lang.String value)
Specified by:
setEncoding in interface ODBCClientRemote

sendParameterDescription

public void sendParameterDescription(java.sql.ParameterMetaData meta,
                                     int[] paramType)
Specified by:
sendParameterDescription in interface ODBCClientRemote

sendResultSetDescription

public void sendResultSetDescription(java.util.List<PGUtil.PgColInfo> cols)
Specified by:
sendResultSetDescription in interface ODBCClientRemote

sendCursorResults

public void sendCursorResults(ResultSetImpl rs,
                              java.util.List<PGUtil.PgColInfo> cols,
                              ResultsFuture<java.lang.Integer> result,
                              int rowCount)
Specified by:
sendCursorResults in interface ODBCClientRemote

sendPortalResults

public void sendPortalResults(java.lang.String sql,
                              ResultSetImpl rs,
                              java.util.List<PGUtil.PgColInfo> cols,
                              ResultsFuture<java.lang.Integer> result,
                              int rowCount,
                              boolean portal)
Specified by:
sendPortalResults in interface ODBCClientRemote

sendMoveCursor

public void sendMoveCursor(ResultSetImpl rs,
                           int rowCount,
                           ResultsFuture<java.lang.Integer> results)
Specified by:
sendMoveCursor in interface ODBCClientRemote

sendResults

public void sendResults(java.lang.String sql,
                        ResultSetImpl rs,
                        java.util.List<PGUtil.PgColInfo> cols,
                        ResultsFuture<java.lang.Integer> result,
                        boolean describeRows)
Specified by:
sendResults in interface ODBCClientRemote

sendUpdateCount

public void sendUpdateCount(java.lang.String sql,
                            int updateCount)
Specified by:
sendUpdateCount in interface ODBCClientRemote

statementClosed

public void statementClosed()
Specified by:
statementClosed in interface ODBCClientRemote

terminated

public void terminated()
Specified by:
terminated in interface ODBCClientRemote

flush

public void flush()
Specified by:
flush in interface ODBCClientRemote

emptyQueryReceived

public void emptyQueryReceived()
Specified by:
emptyQueryReceived in interface ODBCClientRemote

sendCommandComplete

public void sendCommandComplete(java.lang.String sql,
                                int updateCount)
Specified by:
sendCommandComplete in interface ODBCClientRemote

escapeQuote

public static void escapeQuote(java.io.Writer sb,
                               java.lang.String s)
                        throws java.io.IOException
Throws:
java.io.IOException

sendSslResponse

public void sendSslResponse()
Specified by:
sendSslResponse in interface ODBCClientRemote

sendPortalSuspended

public void sendPortalSuspended()
Specified by:
sendPortalSuspended in interface ODBCClientRemote

functionCallResponse

public void functionCallResponse(byte[] data)
Specified by:
functionCallResponse in interface ODBCClientRemote

functionCallResponse

public void functionCallResponse(int data)
Specified by:
functionCallResponse in interface ODBCClientRemote


Copyright © 2011. All Rights Reserved.