org.apache.jdo.impl.fostore
Interface FOStoreClientConnection

All Superinterfaces:
FOStoreConnection
All Known Implementing Classes:
FOStoreClientConnectionImpl

interface FOStoreClientConnection
extends FOStoreConnection

Represents the connection as seen by the client. This contains two types of interface: that used by the ConnectionFactory, and that used by the Message. It provides a means for managing the data sent and received from the store, as well as for being managed in a pool.

Author:
Dave Bristor

Method Summary
 void close()
          Put this connection back into the connection pool managed by the ConnectionFactory.
 void closeDatabase()
          Close the database associated with this connection.
 void connect()
          Connect to the data source.
 FOStoreConnectionFactory getConnectionFactory()
          Get the connection Factory used to create this connection.
 FOStoreConnectionId getConnectionId()
          Get the connection id used to create this connection.
 java.io.DataInput getInputFromServer()
          Provides DataInput from which the client can read replies from the server.
 void sendToStore(byte[] buffer, int start, int length)
          Indicates that the client has finished writing.
 void setConnectionFactory(FOStoreConnectionFactory connectionFactory)
          Set the connection id used to create this connection.
 void setConnectionId(FOStoreConnectionId connectionId)
          Set the connection id used to create this connection.
 

Method Detail

connect

public void connect()
             throws java.io.IOException
Connect to the data source.

Throws:
java.io.IOException

getInputFromServer

public java.io.DataInput getInputFromServer()
                                     throws java.io.IOException
Provides DataInput from which the client can read replies from the server.

Returns:
DataInput from which the client can read replies.
Throws:
java.io.IOException

sendToStore

public void sendToStore(byte[] buffer,
                        int start,
                        int length)
                 throws java.io.IOException
Indicates that the client has finished writing. The data is sent to the server and processed there.

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Put this connection back into the connection pool managed by the ConnectionFactory.

Throws:
java.io.IOException

setConnectionId

public void setConnectionId(FOStoreConnectionId connectionId)
Set the connection id used to create this connection. This is used to determine which connection pool is used.


getConnectionId

public FOStoreConnectionId getConnectionId()
Get the connection id used to create this connection. Connections are pooled based on this connection id.


setConnectionFactory

public void setConnectionFactory(FOStoreConnectionFactory connectionFactory)
Set the connection id used to create this connection. This is used to determine which connection pool is used.


getConnectionFactory

public FOStoreConnectionFactory getConnectionFactory()
Get the connection Factory used to create this connection. Connections are pooled based on this connection Factory.


closeDatabase

public void closeDatabase()
                   throws java.io.IOException,
                          FOStoreDatabaseException
Close the database associated with this connection. In the remote case, close the socket.

Throws:
java.io.IOException
FOStoreDatabaseException