|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.cnri.dobj.DOConnection
public class DOConnection
This class encapsulates the connection to a digital object server. A connection comprises a multiplexed set of channels, each channel being a pair of input/output streams, with one channel being used for controlling the connection (opening new channels, negotiating authentication, etc). The protocol is flexible due to the use of simple text control messages, connection parameter negotiation (protocol version, encryption method, etc).
Field Summary | |
---|---|
static int |
CONTROL_CHANNEL_ID
|
boolean |
DEBUG
|
boolean |
DEBUG_BLOCKING
|
boolean |
DEBUG_BYTES
|
boolean |
DEBUG_CONTROL
|
static boolean |
DEFAULT_DEBUG
|
static boolean |
DEFAULT_DEBUG_BLOCKING
|
static boolean |
DEFAULT_DEBUG_BYTES
|
static boolean |
DEFAULT_DEBUG_CONTROL
|
static int |
DEFAULT_READ_BUFFER_SIZE
|
static int |
DEFAULT_WRITE_BUFFER_SIZE
|
static java.lang.String |
ERROR_RESPONSE_CODE
|
static long |
MAX_BYTES_IN_BLOCKING_WINDOW
|
static long |
MIN_BYTES_IN_BLOCKING_WINDOW
|
static java.lang.String |
SUCCESS_RESPONSE_CODE
|
Constructor Summary | |
---|---|
DOConnection(DOAuthentication authentication)
|
Method Summary | |
---|---|
void |
close()
|
static java.lang.String |
decodeUTF8(byte[] buf)
Decode a UTF8 byte array into a String |
static java.lang.String |
decodeUTF8(byte[] buf,
int offset,
int len)
Decode a UTF8 byte array into a String |
static byte[] |
encodeUTF8(java.lang.String str)
Encode a String into a UTF8 byte array |
java.lang.String |
getAuthID()
Return the identifier that we are using to identify ourself |
int |
getProtocolMajorVersion()
Return the major protocol version of this connection if the connection handshake has already taken place. |
int |
getProtocolMinorVersion()
Return the minor protocol version of this connection if the connection handshake has already taken place. |
static net.handle.hdllib.Resolver |
getResolver()
Returns a singleton Resolver object. |
java.net.Socket |
getSocket()
Returns the socket over which the connection is made |
boolean |
isEncrypted()
Returns true iff this connection is encrypted in some way. |
boolean |
isOpen()
Returns true iff the connection is still open |
java.security.PublicKey[] |
resolvePublicKeys(java.lang.String clientID)
Securely resolve a public key for the given handle |
void |
setListener(DOConnectionListener newListener)
Sets the listener that will be notified when new channels are opened. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CONTROL_CHANNEL_ID
public static final boolean DEFAULT_DEBUG_BYTES
public static final boolean DEFAULT_DEBUG_CONTROL
public static final boolean DEFAULT_DEBUG
public static final boolean DEFAULT_DEBUG_BLOCKING
public static long MAX_BYTES_IN_BLOCKING_WINDOW
public static long MIN_BYTES_IN_BLOCKING_WINDOW
public boolean DEBUG
public boolean DEBUG_CONTROL
public boolean DEBUG_BYTES
public boolean DEBUG_BLOCKING
public static final int DEFAULT_WRITE_BUFFER_SIZE
public static final int DEFAULT_READ_BUFFER_SIZE
public static final java.lang.String SUCCESS_RESPONSE_CODE
public static final java.lang.String ERROR_RESPONSE_CODE
Constructor Detail |
---|
public DOConnection(DOAuthentication authentication)
Method Detail |
---|
public int getProtocolMajorVersion()
public int getProtocolMinorVersion()
public final java.lang.String getAuthID()
public java.security.PublicKey[] resolvePublicKeys(java.lang.String clientID)
public boolean isEncrypted()
public boolean isOpen()
public void setListener(DOConnectionListener newListener)
public void close() throws java.io.IOException
java.io.IOException
public java.net.Socket getSocket()
public static final byte[] encodeUTF8(java.lang.String str)
public static final java.lang.String decodeUTF8(byte[] buf, int offset, int len)
public static final java.lang.String decodeUTF8(byte[] buf)
public static final net.handle.hdllib.Resolver getResolver()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |