javax.rad.remote
Interface IConnection

All Known Implementing Classes:
AbstractSerializedConnection, DirectObjectConnection, DirectServerConnection, HttpConnection

public interface IConnection

The IConnection interface defines all methods for the communication between client and server.


Field Summary
static int COMPRESSION_BYTES
          the max. bytes for uncompressed communication (more bytes switches to compressed mode).
static int FLAG_ACKNOWLEDGE
          the acknowledge flag.
static int FLAG_BROKEN
          the broken flag.
static int FLAG_ESTABLISHED
          the established flag.
static java.lang.String MET_SESSION_CREATE
          Constant for the session create method.
static java.lang.String MET_SESSION_DESTROY
          Constant for the session destroy method.
static java.lang.String MET_SESSION_GET_PROPERTIES
          Constant for the get properties method.
static java.lang.String MET_SESSION_GET_PROPERTY
          Constant for the get property method.
static java.lang.String MET_SESSION_SET_NEW_PASSWORD
          Constant for the set new password method.
static java.lang.String MET_SESSION_SET_PROPERTY
          Constant for the set property method.
static java.lang.String MET_SESSION_SETCHECKALIVE
          Constant for the set and check of the session alive state.
static java.lang.String MET_SESSION_SUBSESSION_CREATE
          Constant for the sub session create method.
static int MODE_COMPRESSED
          Constant type for compressed communication.
static int MODE_UNCOMPRESSED
          Constant type for uncompressed communication.
static java.lang.Object[] NOPARAMETER
          the null(no) parameter array.
static java.lang.String OBJ_SESSION
          Constant for the internal session handler.
static byte TYPE_CALL_ERROR
          Constant type for exception return values.
static byte TYPE_CALL_RESULT
          Constant type for return values from remote method calls.
static byte TYPE_CALLBACK_ERROR
          Constant type for failed callback remote method calls.
static byte TYPE_CALLBACK_RESULT
          Constant type for successful callback remote method calls.
static byte TYPE_CALLBACKRESULT_RESULT
          Constant type for failed callback remote method calls.
static byte TYPE_PROPERTY_RESULT
          Constant type for properties from the server.
 
Method Summary
 void addCallBackResultListener(ICallBackResultListener pListener)
          Adds an ICallBackResultListener to the list of registered listeners.
 void addPropertyChangedListener(IConnectionPropertyChangedListener pListener)
          Adds an IConnectionPropertyChangedListener to the list of registered listeners.
 java.lang.Object[] call(ConnectionInfo pConnectionInfo, java.lang.String[] pObjectName, java.lang.String[] pMethod, java.lang.Object[][] pParams, ICallBackListener[] pCallBack)
          Calls desired methods from a remote server object.
 void close(ConnectionInfo pConnectionInfo)
          Close the connection to the server.
 java.util.Hashtable<java.lang.String,java.lang.Object> getProperties(ConnectionInfo pConnectionInfo)
          Gets a clone of all connection properties.
 java.lang.Object getProperty(ConnectionInfo pConnectionInfo, java.lang.String pName)
          Gets a connection property.
 boolean isCalling()
          Gets whether a call is active.
 boolean isOpen(ConnectionInfo pConnectionInfo)
          Checks if the connection to the server is opened.
 void open(ConnectionInfo pConnectionInfo)
          Opens the connection to the server.
 void openSub(ConnectionInfo pConnectionInfo, ConnectionInfo pConnectionInfoSub)
          Opens a new sub connection.
 void removeCallBackResultListener(ICallBackResultListener pListener)
          Removes an ICallBackResultListener from the list of registered listeners.
 void removePropertyChangedListener(IConnectionPropertyChangedListener pListener)
          Removes an IConnectionPropertyChangedListener from the list of registered listeners.
 ConnectionInfo[] setAndCheckAlive(ConnectionInfo pConnectionInfo, ConnectionInfo[] pSubConnections)
          Sets the alive state for a connection, on the server, and validates the alive state of subconnections.
 void setNewPassword(ConnectionInfo pConnectionInfo, java.lang.String pOldPassword, java.lang.String pNewPassword)
          Sets a new password for the connected user.
 void setProperty(ConnectionInfo pConnectionInfo, java.lang.String pName, java.lang.Object pValue)
          Sets a connection property.
 

