Package org.apache.derby.client.net
Class NetAgent
java.lang.Object
org.apache.derby.client.am.Agent
org.apache.derby.client.net.NetAgent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
(package private) ConnectionReply
(package private) ConnectionRequestInterface
private CcsidManager
private EbcdicCcsidManager
(package private) SqlException
(package private) SqlException
(package private) NetConnection
(package private) NetConnectionReply
(package private) NetConnectionRequest
private NetPackageReply
private NetPackageRequest
private NetResultSetReply
private NetResultSetRequest
private NetStatementReply
private NetStatementRequest
(package private) Typdef
(package private) int
private ConnectionReply
(package private) int
private InputStream
private OutputStream
private Reply
private Request
(package private) ResultSetReply
(package private) ResultSetRequestInterface
(package private) String
(package private) Socket
(package private) StatementReply
(package private) StatementRequestInterface
private int
(package private) int
(package private) Typdef
(package private) Typdef
private Utf8CcsidManager
private boolean
Flag which indicates that a writeChain has been started and data sent to the server.Fields inherited from class org.apache.derby.client.am.Agent
logWriter_
-
Constructor Summary
ConstructorsConstructorDescriptionNetAgent
(NetConnection netConnection, LogWriter logWriter) NetAgent
(NetConnection netConnection, LogWriter netLogWriter, int loginTimeout, String server, int port, int clientSSLMode) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
beginReadChain
(ClientStatement statement) protected void
void
beginWriteChain
(ClientStatement statement) void
void
(package private) void
void
close_()
protected void
void
flush_()
private int
protected int
Returns the current timeout value that is set on the socket.protected void
(package private) void
Marks the agent's write chain as dirty.private void
protected void
resetAgent_
(LogWriter netLogWriter, int loginTimeout, String server, int port) private void
(package private) void
setInputStream
(InputStream inputStream) (package private) void
setOutputStream
(OutputStream outputStream) (package private) void
setSvrcod
(int svrcod) protected void
setTimeout
(int timeout) Specifies the maximum blocking time that should be used when sending and receiving messages.(package private) void
Switches the current CCSID manager to EBCDIC(package private) void
Switches the current CCSID manager to UTF-8(package private) void
private void
private void
Methods inherited from class org.apache.derby.client.am.Agent
accumulateChainBreakingReadExceptionAndThrow, accumulateReadException, checkForExceptions, close, endReadChain, flow, flowOutsideUOW, getLogWriter, loggingEnabled, setBatchedExceptionLabelIndex, setLogWriter
-
Field Details
-
connectionRequest_
ConnectionRequestInterface connectionRequest_ -
statementRequest_
StatementRequestInterface statementRequest_ -
resultSetRequest_
ResultSetRequestInterface resultSetRequest_ -
connectionReply_
ConnectionReply connectionReply_ -
packageReply_
-
statementReply_
StatementReply statementReply_ -
resultSetReply_
ResultSetReply resultSetReply_ -
netConnection_
NetConnection netConnection_ -
request_
-
netConnectionRequest_
NetConnectionRequest netConnectionRequest_ -
netPackageRequest_
-
netStatementRequest_
-
netResultSetRequest_
-
reply_
-
netConnectionReply_
NetConnectionReply netConnectionReply_ -
netPackageReply_
-
netStatementReply_
-
netResultSetReply_
-
socket_
Socket socket_ -
rawSocketInputStream_
-
rawSocketOutputStream_
-
server_
String server_ -
port_
int port_ -
clientSSLMode_
private int clientSSLMode_ -
ebcdicCcsidManager_
-
utf8CcsidManager_
-
currentCcsidManager_
-
typdef_
Typdef typdef_ -
targetTypdef_
Typdef targetTypdef_ -
originalTargetTypdef_
Typdef originalTargetTypdef_ -
svrcod_
private int svrcod_ -
orignalTargetSqlam_
int orignalTargetSqlam_ -
targetSqlam_
int targetSqlam_ -
exceptionOpeningSocket_
SqlException exceptionOpeningSocket_ -
exceptionConvertingRdbnam
SqlException exceptionConvertingRdbnam -
writeChainIsDirty_
private boolean writeChainIsDirty_Flag which indicates that a writeChain has been started and data sent to the server. If true, starting a new write chain will throw a DisconnectException. It is cleared when the write chain is ended.
-
-
Constructor Details
-
NetAgent
- Throws:
SqlException
-
NetAgent
NetAgent(NetConnection netConnection, LogWriter netLogWriter, int loginTimeout, String server, int port, int clientSSLMode) throws SqlException - Throws:
SqlException
-
-
Method Details
-
resetAgent_
protected void resetAgent_(LogWriter netLogWriter, int loginTimeout, String server, int port) throws SqlException - Specified by:
resetAgent_
in classAgent
- Throws:
SqlException
-
setSvrcod
void setSvrcod(int svrcod) -
clearSvrcod
void clearSvrcod() -
getSvrcod
private int getSvrcod() -
flush_
- Specified by:
flush_
in classAgent
- Throws:
DisconnectException
-
close_
- Specified by:
close_
in classAgent
- Throws:
SqlException
-
setTimeout
protected void setTimeout(int timeout) Specifies the maximum blocking time that should be used when sending and receiving messages. The timeout is implemented by using the the underlying socket implementation's timeout support. Note that the support for timeout on sockets is dependent on the OS implementation. For the same reason we ignore any exceptions thrown by the call to the socket layer.- Parameters:
timeout
- The timeout value in seconds. A value of 0 corresponds to infinite timeout.
-
getTimeout
protected int getTimeout()Returns the current timeout value that is set on the socket. Note that the support for timeout on sockets is dependent on the OS implementation. For the same reason we ignore any exceptions thrown by the call to the socket layer.- Returns:
- The timeout value in seconds. A value of 0 corresponds to that no timeout is specified on the socket.
-
sendRequest
- Throws:
DisconnectException
-
getInputStream
-
getCurrentCcsidManager
-
getOutputStream
-
setInputStream
-
setOutputStream
-
throwCommunicationsFailure
- Throws:
DisconnectException
-
markChainBreakingException_
protected void markChainBreakingException_()- Specified by:
markChainBreakingException_
in classAgent
-
checkForChainBreakingException_
- Specified by:
checkForChainBreakingException_
in classAgent
- Throws:
SqlException
-
writeDeferredResetConnection
- Throws:
SqlException
-
markWriteChainAsDirty
void markWriteChainAsDirty()Marks the agent's write chain as dirty. A write chain is dirty when data from it has been sent to the server. A dirty write chain cannot be reset and reused for another request until the remaining data has been sent to the server and the write chain properly ended. Resetting a dirty chain will cause the new request to be appended to the unfinished request already at the server, which will likely lead to cryptic syntax errors. -
verifyWriteChainIsClean
- Throws:
DisconnectException
-
beginWriteChainOutsideUOW
- Specified by:
beginWriteChainOutsideUOW
in classAgent
- Throws:
SqlException
-
beginWriteChain
- Overrides:
beginWriteChain
in classAgent
- Throws:
SqlException
-
endWriteChain
protected void endWriteChain()- Specified by:
endWriteChain
in classAgent
-
readDeferredResetConnection
- Throws:
SqlException
-
beginReadChain
- Overrides:
beginReadChain
in classAgent
- Throws:
SqlException
-
beginReadChainOutsideUOW
- Overrides:
beginReadChainOutsideUOW
in classAgent
- Throws:
SqlException
-
switchToUtf8CcsidMgr
void switchToUtf8CcsidMgr()Switches the current CCSID manager to UTF-8 -
switchToEbcdicMgr
void switchToEbcdicMgr()Switches the current CCSID manager to EBCDIC
-