gcs
Class GcsGroup

java.lang.Object
  extended by gcs.GcsGroup
Direct Known Subclasses:
SpreadGcsGroup

public abstract class GcsGroup
extends java.lang.Object

Provides an abstraction for the dynamic group.

GcsConnection.getPrivateGroup() method returns the private group for the GcsConnection object if session with group communication system is established.

Client defined by a concrete connection object can join other groups by creating new GcsGroup object and calling join(GcsConnection, String) . Once it is done successfully, all the messages sent through RestGroups to the group client has joined, will be available for him. The leave() method should be called to leave the group.

Author:
tkob

Constructor Summary
protected GcsGroup()
          Default constructor.
 
Method Summary
abstract  boolean equals(java.lang.Object object)
          Returns true if object given by the argument represents the same group as this object, false otherwise.
abstract  void join(GcsConnection connection, java.lang.String name)
          Allows joining group of a given name using specified GcsConnection object.
abstract  void leave()
          Allows leaving the group represented by this object.
abstract  java.lang.String toString()
          Returns the group's name as a string.
abstract  org.jdom.Element toXml()
          Returns the XML representation of the group.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GcsGroup

protected GcsGroup()
Default constructor. Creates empty GcsGroup object.

Method Detail

equals

public abstract boolean equals(java.lang.Object object)
Returns true if object given by the argument represents the same group as this object, false otherwise.

Overrides:
equals in class java.lang.Object
Parameters:
object - object which should be compared with this group object
Returns:
true if objects match, false otherwise

join

public abstract void join(GcsConnection connection,
                          java.lang.String name)
                   throws GcsException
Allows joining group of a given name using specified GcsConnection object.

Parameters:
connection - connection used to communicate with group communication system
name - name of the group to be joined
Throws:
GcsException - if joining group failed

leave

public abstract void leave()
                    throws GcsException
Allows leaving the group represented by this object.

Throws:
GcsException - if leaving group failed

toString

public abstract java.lang.String toString()
Returns the group's name as a string.

Overrides:
toString in class java.lang.Object

toXml

public abstract org.jdom.Element toXml()
Returns the XML representation of the group.

Returns:
the XML representation of the group