Field Detail

COMPRESSION_BYTES

static final int COMPRESSION_BYTES
the max. bytes for uncompressed communication (more bytes switches to compressed mode).

See Also:
Constant Field Values

MODE_UNCOMPRESSED

static final int MODE_UNCOMPRESSED
Constant type for uncompressed communication.

See Also:
Constant Field Values

MODE_COMPRESSED

static final int MODE_COMPRESSED
Constant type for compressed communication.

See Also:
Constant Field Values

FLAG_ACKNOWLEDGE

static final int FLAG_ACKNOWLEDGE
the acknowledge flag.

See Also:
Constant Field Values

FLAG_ESTABLISHED

static final int FLAG_ESTABLISHED
the established flag.

See Also:
Constant Field Values

FLAG_BROKEN

static final int FLAG_BROKEN
the broken flag.

See Also:
Constant Field Values

TYPE_CALLBACK_RESULT

static final byte TYPE_CALLBACK_RESULT
Constant type for successful callback remote method calls.

See Also:
Constant Field Values

TYPE_CALLBACK_ERROR

static final byte TYPE_CALLBACK_ERROR
Constant type for failed callback remote method calls.

See Also:
Constant Field Values

TYPE_CALL_RESULT

static final byte TYPE_CALL_RESULT
Constant type for return values from remote method calls.

See Also:
Constant Field Values

TYPE_CALL_ERROR

static final byte TYPE_CALL_ERROR
Constant type for exception return values.

See Also:
Constant Field Values

TYPE_PROPERTY_RESULT

static final byte TYPE_PROPERTY_RESULT
Constant type for properties from the server.

See Also:
Constant Field Values

TYPE_CALLBACKRESULT_RESULT

static final byte TYPE_CALLBACKRESULT_RESULT
Constant type for failed callback remote method calls.

See Also:
Constant Field Values

OBJ_SESSION

static final java.lang.String OBJ_SESSION
Constant for the internal session handler.

See Also:
Constant Field Values

MET_SESSION_CREATE

static final java.lang.String MET_SESSION_CREATE
Constant for the session create method.

See Also:
Constant Field Values

MET_SESSION_SUBSESSION_CREATE

static final java.lang.String MET_SESSION_SUBSESSION_CREATE
Constant for the sub session create method.

See Also:
Constant Field Values

MET_SESSION_DESTROY

static final java.lang.String MET_SESSION_DESTROY
Constant for the session destroy method.

See Also:
Constant Field Values

MET_SESSION_SET_PROPERTY

static final java.lang.String MET_SESSION_SET_PROPERTY
Constant for the set property method.

See Also:
Constant Field Values

MET_SESSION_GET_PROPERTY

static final java.lang.String MET_SESSION_GET_PROPERTY
Constant for the get property method.

See Also:
Constant Field Values

MET_SESSION_GET_PROPERTIES

static final java.lang.String MET_SESSION_GET_PROPERTIES
Constant for the get properties method.

See Also:
Constant Field Values

MET_SESSION_SETCHECKALIVE

static final java.lang.String MET_SESSION_SETCHECKALIVE
Constant for the set and check of the session alive state.

See Also:
Constant Field Values

MET_SESSION_SET_NEW_PASSWORD

static final java.lang.String MET_SESSION_SET_NEW_PASSWORD
Constant for the set new password method.

See Also:
Constant Field Values

NOPARAMETER

static final java.lang.Object[] NOPARAMETER
the null(no) parameter array.

Method Detail

open

void open(ConnectionInfo pConnectionInfo)
          throws java.lang.Throwable
Opens the connection to the server. The credentials have to be a key/value mapping in the connection information.

Parameters:
pConnectionInfo - the connection information
Throws:
java.lang.Throwable - if the connection can not be established

openSub

void openSub(ConnectionInfo pConnectionInfo,
             ConnectionInfo pConnectionInfoSub)
             throws java.lang.Throwable
Opens a new sub connection. The name of the sub connection has to be a key/value mapping in the sub connection information.

Parameters:
pConnectionInfo - the connection information of the master connection
pConnectionInfoSub - the connection information of the sub connection
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

isOpen

boolean isOpen(ConnectionInfo pConnectionInfo)
Checks if the connection to the server is opened.

Parameters:
pConnectionInfo - the connection information
Returns:
true if the connection is open

close

void close(ConnectionInfo pConnectionInfo)
           throws java.lang.Throwable
Close the connection to the server.

Parameters:
pConnectionInfo - the connection information
Throws:
java.lang.Throwable - if the connection can not be established

call

java.lang.Object[] call(ConnectionInfo pConnectionInfo,
                        java.lang.String[] pObjectName,
                        java.lang.String[] pMethod,
                        java.lang.Object[][] pParams,
                        ICallBackListener[] pCallBack)
                        throws java.lang.Throwable
Calls desired methods from a remote server object.

Parameters:
pConnectionInfo - the connection information
pObjectName - list of server object names/aliases
pMethod - method names which should be called
pParams - parameters for the method calls
pCallBack - callback listeners for asynchronous or null for synchronous calls
Returns:
result list from the remote method calls
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

isCalling

boolean isCalling()
Gets whether a call is active.

Returns:
true if a call is active, false otherwise

setAndCheckAlive

ConnectionInfo[] setAndCheckAlive(ConnectionInfo pConnectionInfo,
                                  ConnectionInfo[] pSubConnections)
                                  throws java.lang.Throwable
Sets the alive state for a connection, on the server, and validates the alive state of subconnections.

Parameters:
pConnectionInfo - the connection information
pSubConnections - the connection information of the sub connections, for the alive validation
Returns:
the invalid/expired sub connections
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

setProperty

void setProperty(ConnectionInfo pConnectionInfo,
                 java.lang.String pName,
                 java.lang.Object pValue)
                 throws java.lang.Throwable
Sets a connection property.

Parameters:
pConnectionInfo - the connection information
pName - the property name
pValue - the value of the property or null to delete the property
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...
java.lang.SecurityException - if it's not allowed to set the property

getProperty

java.lang.Object getProperty(ConnectionInfo pConnectionInfo,
                             java.lang.String pName)
                             throws java.lang.Throwable
Gets a connection property.

Parameters:
pConnectionInfo - the connection information
pName - the property name
Returns:
the value of the property or null if the property is not set
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

setNewPassword

void setNewPassword(ConnectionInfo pConnectionInfo,
                    java.lang.String pOldPassword,
                    java.lang.String pNewPassword)
                    throws java.lang.Throwable
Sets a new password for the connected user.

Parameters:
pConnectionInfo - the connection information
pOldPassword - the old password
pNewPassword - the new password
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

getProperties

java.util.Hashtable<java.lang.String,java.lang.Object> getProperties(ConnectionInfo pConnectionInfo)
                                                                     throws java.lang.Throwable
Gets a clone of all connection properties.

Parameters:
pConnectionInfo - the connection information
Returns:
a Hashtable with property names and values
Throws:
java.lang.Throwable - communication error, security checks, invalid method, ...

addPropertyChangedListener

void addPropertyChangedListener(IConnectionPropertyChangedListener pListener)
Adds an IConnectionPropertyChangedListener to the list of registered listeners.

Parameters:
pListener - the new property changed listener.

removePropertyChangedListener

void removePropertyChangedListener(IConnectionPropertyChangedListener pListener)
Removes an IConnectionPropertyChangedListener from the list of registered listeners.

Parameters:
pListener - the property changed listener to remove

addCallBackResultListener

void addCallBackResultListener(ICallBackResultListener pListener)
Adds an ICallBackResultListener to the list of registered listeners.

Parameters:
pListener - the new callback result listener.

removeCallBackResultListener

void removeCallBackResultListener(ICallBackResultListener pListener)
Removes an ICallBackResultListener from the list of registered listeners.

Parameters:
pListener - the callback result listener to remove


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.