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) ConnectionRequestInterfaceprivate CcsidManagerprivate EbcdicCcsidManager(package private) SqlException(package private) SqlException(package private) NetConnection(package private) NetConnectionReply(package private) NetConnectionRequestprivate NetPackageReplyprivate NetPackageRequestprivate NetResultSetReplyprivate NetResultSetRequestprivate NetStatementReplyprivate NetStatementRequest(package private) Typdef(package private) intprivate ConnectionReply(package private) intprivate InputStreamprivate OutputStreamprivate Replyprivate Request(package private) ResultSetReply(package private) ResultSetRequestInterface(package private) String(package private) Socket(package private) StatementReply(package private) StatementRequestInterfaceprivate int(package private) int(package private) Typdef(package private) Typdefprivate Utf8CcsidManagerprivate booleanFlag which indicates that a writeChain has been started and data sent to the server.Fields inherited from class 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 voidbeginReadChain(ClientStatement statement) protected voidvoidbeginWriteChain(ClientStatement statement) voidvoid(package private) voidvoidclose_()protected voidvoidflush_()private intprotected intReturns the current timeout value that is set on the socket.protected void(package private) voidMarks the agent's write chain as dirty.private voidprotected voidresetAgent_(LogWriter netLogWriter, int loginTimeout, String server, int port) private void(package private) voidsetInputStream(InputStream inputStream) (package private) voidsetOutputStream(OutputStream outputStream) (package private) voidsetSvrcod(int svrcod) protected voidsetTimeout(int timeout) Specifies the maximum blocking time that should be used when sending and receiving messages.(package private) voidSwitches the current CCSID manager to EBCDIC(package private) voidSwitches the current CCSID manager to UTF-8(package private) voidprivate voidprivate voidMethods inherited from class 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:
beginWriteChainOutsideUOWin classAgent- Throws:
SqlException
-
beginWriteChain
- Overrides:
beginWriteChainin classAgent- Throws:
SqlException
-
endWriteChain
protected void endWriteChain()- Specified by:
endWriteChainin classAgent
-
readDeferredResetConnection
- Throws:
SqlException
-
beginReadChain
- Overrides:
beginReadChainin classAgent- Throws:
SqlException
-
beginReadChainOutsideUOW
- Overrides:
beginReadChainOutsideUOWin classAgent- Throws:
SqlException
-
switchToUtf8CcsidMgr
void switchToUtf8CcsidMgr()Switches the current CCSID manager to UTF-8 -
switchToEbcdicMgr
void switchToEbcdicMgr()Switches the current CCSID manager to EBCDIC
-