|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.URLConnection
org.apache.jdo.impl.fostore.FOStoreClientConnectionImpl
org.apache.jdo.impl.fostore.FOStoreRemoteConnection
Represents a connection to a store that runs in a JVM separate from that of a client.
This class is public
so that clients can access the value of
DEFAULT_PORT
.
Field Summary | |
private java.io.DataOutputStream |
clientRequests
The DataOutputStream from the socket for requests for the server. |
(package private) FOStoreConnectionFactory |
connectionFactory
|
(package private) FOStoreConnectionId |
connectionId
|
static int |
DEFAULT_PORT
The default port number |
(package private) static org.apache.commons.logging.Log |
logger
Logger |
(package private) Message |
message
Message to handle connection-to-connection messages (login). |
private java.io.DataInput |
serverReplies
The DataInputStream from the socket for replies from the server. |
private java.net.Socket |
socket
The socket used to communicate with the remote server. |
Fields inherited from class java.net.URLConnection |
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches |
Constructor Summary | |
(package private) |
FOStoreRemoteConnection(java.net.URL url)
Creates new FOStoreRemoteConnection |
Method Summary | |
void |
close()
Return this connection to the connection pool. |
void |
closeDatabase()
Close the database associated with this connection. |
void |
connect()
Connect to the data store. |
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. |
protected java.lang.String |
localizePath(java.lang.String path)
|
protected void |
login()
Log in to the datastore. |
void |
sendToStore(byte[] buffer,
int offset,
int length)
Write bytes to the store. |
void |
setConnectionFactory(FOStoreConnectionFactory cf)
Set the connection id used to create this connection. |
void |
setConnectionId(FOStoreConnectionId id)
Set the connection id used to create this connection. |
Methods inherited from class java.net.URLConnection |
addRequestProperty, getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getInputStream, getLastModified, getOutputStream, getPermission, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setRequestProperty, setUseCaches, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DEFAULT_PORT
private java.net.Socket socket
private java.io.DataInput serverReplies
private java.io.DataOutputStream clientRequests
Message message
FOStoreConnectionFactory connectionFactory
FOStoreConnectionId connectionId
static final org.apache.commons.logging.Log logger
Constructor Detail |
FOStoreRemoteConnection(java.net.URL url)
url
- the url of the server.Method Detail |
public void connect() throws java.io.IOException
java.io.IOException
- if a network error occurspublic java.io.DataInput getInputFromServer() throws java.io.IOException
java.io.IOException
- if any problems.public void sendToStore(byte[] buffer, int offset, int length) throws java.io.IOException
buffer
- the data bufferoffset
- the offset within the bufferlength
- the number of bytes to write
java.io.IOException
- if any problems.public void closeDatabase() throws java.io.IOException, FOStoreDatabaseException
java.io.IOException
- if any problems with the socket.
FOStoreDatabaseException
- if any problems with the database (not used here).protected java.lang.String localizePath(java.lang.String path)
localizePath
in class FOStoreClientConnectionImpl
public void close() throws java.io.IOException
close
in interface FOStoreClientConnection
java.io.IOException
protected void login() throws java.io.IOException
java.io.IOException
public void setConnectionFactory(FOStoreConnectionFactory cf)
FOStoreClientConnection
setConnectionFactory
in interface FOStoreClientConnection
public FOStoreConnectionFactory getConnectionFactory()
getConnectionFactory
in interface FOStoreClientConnection
public void setConnectionId(FOStoreConnectionId id)
setConnectionId
in interface FOStoreClientConnection
public FOStoreConnectionId getConnectionId()
getConnectionId
in interface FOStoreClientConnection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |