com.sun.media.jsdt
Interface Session


public abstract interface Session
extends Manageable

The Session interface.

Since:
JSDT 1.0
Version:
1.5 - 19th April 1999
Author:
Rich Burridge

Fields inherited from class java.io.Serializable
serialVersionUID
 
Method Summary
 void addSessionListener(SessionListener listener)
           add the specified Session listener to receive Session events for this Session.
 boolean byteArrayExists(java.lang.String byteArrayName)
           checks if a Bytearray with this name exists.
 boolean byteArrayManaged(java.lang.String byteArrayName)
           checks if the Bytearray with this name is managed.
 boolean channelExists(java.lang.String channelName)
           checks if a Channel with this name exists.
 boolean channelManaged(java.lang.String channelName)
           checks if the Channel with this name is managed.
 void close()
          Deprecated. As of JSDT 1.5, the preferred way to do this is via the close(boolean closeConnection) method, setting closeConnection to false.
 void close(boolean closeConnection)
           closes the session, rendering the session handle invalid.
 ByteArray createByteArray(Client client, java.lang.String byteArrayName, boolean autoJoin)
           creates a shared ByteArray with the given name which can then be used with the various ByteArray operations.
 ByteArray createByteArray(Client client, java.lang.String byteArrayName, byte[] value, boolean autoJoin)
          Deprecated. This method is inconsistent with the way Sessions, Channels and Tokens are created. As of JSDT 1.5, the preferred way to do this is via the createByteArray(Client client, String byteArrayName, boolean autoJoin) method, and then use the ByteArray.setValue(Client client, byte[] value) method, to set the initial value.
 ByteArray createByteArray(Client client, java.lang.String byteArrayName, byte[] value, ByteArrayManager byteArrayManager)
          Deprecated. This method is inconsistent with the way Sessions, Channels and Tokens are created. As of JSDT 1.5, the preferred way to do this is via the createByteArray(Client client, String byteArrayName, ByteArrayManager byteArrayManager) method, and then use the ByteArray.setValue(Client client, byte[] value) method, to set the initial value.
 ByteArray createByteArray(Client client, java.lang.String byteArrayName, byte[] value, int offset, int length, boolean autoJoin)
          Deprecated. This method is inconsistent with the way Sessions, Channels and Tokens are created. As of JSDT 1.5, the preferred way to do this is via the createByteArray(Client client, String byteArrayName, boolean autoJoin) method, and then use the ByteArray.setValue(Client client, byte[] value, int offset, int length method, to set the initial value.
 ByteArray createByteArray(Client client, java.lang.String byteArrayName, byte[] value, int offset, int length, ByteArrayManager byteArrayManager)
          Deprecated. This method is inconsistent with the way Sessions, Channels and Tokens are created. As of JSDT 1.5, the preferred way to do this is via the createByteArray(Client client, String byteArrayName, ByteArrayManager byteArrayManager) method, and then use the ByteArray.setValue(Client client, byte[] value, int offset, int length method, to set the initial value.
 ByteArray createByteArray(Client client, java.lang.String byteArrayName, ByteArrayManager byteArrayManager)
           creates a shared ByteArray with the given name which can then be used with the various ByteArray operations.
 Channel createChannel(Client client, java.lang.String channelName, boolean reliable, boolean ordered, boolean autoJoin)
           creates a Channel with the given name which can then be used with the various Channel operations.
 Channel createChannel(Client client, java.lang.String channelName, boolean reliable, boolean ordered, ChannelManager channelManager)
           creates a Channel with the given name which can then be used with the various Channel operations.
 Token createToken(Client client, java.lang.String tokenName, boolean autoJoin)
           creates a Token with the given name which can then be used with the various Token operations.
 Token createToken(Client client, java.lang.String tokenName, TokenManager tokenManager)
           creates a Token with the given name which can then be used with the various Token operations.
 ByteArray[] getByteArraysJoined(Client client)
           return an array of ByteArrays that this Client has successfully joined.
 Channel[] getChannelsJoined(Client client)
           return an array of Channels that this Client has successfully joined.
 Token[] getTokensJoined(Client client)
           return an array of Tokens that this Client has successfully joined.
 java.lang.String[] listByteArrayNames()
           list the names of the ByteArrays that are known to this Session.
 java.lang.String[] listChannelNames()
           list the names of the Channels that are known to this Session.
 java.lang.String[] listTokenNames()
           list the names of the Tokens that are known to this Session.
 void removeSessionListener(SessionListener listener)
           removes the specified Session listener so that it no longer receives Session events for this Session.
 boolean tokenExists(java.lang.String tokenName)
           checks if a Token with this name exists.
 boolean tokenManaged(java.lang.String tokenName)
           checks if the Token with this name is managed.
 
Methods inherited from interface com.sun.media.jsdt.Manageable
destroy, disableListenerEvents, disableManagerEvents, enableListenerEvents, enableManagerEvents, expel, getName, getSession, invite, isManaged, join, leave, listClientNames
 

Method Detail

createByteArray

public ByteArray createByteArray(Client client,
                                 java.lang.String byteArrayName,
                                 boolean autoJoin)
                          throws ConnectionException,
                                 InvalidClientException,
                                 NameInUseException,
                                 NoSuchSessionException,
                                 NoSuchClientException,
                                 NoSuchHostException,
                                 PermissionDeniedException,
                                 TimedOutException
creates a shared ByteArray with the given name which can then be used with the various ByteArray operations. This ByteArray is then known to the Session. No ByteArrayManager is associated with this ByteArray; any Client which has already joined the Session may freely join this ByteArray.

If a ByteArray with this name already exists, a reference to that ByteArray is returned. If the ByteArray didn't already exist, then it's initial value will be a zero filled byte array, one byte long.

Parameters:
client - a Client that will be used for authentication purposes if this is a managed Session.
byteArrayName - the name to give this ByteArray.
autoJoin - if true, automatically join the ByteArray when it's created.
Returns:
the newly created ByteArray or a local reference to it, if it was already created.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NameInUseException - if a Client with this name is already joined to this ByteArray.
NoSuchSessionException - if this Session doesn't exist.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the remote host associated with this Session doesn't exist.
PermissionDeniedException - if this Client doesn't have permission for this operation.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5

createByteArray

public ByteArray createByteArray(Client client,
                                 java.lang.String byteArrayName,
                                 ByteArrayManager byteArrayManager)
                          throws ConnectionException,
                                 InvalidClientException,
                                 ManagerExistsException,
                                 NameInUseException,
                                 NoSuchSessionException,
                                 NoSuchClientException,
                                 NoSuchHostException,
                                 PermissionDeniedException,
                                 TimedOutException
creates a shared ByteArray with the given name which can then be used with the various ByteArray operations. This ByteArray is then known to the Session. A ByteArrayManager is associated with this ByteArray; Clients are authenticated before they are allowed to join the ByteArray.

The initial value for this newly created ByteArray will be a zero filled byte array, one byte long.

Parameters:
client - a Client that will be used for authentication purposes if this is a managed Session.
byteArrayName - the name to give this ByteArray.
byteArrayManager - the manager of this ByteArray.
Returns:
the newly created managed ByteArray.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
ManagerExistsException - if a manager already exists for this ByteArray.
NameInUseException - if a Client with this name is already joined to this ByteArray.
NoSuchSessionException - if this Session doesn't exist.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the remote host associated with this Session doesn't exist.
PermissionDeniedException - if this Client doesn't have permission for this operation.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5

createByteArray

public ByteArray createByteArray(Client client,
                                 java.lang.String byteArrayName,
                                 byte[] value,
                                 boolean autoJoin)
                          throws ConnectionException,
                                 InvalidClientException,
                                 NameInUseException,
                                 NoSuchSessionException,
                                 NoSuchClientException,
                                 NoSuchHostException,
                                 PermissionDeniedException,
                                 TimedOutException
Deprecated. This method is inconsistent with the way Sessions, Channels and Tokens are created. As of JSDT 1.5, the preferred way to do this is via the createByteArray(Client client, String byteArrayName, boolean autoJoin) method, and then use the ByteArray.setValue(Client client, byte[] value) method, to set the initial value.
creates a shared ByteArray with the given name and value which can then be used with the various ByteArray operations. This ByteArray is then known to the Session. No ByteArrayManager is associated with this ByteArray; any Client which has already joined the Session may freely join this ByteArray.
Parameters:
client - a Client that will be used for authentication purposes if this is a managed Session.
byteArrayName - the name to give this ByteArray.
value - the initial value for the shared ByteArray.
autoJoin - if true, automatically join the ByteArray when it's created.
Returns:
the newly created ByteArray or a local reference to it, if it was already created.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NameInUseException - if a Client with this name is already joined to this ByteArray.
NoSuchSessionException - if this Session doesn't exist.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the remote host associated with this Session doesn't exist.
PermissionDeniedException - if this Client doesn't have permission for this operation.
TimedOutException - if no reply was received for this operation in the given timeout period.

createByteArray

public ByteArray createByteArray(Client client,
                                 java.lang.String byteArrayName,
                                 byte[] value,
                                 ByteArrayManager byteArrayManager)
                          throws ConnectionException,
                                 InvalidClientException,
                                 NoSuchSessionException,
                                 NoSuchClientException,
                                 NoSuchHostException,
                                 PermissionDeniedException,
                                 ManagerExistsException,
                                 TimedOutException
Deprecated. This method is inconsistent with the way Sessions, Channels and Tokens are created. As of JSDT 1.5, the preferred way to do this is via the createByteArray(Client client, String byteArrayName, ByteArrayManager byteArrayManager) method, and then use the ByteArray.setValue(Client client, byte[] value) method, to set the initial value.
creates a ByteArray with the given name and value which can then be used with the various ByteArray operations. This ByteArray is then known to the Session. A ByteArrayManager is associated with this ByteArray; Clients are authenticated before they are allowed to join the ByteArray.
Parameters:
client - a Client that will be used for authentication purposes if this is a managed Session.
byteArrayName - the name of the ByteArray to create.
value - the initial value for the shared ByteArray.
byteArrayManager - the manager of this ByteArray.
Returns:
the newly created managed ByteArray.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NoSuchSessionException - if this Session doesn't exist.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the remote host associated with this Session doesn't exist.
PermissionDeniedException - if this Client doesn't have permission for this operation.
ManagerExistsException - if a manager already exists for this ByteArray.
TimedOutException - if no reply was received for this operation in the given timeout period.

createByteArray

public ByteArray createByteArray(Client client,
                                 java.lang.String byteArrayName,
                                 byte[] value,
                                 int offset,
                                 int length,
                                 boolean autoJoin)
                          throws ConnectionException,
                                 InvalidClientException,
                                 NameInUseException,
                                 NoSuchSessionException,
                                 NoSuchClientException,
                                 NoSuchHostException,
                                 PermissionDeniedException,
                                 TimedOutException
Deprecated. This method is inconsistent with the way Sessions, Channels and Tokens are created. As of JSDT 1.5, the preferred way to do this is via the createByteArray(Client client, String byteArrayName, boolean autoJoin) method, and then use the ByteArray.setValue(Client client, byte[] value, int offset, int length method, to set the initial value.
creates a shared ByteArray with the given name and value which can then be used with the various ByteArray operations. This ByteArray is then known to the Session. No ByteArrayManager is associated with this ByteArray; any Client which has already joined the Session may freely join this ByteArray.
Parameters:
client - a Client that will be used for authentication purposes if this is a managed Session.
byteArrayName - the name to give this ByteArray.
value - the byte array that is the source of the initial new shared ByteArray value.
offset - the initial offset within the byte array.
length - the number of bytes to use.
*autoJoin - if true, automatically join the ByteArray when it's created.
Returns:
the newly created ByteArray or a local reference to it, if it was already created.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NameInUseException - if a Client with this name is already joined to this ByteArray.
NoSuchSessionException - if this Session doesn't exist.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the remote host associated with this Session doesn't exist.
PermissionDeniedException - if this Client doesn't have permission for this operation.
TimedOutException - if no reply was received for this operation in the given timeout period.

createByteArray

public ByteArray createByteArray(Client client,
                                 java.lang.String byteArrayName,
                                 byte[] value,
                                 int offset,
                                 int length,
                                 ByteArrayManager byteArrayManager)
                          throws ConnectionException,
                                 InvalidClientException,
                                 NoSuchSessionException,
                                 NoSuchClientException,
                                 NoSuchHostException,
                                 PermissionDeniedException,
                                 ManagerExistsException,
                                 TimedOutException
Deprecated. This method is inconsistent with the way Sessions, Channels and Tokens are created. As of JSDT 1.5, the preferred way to do this is via the createByteArray(Client client, String byteArrayName, ByteArrayManager byteArrayManager) method, and then use the ByteArray.setValue(Client client, byte[] value, int offset, int length method, to set the initial value.
creates a ByteArray with the given name and value which can then be used with the various ByteArray operations. This ByteArray is then known to the Session. A ByteArrayManager is associated with this ByteArray; Clients are authenticated before they are allowed to join the ByteArray.
Parameters:
client - a Client that will be used for authentication purposes if this is a managed Session.
byteArrayName - the name of the ByteArray to create.
value - the byte array that is the source of the initial new shared ByteArray value.
offset - the initial offset within the byte array.
length - the number of bytes to use.
byteArrayManager - the manager of this ByteArray.
Returns:
the newly created managed ByteArray.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NoSuchSessionException - if this Session doesn't exist.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the remote host associated with this Session doesn't exist.
PermissionDeniedException - if this ByteArray was previously created without a manager attached. You should not be able to add a manager afterwards.
ManagerExistsException - if a manager already exists for this ByteArray.
TimedOutException - if no reply was received for this operation in the given timeout period.

createChannel

public Channel createChannel(Client client,
                             java.lang.String channelName,
                             boolean reliable,
                             boolean ordered,
                             boolean autoJoin)
                      throws ConnectionException,
                             InvalidClientException,
                             NameInUseException,
                             NoSuchSessionException,
                             NoSuchClientException,
                             NoSuchHostException,
                             PermissionDeniedException,
                             TimedOutException
creates a Channel with the given name which can then be used with the various Channel operations. This Channel is then known to the Session. No ChannelManager is associated with this Channel; any Client which has already joined the Session may freely join this Channel.

If a Channel with this name already exists, a reference to that Channel is returned.

Parameters:
client - a client that will be used for authentication purposes if this is a managed session.
channelName - the name to give this channel.
reliable - whether the channel is reliable. In other words whether the channel uses networking technology that reliably delivers data sent over it (such as TCP), or uses unreliable technology, which possibly could lose such data (such as UDP). It does not guarantee to reliably deliver Data messages sent over a Channel.
ordered - whether data sent over the channel is ordered.
autoJoin - if true, automatically join the Channel when it's created.
Returns:
the newly created Channel or a local reference to it, if it was already created.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NameInUseException - if a Client with this name is already joined to this Channel.
NoSuchSessionException - if this Session doesn't exist.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the remote host associated with this Session doesn't exist.
PermissionDeniedException - if this Client doesn't have permission for this operation.
TimedOutException - if no reply was received for this operation in the given timeout period.

createChannel

public Channel createChannel(Client client,
                             java.lang.String channelName,
                             boolean reliable,
                             boolean ordered,
                             ChannelManager channelManager)
                      throws ConnectionException,
                             InvalidClientException,
                             NoSuchSessionException,
                             NoSuchClientException,
                             NoSuchHostException,
                             PermissionDeniedException,
                             ManagerExistsException,
                             TimedOutException
creates a Channel with the given name which can then be used with the various Channel operations. This Channel is then known to the Session. A ChannelManager is associated with this Channel; Clients are authenticated before they are allowed to join the Channel (ie. the equivalent of a private channel).
Parameters:
client - a Client that will be used for authentication purposes if this is a managed Session.
channelName - the name to give this Channel.
reliable - whether the channel is reliable. In other words whether the channel uses networking technology that reliably delivers data sent over it (such as TCP), or uses unreliable technology, which possibly could lose such data (such as UDP). It does not guarantee to reliably deliver Data messages sent over a Channel.
ordered - whether Data sent over the Channel is ordered.
channelManager - the manager for this Channel.
Returns:
the newly created managed Channel.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NoSuchSessionException - if this Session doesn't exist.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the remote host associated with this Session doesn't exist.
PermissionDeniedException - if this Channel was previously created without a manager attached. You should not be able to add a manager afterwards.
ManagerExistsException - if a manager already exists for this Channel.
TimedOutException - if no reply was received for this operation in the given timeout period.

createToken

public Token createToken(Client client,
                         java.lang.String tokenName,
                         boolean autoJoin)
                  throws ConnectionException,
                         InvalidClientException,
                         NameInUseException,
                         NoSuchSessionException,
                         NoSuchClientException,
                         NoSuchHostException,
                         PermissionDeniedException,
                         TimedOutException
creates a Token with the given name which can then be used with the various Token operations. This Token is then known to the session. No TokenManager is associated with this Token; any Client which has already joined the Session may freely join this Token.

If a Token with this name already exists, a reference to that Token is returned.

Parameters:
client - a Client that will be used for authentication purposes if this is a managed Session.
tokenName - the name to give this Token.
autoJoin - if true, automatically join the Token when it's created.
Returns:
the newly created Token or a local reference to it, if it was already created.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NameInUseException - if a Client with this name is already joined to this Token.
NoSuchSessionException - if this Session doesn't exist.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the remote host associated with this Session doesn't exist.
PermissionDeniedException - if this Client doesn't have permission for this operation.
TimedOutException - if no reply was received for this operation in the given timeout period.

createToken

public Token createToken(Client client,
                         java.lang.String tokenName,
                         TokenManager tokenManager)
                  throws ConnectionException,
                         InvalidClientException,
                         NoSuchSessionException,
                         NoSuchClientException,
                         NoSuchHostException,
                         PermissionDeniedException,
                         ManagerExistsException,
                         TimedOutException
creates a Token with the given name which can then be used with the various Token operations. This Token is then known to the Session. A TokenManager is associated with this Token; Clients are authenticated before they are allowed to join the Token (ie. the equivalent of a private Token).
Parameters:
client - a Client that will be used for authentication purposes if this is a managed Session.
tokenName - the name of the Token to create.
tokenManager - the manager of this Token.
Returns:
the newly created managed Token.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NoSuchSessionException - if this Session doesn't exist.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the remote host associated with this Session doesn't exist.
PermissionDeniedException - if this Token was previously created without a manager attached. You should not be able to add a manager afterwards.
ManagerExistsException - if a manager already exists for this Token.
TimedOutException - if no reply was received for this operation in the given timeout period.

byteArrayExists

public boolean byteArrayExists(java.lang.String byteArrayName)
                        throws ConnectionException,
                               NoSuchSessionException,
                               TimedOutException
checks if a Bytearray with this name exists.
Parameters:
byteArrayName - the name of the ByteArray to check on.
Returns:
true if a ByteArray with this name exists; false if it doesn't.
Throws:
ConnectionException - if a connection error occured.
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

channelExists

public boolean channelExists(java.lang.String channelName)
                      throws ConnectionException,
                             NoSuchSessionException,
                             TimedOutException
checks if a Channel with this name exists.
Parameters:
channelName - the name of the Channel to check on.
Returns:
true if a Channel with this name exists; false if it doesn't.
Throws:
ConnectionException - if a connection error occured.
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

tokenExists

public boolean tokenExists(java.lang.String tokenName)
                    throws ConnectionException,
                           NoSuchSessionException,
                           TimedOutException
checks if a Token with this name exists.
Parameters:
tokenName - the name of the Token to check on.
Returns:
true if a Token with this name exists; false if it doesn't.
Throws:
ConnectionException - if a connection error occured.
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

byteArrayManaged

public boolean byteArrayManaged(java.lang.String byteArrayName)
                         throws ConnectionException,
                                NoSuchByteArrayException,
                                NoSuchSessionException,
                                TimedOutException
checks if the Bytearray with this name is managed.
Parameters:
byteArrayName - the name of the ByteArray to check on.
Returns:
true if the ByteArray with this name is managed; false if it isn't.
Throws:
ConnectionException - if a connection error occured.
NoSuchByteArrayException - if the byte array doesn't exist.
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5

channelManaged

public boolean channelManaged(java.lang.String channelName)
                       throws ConnectionException,
                              NoSuchChannelException,
                              NoSuchSessionException,
                              TimedOutException
checks if the Channel with this name is managed.
Parameters:
channelName - the name of the Channel to check on.
Returns:
true if the Channel with this name is managed; false if it isn't.
Throws:
ConnectionException - if a connection error occured.
NoSuchChannelException - if the channel doesn't exist.
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5

tokenManaged

public boolean tokenManaged(java.lang.String tokenName)
                     throws ConnectionException,
                            NoSuchTokenException,
                            NoSuchSessionException,
                            TimedOutException
checks if the Token with this name is managed.
Parameters:
tokenName - the name of the Token to check on.
Returns:
true if the Token with this name is managed; false if it isn't.
Throws:
ConnectionException - if a connection error occured.
NoSuchTokenException - if the token doesn't exist.
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5

getByteArraysJoined

public ByteArray[] getByteArraysJoined(Client client)
                                throws ConnectionException,
                                       InvalidClientException,
                                       NoSuchSessionException,
                                       TimedOutException
return an array of ByteArrays that this Client has successfully joined.
Parameters:
client - the Client to check on.
Returns:
an array of ByteArrays that this Client has successfully joined. This array will be of zero length if this Client has not joined any ByteArrays.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

getChannelsJoined

public Channel[] getChannelsJoined(Client client)
                            throws ConnectionException,
                                   InvalidClientException,
                                   NoSuchSessionException,
                                   TimedOutException
return an array of Channels that this Client has successfully joined.
Parameters:
client - the Client to check on.
Returns:
an array of Channels that this Client has successfully joined. This array will be of zero length if this Client has not joined any Channels.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

getTokensJoined

public Token[] getTokensJoined(Client client)
                        throws ConnectionException,
                               InvalidClientException,
                               NoSuchSessionException,
                               TimedOutException
return an array of Tokens that this Client has successfully joined.
Parameters:
client - the Client to check on.
Returns:
an array of Tokens that this Client has successfully joined. This array will be of zero length if this Client has not joined any Tokens.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

listByteArrayNames

public java.lang.String[] listByteArrayNames()
                                      throws ConnectionException,
                                             NoSuchSessionException,
                                             TimedOutException
list the names of the ByteArrays that are known to this Session.
Returns:
a sorted array of names of the ByteArrays that are known to this Session. This array will be of zero length if there are no ByteArrays created in this Session.
Throws:
ConnectionException - if a connection error occured.
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

listChannelNames

public java.lang.String[] listChannelNames()
                                    throws ConnectionException,
                                           NoSuchSessionException,
                                           TimedOutException
list the names of the Channels that are known to this Session.
Returns:
a sorted array of names of the Channels that are known to this Session. This array will be of zero length if there are no Channels created in this Session.
Throws:
ConnectionException - if a connection error occured.
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

listTokenNames

public java.lang.String[] listTokenNames()
                                  throws ConnectionException,
                                         NoSuchSessionException,
                                         TimedOutException
list the names of the Tokens that are known to this Session.
Returns:
a sorted array of names of the Tokens that are known to this Session. This array will be of zero length if there are no Tokens created in this Session.
Throws:
ConnectionException - if a connection error occured.
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

addSessionListener

public void addSessionListener(SessionListener listener)
                        throws ConnectionException,
                               NoSuchSessionException,
                               TimedOutException
add the specified Session listener to receive Session events for this Session.
Parameters:
listener - the Session listener.
Throws:
ConnectionException - if a connection error occured.
NoSuchSessionException - if this Session doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

removeSessionListener

public void removeSessionListener(SessionListener listener)
                           throws ConnectionException,
                                  NoSuchSessionException,
                                  NoSuchListenerException,
                                  TimedOutException
removes the specified Session listener so that it no longer receives Session events for this Session.
Parameters:
listener - the Session listener.
Throws:
ConnectionException - if a connection error occured.
NoSuchSessionException - if this Session doesn't exist.
NoSuchListenerException - if this SessionListener doesn't exist.
TimedOutException - if no reply was received for this operation in the given timeout period.

close

public void close()
           throws ConnectionException,
                  NoSuchSessionException
Deprecated. As of JSDT 1.5, the preferred way to do this is via the close(boolean closeConnection) method, setting closeConnection to false.
closes the session, rendering the session handle invalid. This method should be called when an applet or application terminates to facilitate the cleanup process. If a client wishes to further participate in this session, then it will need to get a new session handle with SessionFactory.createSession
Throws:
ConnectionException - if a connection error occured.
NoSuchSessionException - if this Session doesn't exist.
Since:
JSDT 1.1

close

public void close(boolean closeConnection)
           throws ConnectionException,
                  NoSuchSessionException
closes the session, rendering the session handle invalid. This method should be called when an applet or application terminates to facilitate the cleanup process. If a client wishes to further participate in this session, then it will need to get a new session handle with SessionFactory.createSession If there are no other Sessions on the same "host:port" as this Session, the underlying connection being used by this applet or application will automatically be closed.
Parameters:
closeConnection - indicates whether the underlying connection used by this applet or application should be forcefully closed. Forcefully closing this connection would automatically render all references to other Sessions on the "host:port" being used by this Session as invalid.
Throws:
ConnectionException - if a connection error occured.
NoSuchSessionException - if this Session doesn't exist.
Since:
JSDT 1.5