hamsam.api
Class Conference

java.lang.Object
  |
  +--hamsam.api.Conference
All Implemented Interfaces:
java.io.Serializable

public class Conference
extends java.lang.Object
implements java.io.Serializable

A conference is a communication mechanism by which more than two buddies can exchange messages with each other.

Not all protocols support conferences. To check whether a protocol supports conferencing, use Protocol.isConferenceSupported() method.

See Also:
Serialized Form

Constructor Summary
Conference(Protocol protocol, Buddy host, Buddy[] buddies)
          Construct a conference.
Conference(Protocol protocol, Buddy host, Buddy[] buddies, java.lang.String message)
          Start a new conference and invite buddies to join.
 
Method Summary
 void addParticipant(Buddy buddy)
          Add a new participant to this conference object.
 Buddy getHost()
          Returns the host buddy for this conference.
 Buddy[] getParticipants()
          Returns all participants for this conference.
 Protocol getProtocol()
          Returns the protocol for this conference.
 void quit()
          Quit from this conference.
 void removeParticipant(Buddy buddy)
          Removes a buddy from this conference object.
 void sendMessage(Message message)
          Send a message to this conference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Conference

public Conference(Protocol protocol,
                  Buddy host,
                  Buddy[] buddies)
           throws UnsupportedOperationException,
                  IllegalArgumentException
Construct a conference. This constructor is meant for internal use by the library and not for the users of Hamsam. You may use Conference(protocol,host, buddies,message) to start a new conference.

Parameters:
protocol - the underlying protocol for this conference.
host - the buddy who is hosting this conference.
buddies - a list of all buddies participating in this conference, including the host.
Throws:
UnsupportedOperationException - if the protocol does not support conferences.
IllegalArgumentException - if the protocol for any of the participants is different from the one specified.

Conference

public Conference(Protocol protocol,
                  Buddy host,
                  Buddy[] buddies,
                  java.lang.String message)
           throws UnsupportedOperationException,
                  IllegalArgumentException,
                  IllegalStateException
Start a new conference and invite buddies to join. This constructor is used to create new conferences.

Parameters:
protocol - the underlying protocol for this conference.
host - the buddy who is hosting this conference.
buddies - a list of all buddies participating in this conference, including the host.
message - the invitation message that is to be sent to the participants.
Throws:
UnsupportedOperationException - if the protocol does not support conferences.
IllegalArgumentException - if the protocol for any of the participants is different from the one specified.
IllegalStateException - if the protocol is not connected yet
Method Detail

quit

public void quit()
          throws UnsupportedOperationException,
                 IllegalStateException
Quit from this conference.

Throws:
UnsupportedOperationException - if the underlying protocol does not support conferences.
IllegalStateException - if the protocol is not connected yet

sendMessage

public void sendMessage(Message message)
                 throws UnsupportedOperationException,
                        IllegalStateException
Send a message to this conference.

Parameters:
message - the message to be sent.
Throws:
UnsupportedOperationException - if the underlying protocol does not support conferences.
IllegalStateException - if the protocol is not connected yet

addParticipant

public void addParticipant(Buddy buddy)
Add a new participant to this conference object. This method is meant for internal use by the library and not for the users of Hamsam.

Parameters:
buddy - the buddy to be added to this conference.

getParticipants

public Buddy[] getParticipants()
Returns all participants for this conference.

Returns:
all participants for this conference.

getHost

public Buddy getHost()
Returns the host buddy for this conference.

Returns:
the host buddy for this conference.

getProtocol

public Protocol getProtocol()
Returns the protocol for this conference.

Returns:
the protocol for this conference.

removeParticipant

public void removeParticipant(Buddy buddy)
Removes a buddy from this conference object. This method is for internal use by Hamsam. As a user of the API, you should never invoke this method. Hamsam does not allow you to block another user from a conference.

Parameters:
buddy - the buddy to be removed.