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 StringAPPLICATION_NAMEstatic StringCLIENT_ENCODINGstatic StringDEFAULT_APPLICATION_NAMEstatic StringDEFAULT_ENCODINGstatic StringSSL_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 voidauthenticationGSSContinue(byte[] serviceToken)voidauthenticationSucess(int processId, int screctKey)voidbindComplete()voidemptyQueryReceived()voiderrorOccurred(String msg)voiderrorOccurred(Throwable t)static voidescapeQuote(Writer sb, String s)voidflush()voidfunctionCallResponse(Object data, boolean binary)StringgetClientEncoding()static StringgetCompletionTag(String sql, Integer... count)CharsetgetEncoding()voidinitialized(Properties props)voidprepareCompleted(String preparedName)voidready(boolean inTransaction, boolean failedTransaction)booleansecureData()voidsendCommandComplete(String sql, Integer... count)voidsendParameterDescription(int[] paramType)voidsendParameterStatus(String param, String value)voidsendPortalSuspended()voidsendResults(String sql, ResultSetImpl rs, List<PGUtil.PgColInfo> cols, ResultsFuture<Integer> result, ODBCClientRemote.CursorDirection direction, int rowCount, boolean describeRows, short[] resultColumnFormat)voidsendResultSetDescription(List<PGUtil.PgColInfo> cols, short[] resultColumnFormat)voidsendSslResponse()voidsetEncoding(String value, boolean init)voidstatementClosed()voidterminated()voiduseAuthenticationGSS()voiduseClearTextAuthentication()voidwrite(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:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.netty.channel.ChannelOutboundHandlerAdapter- Throws:
Exception
-
initialized
public void initialized(Properties props)
- Specified by:
initializedin interfaceODBCClientRemote
-
useClearTextAuthentication
public void useClearTextAuthentication()
- Specified by:
useClearTextAuthenticationin interfaceODBCClientRemote
-
useAuthenticationGSS
public void useAuthenticationGSS()
- Specified by:
useAuthenticationGSSin interfaceODBCClientRemote
-
authenticationGSSContinue
public void authenticationGSSContinue(byte[] serviceToken)
- Specified by:
authenticationGSSContinuein interfaceODBCClientRemote
-
authenticationSucess
public void authenticationSucess(int processId, int screctKey)- Specified by:
authenticationSucessin interfaceODBCClientRemote
-
prepareCompleted
public void prepareCompleted(String preparedName)
- Specified by:
prepareCompletedin interfaceODBCClientRemote
-
bindComplete
public void bindComplete()
- Specified by:
bindCompletein interfaceODBCClientRemote
-
errorOccurred
public void errorOccurred(String msg)
- Specified by:
errorOccurredin interfaceODBCClientRemote
-
errorOccurred
public void errorOccurred(Throwable t)
- Specified by:
errorOccurredin interfaceODBCClientRemote
-
ready
public void ready(boolean inTransaction, boolean failedTransaction)- Specified by:
readyin interfaceODBCClientRemote
-
setEncoding
public void setEncoding(String value, boolean init)
- Specified by:
setEncodingin interfaceODBCClientRemote
-
getClientEncoding
public String getClientEncoding()
-
getEncoding
public Charset getEncoding()
-
sendParameterDescription
public void sendParameterDescription(int[] paramType)
- Specified by:
sendParameterDescriptionin interfaceODBCClientRemote
-
sendResultSetDescription
public void sendResultSetDescription(List<PGUtil.PgColInfo> cols, short[] resultColumnFormat)
- Specified by:
sendResultSetDescriptionin 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:
sendResultsin interfaceODBCClientRemote
-
statementClosed
public void statementClosed()
- Specified by:
statementClosedin interfaceODBCClientRemote
-
terminated
public void terminated()
- Specified by:
terminatedin interfaceODBCClientRemote
-
flush
public void flush()
- Specified by:
flushin interfaceODBCClientRemote
-
emptyQueryReceived
public void emptyQueryReceived()
- Specified by:
emptyQueryReceivedin interfaceODBCClientRemote
-
sendCommandComplete
public void sendCommandComplete(String sql, Integer... count)
- Specified by:
sendCommandCompletein interfaceODBCClientRemote
-
escapeQuote
public static void escapeQuote(Writer sb, String s) throws IOException
- Throws:
IOException
-
sendSslResponse
public void sendSslResponse()
- Specified by:
sendSslResponsein interfaceODBCClientRemote
-
sendPortalSuspended
public void sendPortalSuspended()
- Specified by:
sendPortalSuspendedin interfaceODBCClientRemote
-
sendParameterStatus
public void sendParameterStatus(String param, String value)
- Specified by:
sendParameterStatusin interfaceODBCClientRemote
-
functionCallResponse
public void functionCallResponse(Object data, boolean binary)
- Specified by:
functionCallResponsein interfaceODBCClientRemote
-
secureData
public boolean secureData()
-
-