net.cnri.dobj
Class DOClientConnection

java.lang.Object
  extended by net.cnri.dobj.DOConnection
      extended by net.cnri.dobj.DOClientConnection

public class DOClientConnection
extends DOConnection

This class provides the interface for client software to communicate using the DO protocol with a specific digital object server.


Field Summary
 
Fields inherited from class net.cnri.dobj.DOConnection
CONTROL_CHANNEL_ID, DEBUG, DEBUG_BLOCKING, DEBUG_BUFFERS, DEBUG_BYTES, DEBUG_CONTROL, DEFAULT_DEBUG, DEFAULT_DEBUG_BLOCKING, DEFAULT_DEBUG_BYTES, DEFAULT_DEBUG_CONTROL, DEFAULT_READ_BUFFER_SIZE, DEFAULT_WRITE_BUFFER_SIZE, ERROR_RESPONSE_CODE, MAX_BYTES_IN_BLOCKING_WINDOW, MIN_BYTES_IN_BLOCKING_WINDOW, SUCCESS_RESPONSE_CODE
 
Constructor Summary
DOClientConnection(DOAuthentication authentication)
          Instantiate a new DOClientConnection with the specified identity and authentication information.
 
Method Summary
 void connect(DOServerInfo server)
          Connect directly to the given server.
 void connect(java.lang.String serverHandle)
          Connect directly to one of the servers in the service identified by the given identifier.
 DOServerInfo getServerInfo()
          If connected to a server, return the information for the server to which we are connected
 java.lang.String getServiceID()
          If connected to a service by identifier, return that identifier
 DOServiceInfo getServiceInfo()
          If connected to ta service, return the service information
 StreamPair performOperation(java.lang.String objectID, java.lang.String operationID)
          Submit a new operation on a new channel and return an InputStream from which the results of the operation can be read.
 StreamPair performOperation(java.lang.String objectID, java.lang.String operationID, HeaderSet operationParameters)
          Submit a new operation on a new channel and return an InputStream from which the results of the operation can be read.
 void reconnect(java.lang.String serverHandle)
          Connect directly to one of a the servers in the service identified by the given identifier, if we aren't already connected.
 void setUseEncryption(boolean encrypt)
          Sets whether or not this connection will be encrypted.
 
Methods inherited from class net.cnri.dobj.DOConnection
close, decodeUTF8, decodeUTF8, encodeUTF8, getAuthID, getProtocolMajorVersion, getProtocolMinorVersion, getResolver, getSocket, isEncrypted, isOpen, resolvePublicKeys, setListener, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DOClientConnection

public DOClientConnection(DOAuthentication authentication)
                   throws DOException
Instantiate a new DOClientConnection with the specified identity and authentication information.

Throws:
DOException
Method Detail

getServiceID

public java.lang.String getServiceID()
If connected to a service by identifier, return that identifier


getServiceInfo

public DOServiceInfo getServiceInfo()
If connected to ta service, return the service information


getServerInfo

public DOServerInfo getServerInfo()
If connected to a server, return the information for the server to which we are connected


setUseEncryption

public void setUseEncryption(boolean encrypt)
Sets whether or not this connection will be encrypted. This has no effect on the current connection if the encryption/authentication handshake has already taken place.


reconnect

public final void reconnect(java.lang.String serverHandle)
                     throws DOException
Connect directly to one of a the servers in the service identified by the given identifier, if we aren't already connected.

Throws:
DOException

connect

public final void connect(java.lang.String serverHandle)
                   throws DOException
Connect directly to one of the servers in the service identified by the given identifier.

Throws:
DOException

connect

public final void connect(DOServerInfo server)
                   throws DOException
Connect directly to the given server. This is used when a connection to a specific server is necessary. Clients should generally use the other connect() methods that only specify the service ID.

Throws:
DOException

performOperation

public StreamPair performOperation(java.lang.String objectID,
                                   java.lang.String operationID)
                            throws DOException
Submit a new operation on a new channel and return an InputStream from which the results of the operation can be read.

Throws:
DOException

performOperation

public StreamPair performOperation(java.lang.String objectID,
                                   java.lang.String operationID,
                                   HeaderSet operationParameters)
                            throws DOException
Submit a new operation on a new channel and return an InputStream from which the results of the operation can be read.

Throws:
DOException