Top Fields Constructors Methods
org.apache.derby.client.net

public Class NetAgent

extends Agent
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, java.net.Socket, .SocketException, org.apache.derby.client.am.Agent, .DisconnectException, .SqlException, .ClientMessageId, .ClientStatement, .LogWriter, .Utils, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.shared.common.reference.SQLState

Field Summary

Modifier and TypeField and Description
private int
pack-priv ConnectionReply
pack-priv ConnectionRequestInterface
private CcsidManager
private EbcdicCcsidManager
pack-priv SqlException
pack-priv SqlException
pack-priv NetConnection
pack-priv NetConnectionReply
pack-priv NetConnectionRequest
private NetPackageReply
private NetPackageRequest
private NetResultSetReply
private NetResultSetRequest
private NetStatementReply
private NetStatementRequest
pack-priv Typdef
pack-priv int
private ConnectionReply
pack-priv int
private InputStream
private OutputStream
private Reply
private Request
pack-priv ResultSetReply
pack-priv ResultSetRequestInterface
pack-priv String
pack-priv Socket
pack-priv StatementReply
pack-priv StatementRequestInterface
private int
pack-priv int
pack-priv Typdef
pack-priv Typdef
private Utf8CcsidManager
private boolean
writeChainIsDirty_

Flag which indicates that a writeChain has been started and data sent to the server.

Inherited from org.apache.derby.client.am.Agent:
logWriter_

Constructor Summary

AccessConstructor and Description
public
NetAgent(NetConnection netConnection, LogWriter logWriter)

pack-priv
NetAgent(NetConnection netConnection, LogWriter netLogWriter, int loginTimeout, String server, int port, int clientSSLMode)

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
public void
public void
public void
pack-priv void
public void
protected void
public void
public CcsidManager
public InputStream
public OutputStream
private int
protected int

Returns:

The timeout value in seconds. A value of 0 corresponds to that no timeout is specified on the socket.
getTimeout
()

Returns the current timeout value that is set on the socket.

protected void
pack-priv void
markWriteChainAsDirty()

Marks the agent's write chain as dirty.

private void
protected void
resetAgent_(LogWriter netLogWriter, int loginTimeout, String server, int port)

Implements abstract org.apache.derby.client.am.Agent.resetAgent_.

private void
pack-priv void
pack-priv void
pack-priv void
setSvrcod(int svrcod)

protected void
setTimeout(int
The timeout value in seconds. A value of 0 corresponds to infinite timeout.
timeout
)

Specifies the maximum blocking time that should be used when sending and receiving messages.

pack-priv void
switchToEbcdicMgr()

Switches the current CCSID manager to EBCDIC

pack-priv void
switchToUtf8CcsidMgr()

Switches the current CCSID manager to UTF-8

pack-priv void
private void
private void
Inherited from org.apache.derby.client.am.Agent:
accumulateChainBreakingReadExceptionAndThrowaccumulateReadExceptioncheckForExceptionscloseendReadChainflowflowOutsideUOWgetLogWriterloggingEnabledsetBatchedExceptionLabelIndexsetLogWriter

Field Detail

clientSSLMode_back to summary
private int clientSSLMode_
connectionReply_back to summary
pack-priv ConnectionReply connectionReply_
connectionRequest_back to summary
pack-priv ConnectionRequestInterface connectionRequest_
currentCcsidManager_back to summary
private CcsidManager currentCcsidManager_
ebcdicCcsidManager_back to summary
private EbcdicCcsidManager ebcdicCcsidManager_
exceptionConvertingRdbnamback to summary
pack-priv SqlException exceptionConvertingRdbnam
exceptionOpeningSocket_back to summary
pack-priv SqlException exceptionOpeningSocket_
netConnection_back to summary
pack-priv NetConnection netConnection_
netConnectionReply_back to summary
pack-priv NetConnectionReply netConnectionReply_
netConnectionRequest_back to summary
pack-priv NetConnectionRequest netConnectionRequest_
netPackageReply_back to summary
private NetPackageReply netPackageReply_
netPackageRequest_back to summary
private NetPackageRequest netPackageRequest_
netResultSetReply_back to summary
private NetResultSetReply netResultSetReply_
netResultSetRequest_back to summary
private NetResultSetRequest netResultSetRequest_
netStatementReply_back to summary
private NetStatementReply netStatementReply_
netStatementRequest_back to summary
private NetStatementRequest netStatementRequest_
originalTargetTypdef_back to summary
pack-priv Typdef originalTargetTypdef_
orignalTargetSqlam_back to summary
pack-priv int orignalTargetSqlam_
packageReply_back to summary
private ConnectionReply packageReply_
port_back to summary
pack-priv int port_
rawSocketInputStream_back to summary
private InputStream rawSocketInputStream_
rawSocketOutputStream_back to summary
private OutputStream rawSocketOutputStream_
reply_back to summary
private Reply reply_
request_back to summary
private Request request_
resultSetReply_back to summary
pack-priv ResultSetReply resultSetReply_
resultSetRequest_back to summary
pack-priv ResultSetRequestInterface resultSetRequest_
server_back to summary
pack-priv String server_
socket_back to summary
pack-priv Socket socket_
statementReply_back to summary
pack-priv StatementReply statementReply_
statementRequest_back to summary
pack-priv StatementRequestInterface statementRequest_
svrcod_back to summary
private int svrcod_
targetSqlam_back to summary
pack-priv int targetSqlam_
targetTypdef_back to summary
pack-priv Typdef targetTypdef_
typdef_back to summary
pack-priv Typdef typdef_
utf8CcsidManager_back to summary
private Utf8CcsidManager utf8CcsidManager_
writeChainIsDirty_back to summary
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 Detail

NetAgentback to summary
public NetAgent(NetConnection netConnection, LogWriter logWriter) throws SqlException
NetAgentback to summary
pack-priv NetAgent(NetConnection netConnection, LogWriter netLogWriter, int loginTimeout, String server, int port, int clientSSLMode) throws SqlException

Method Detail

beginReadChainback to summary
protected void beginReadChain(ClientStatement statement) throws SqlException

Overrides org.apache.derby.client.am.Agent.beginReadChain.

beginReadChainOutsideUOWback to summary
protected void beginReadChainOutsideUOW() throws SqlException

Overrides org.apache.derby.client.am.Agent.beginReadChainOutsideUOW.

beginWriteChainback to summary
public void beginWriteChain(ClientStatement statement) throws SqlException

Overrides org.apache.derby.client.am.Agent.beginWriteChain.

beginWriteChainOutsideUOWback to summary
public void beginWriteChainOutsideUOW() throws SqlException

Implements abstract org.apache.derby.client.am.Agent.beginWriteChainOutsideUOW.

checkForChainBreakingException_back to summary
public void checkForChainBreakingException_() throws SqlException

Implements abstract org.apache.derby.client.am.Agent.checkForChainBreakingException_.

clearSvrcodback to summary
pack-priv void clearSvrcod()
close_back to summary
public void close_() throws SqlException

Implements abstract org.apache.derby.client.am.Agent.close_.

endWriteChainback to summary
protected void endWriteChain()

Implements abstract org.apache.derby.client.am.Agent.endWriteChain.

flush_back to summary
public void flush_() throws DisconnectException

Implements abstract org.apache.derby.client.am.Agent.flush_.

getCurrentCcsidManagerback to summary
public CcsidManager getCurrentCcsidManager()
getInputStreamback to summary
public InputStream getInputStream()
getOutputStreamback to summary
public OutputStream getOutputStream()
getSvrcodback to summary
private int getSvrcod()
getTimeoutback to summary
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:int

The timeout value in seconds. A value of 0 corresponds to that no timeout is specified on the socket.

markChainBreakingException_back to summary
protected void markChainBreakingException_()

Implements abstract org.apache.derby.client.am.Agent.markChainBreakingException_.

markWriteChainAsDirtyback to summary
pack-priv 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.

readDeferredResetConnectionback to summary
private void readDeferredResetConnection() throws SqlException
resetAgent_back to summary
protected void resetAgent_(LogWriter netLogWriter, int loginTimeout, String server, int port) throws SqlException

Implements abstract org.apache.derby.client.am.Agent.resetAgent_.

sendRequestback to summary
private void sendRequest() throws DisconnectException
setInputStreamback to summary
pack-priv void setInputStream(InputStream inputStream)
setOutputStreamback to summary
pack-priv void setOutputStream(OutputStream outputStream)
setSvrcodback to summary
pack-priv void setSvrcod(int svrcod)
setTimeoutback to summary
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:int

The timeout value in seconds. A value of 0 corresponds to infinite timeout.

switchToEbcdicMgrback to summary
pack-priv void switchToEbcdicMgr()

Switches the current CCSID manager to EBCDIC

switchToUtf8CcsidMgrback to summary
pack-priv void switchToUtf8CcsidMgr()

Switches the current CCSID manager to UTF-8

throwCommunicationsFailureback to summary
pack-priv void throwCommunicationsFailure(Throwable cause) throws DisconnectException
verifyWriteChainIsCleanback to summary
private void verifyWriteChainIsClean() throws DisconnectException
writeDeferredResetConnectionback to summary
private void writeDeferredResetConnection() throws SqlException