Package org.teiid.transport
Class PgBackendProtocol
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelOutboundHandlerAdapter
-
- org.teiid.transport.PgBackendProtocol
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelOutboundHandler
,ODBCClientRemote
public class PgBackendProtocol extends io.netty.channel.ChannelOutboundHandlerAdapter implements 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 io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Nested classes/interfaces inherited from interface org.teiid.odbc.ODBCClientRemote
ODBCClientRemote.CursorDirection
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_NAME
static String
CLIENT_ENCODING
static String
DEFAULT_APPLICATION_NAME
static String
DEFAULT_ENCODING
static String
SSL_HANDLER_KEY
-
Constructor Summary
Constructors Constructor Description PgBackendProtocol(int maxLobSize, int maxBufferSize, SSLConfiguration config, boolean requireSecure)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
authenticationGSSContinue(byte[] serviceToken)
void
authenticationSucess(int processId, int screctKey)
void
bindComplete()
void
emptyQueryReceived()
void
errorOccurred(String msg)
void
errorOccurred(Throwable t)
static void
escapeQuote(Writer sb, String s)
void
flush()
void
functionCallResponse(Object data, boolean binary)
String
getClientEncoding()
static String
getCompletionTag(String sql, Integer... count)
Charset
getEncoding()
void
initialized(Properties props)
void
prepareCompleted(String preparedName)
void
ready(boolean inTransaction, boolean failedTransaction)
boolean
secureData()
void
sendCommandComplete(String sql, Integer... count)
void
sendParameterDescription(int[] paramType)
void
sendParameterStatus(String param, String value)
void
sendPortalSuspended()
void
sendResults(String sql, ResultSetImpl rs, List<PGUtil.PgColInfo> cols, ResultsFuture<Integer> result, ODBCClientRemote.CursorDirection direction, int rowCount, boolean describeRows, short[] resultColumnFormat)
void
sendResultSetDescription(List<PGUtil.PgColInfo> cols, short[] resultColumnFormat)
void
sendSslResponse()
void
setEncoding(String value, boolean init)
void
statementClosed()
void
terminated()
void
useAuthenticationGSS()
void
useClearTextAuthentication()
void
write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)
-
Methods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, read
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Field Detail
-
APPLICATION_NAME
public static final String APPLICATION_NAME
- See Also:
- Constant Field Values
-
DEFAULT_APPLICATION_NAME
public static final String DEFAULT_APPLICATION_NAME
- See Also:
- Constant Field Values
-
SSL_HANDLER_KEY
public static final String SSL_HANDLER_KEY
- See Also:
- Constant Field Values
-
DEFAULT_ENCODING
public static final String DEFAULT_ENCODING
- See Also:
- Constant Field Values
-
CLIENT_ENCODING
public static final String CLIENT_ENCODING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PgBackendProtocol
public PgBackendProtocol(int maxLobSize, int maxBufferSize, SSLConfiguration config, boolean requireSecure)
-
-
Method Detail
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) throws Exception
- Specified by:
write
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classio.netty.channel.ChannelOutboundHandlerAdapter
- Throws:
Exception
-
initialized
public void initialized(Properties props)
- Specified by:
initialized
in interfaceODBCClientRemote
-
useClearTextAuthentication
public void useClearTextAuthentication()
- Specified by:
useClearTextAuthentication
in interfaceODBCClientRemote
-
useAuthenticationGSS
public void useAuthenticationGSS()
- Specified by:
useAuthenticationGSS
in interfaceODBCClientRemote
-
authenticationGSSContinue
public void authenticationGSSContinue(byte[] serviceToken)
- Specified by:
authenticationGSSContinue
in interfaceODBCClientRemote
-
authenticationSucess
public void authenticationSucess(int processId, int screctKey)
- Specified by:
authenticationSucess
in interfaceODBCClientRemote
-
prepareCompleted
public void prepareCompleted(String preparedName)
- Specified by:
prepareCompleted
in interfaceODBCClientRemote
-
bindComplete
public void bindComplete()
- Specified by:
bindComplete
in interfaceODBCClientRemote
-
errorOccurred
public void errorOccurred(String msg)
- Specified by:
errorOccurred
in interfaceODBCClientRemote
-
errorOccurred
public void errorOccurred(Throwable t)
- Specified by:
errorOccurred
in interfaceODBCClientRemote
-
ready
public void ready(boolean inTransaction, boolean failedTransaction)
- Specified by:
ready
in interfaceODBCClientRemote
-
setEncoding
public void setEncoding(String value, boolean init)
- Specified by:
setEncoding
in interfaceODBCClientRemote
-
getClientEncoding
public String getClientEncoding()
-
getEncoding
public Charset getEncoding()
-
sendParameterDescription
public void sendParameterDescription(int[] paramType)
- Specified by:
sendParameterDescription
in interfaceODBCClientRemote
-
sendResultSetDescription
public void sendResultSetDescription(List<PGUtil.PgColInfo> cols, short[] resultColumnFormat)
- Specified by:
sendResultSetDescription
in interfaceODBCClientRemote
-
sendResults
public void sendResults(String sql, ResultSetImpl rs, List<PGUtil.PgColInfo> cols, ResultsFuture<Integer> result, ODBCClientRemote.CursorDirection direction, int rowCount, boolean describeRows, short[] resultColumnFormat)
- Specified by:
sendResults
in interfaceODBCClientRemote
-
statementClosed
public void statementClosed()
- Specified by:
statementClosed
in interfaceODBCClientRemote
-
terminated
public void terminated()
- Specified by:
terminated
in interfaceODBCClientRemote
-
flush
public void flush()
- Specified by:
flush
in interfaceODBCClientRemote
-
emptyQueryReceived
public void emptyQueryReceived()
- Specified by:
emptyQueryReceived
in interfaceODBCClientRemote
-
sendCommandComplete
public void sendCommandComplete(String sql, Integer... count)
- Specified by:
sendCommandComplete
in interfaceODBCClientRemote
-
escapeQuote
public static void escapeQuote(Writer sb, String s) throws IOException
- Throws:
IOException
-
sendSslResponse
public void sendSslResponse()
- Specified by:
sendSslResponse
in interfaceODBCClientRemote
-
sendPortalSuspended
public void sendPortalSuspended()
- Specified by:
sendPortalSuspended
in interfaceODBCClientRemote
-
sendParameterStatus
public void sendParameterStatus(String param, String value)
- Specified by:
sendParameterStatus
in interfaceODBCClientRemote
-
functionCallResponse
public void functionCallResponse(Object data, boolean binary)
- Specified by:
functionCallResponse
in interfaceODBCClientRemote
-
secureData
public boolean secureData()
-
-