|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IConference
Represents a multi-user conference session.
This class preserves the state of a conference, such as its name
(see getName
) or the list of users currently connected to it
(see getBuddies
).
It also allows the client to send messages to the conference and invite
other users to join.
conferenceFactory
.
addListener
.
create
on the conference.
IConference conference = myClient.getConferenceService().conferenceFactory(); conference.addListener(myConferenceListener); conference.create("MyNewRoom");
conferenceFactory
.
addListener
.
join
on the conference (being sure to provide a name).
IConference conference = myClient.getConferenceService().conferenceFactory(); conference.addListener(myConferenceListener); conference.join("SomeonesRoom");
accept
on
that conference.
Example:
IConferenceServiceListener myConferenceServiceListener = new ConferenceServiceAdapter() { public void invitationReceived(ConferenceServiceEvent event) { IConference conference = event.getConference(); System.out.println(event.getBuddy() + " has invited us to join " + conference); try { conference.accept(); } catch (IOException e) { e.printStackTrace(); } } }; myClient.getConferenceService().addListener(myConferenceServiceListener);
Valid for AIM, ICQ, JABBER, LCS, MSN, SAMETIME, YIM.
IConferenceService
,
IConferenceListener
Method Summary | |
---|---|
void |
accept()
Accepts a pending invitation and connects to this conference. |
void |
addListener(IConferenceListener listener)
Enables a listener to receive events from this conference. |
void |
create(String name)
Attempts to create a new conference. |
void |
decline(String message)
Declines a pending invitation to join this conference. |
void |
disconnect()
Disconnects the client from this conference. |
IBuddy[] |
getBuddies()
Returns the buddies (users) currently connected to this conference. |
IBuddy |
getBuddy(String name)
Returns the specified buddy (user) that is connected to this conference. |
IClient |
getClient()
Returns the client this conference is associated with. |
String |
getClientName()
Returns the client's user name in this conference. |
String |
getDisplayName()
Returns this conference's display name. |
String |
getName()
Returns this conference's name. |
String |
getPassword()
Returns this conference's password. |
void |
invite(String[] recipients,
String message)
Invites users to this conference. |
void |
invite(String recipient,
String message)
Invites a user to this conference. |
boolean |
isOnline()
Returns true if the client is successfully connected to this conference. |
boolean |
isPublished()
Returns whether this conference is published (viewable/searchable from a public directory). |
void |
join(String name)
Attempts to join an existing conference. |
void |
removeListener(IConferenceListener listener)
Stops a listener from receiving events from this conference. |
void |
sendIM(String message)
Sends a message of type IM to this conference. |
void |
sendMessage(IMessage message)
Sends a message to this conference. |
void |
setDisplayName(String displayName)
Sets this conference's display name. |
void |
setPassword(String password)
Sets this conference's password. |
void |
setPublished(boolean isPublished)
Sets whether this conference is published (viewable/searchable from a public directory). |
Method Detail |
---|
String getName()
To provide a name to this conference, pass one to either
create
or join
.
Valid for AIM, ICQ, JABBER, SAMETIME, YIM.
String getDisplayName()
Valid for ICQ, JABBER, SAMETIME.
void setDisplayName(String displayName) throws IOException
This method should be called to set the display name before
creating
this conference. However, some protocols
(currently only ICQ
and
JABBER
) allow you to set the conference's display
name while the conference is online, if you have sufficient privileges.
The default display name varies between protocols.
Valid for ICQ, JABBER, SAMETIME.
displayName
- the display name to set. A null or empty string may
be specified, which will cause a default display name to be chosen.
The default name varies between protocols; to see the default, pass
null here, then call getDisplayName()
.
IOException
- if the protocol doesn't support setting the display
name, you do not have sufficient privileges, or some other problem
occurredString getPassword()
void setPassword(String password) throws IOException
This method should be called to set the password before
creating
this conference or joining
an
existing conference. However, some protocols (currently only
ICQ
and JABBER
) allow you to
set the password while the conference is online, if you have sufficient
privileges.
Creating a conference with a password set will require other users to provide the password before being allowed to join.
By default, conferences are NOT password-protected.
Valid for ICQ, JABBER, SAMETIME.
password
- the password you wish to set. Pass an empty value if
you no longer want this conference to be password-protected.
IOException
- if a problem occurredboolean isPublished()
void setPublished(boolean isPublished) throws IOException
This method should be called before creating
this
conference. However, some protocols (currently only
ICQ
and JABBER
) allow you to
set the publish mode while the conference is online, if you have
sufficient privileges.
By default, conferences are NOT published.
Valid for ICQ, JABBER, SAMETIME.
IOException
- if a problem occurredvoid addListener(IConferenceListener listener)
void removeListener(IConferenceListener listener)
void accept() throws IOException
This may only be called if the client was invited to this conference via
the conference service
invitationReceived
event.
IOException
- if there is no pending invitation, or some other
problem occurredvoid decline(String message) throws IOException
This may only be called if the client was invited to this conference via
the conference service
invitationReceived
event.
message
- the reason you are declining
IOException
- if there is no pending invitation, or some other
problem occurredvoid create(String name) throws IOException
This call may fail if the requested conference already exists on the server, depending on the protocol being used.
name
- the name of the conference to create, or null to generate a
random conference name (thus creating a random, dynamic conference).
The syntax of the random name depends on the protocol being used.
Some protocols (currently MSN
, LCS
and YIM
) only support "dynamic" conferences, and
will ignore this value.
IOException
- if the client is not online, is already
connecting/connected to this conference, or some other problem
occurredvoid join(String name) throws IOException
This call will fail if the protocol does not support joining
existing conferences. Some protocols (currenly MSN
LCS
,
and YIM
) only support "dynamic" conferences, which
users must be invited to before they can enter.
name
- the name of the conference to join
IOException
- if the client is not online, is already
connecting/connected to this conference, or some other problem
occurredboolean isOnline()
void disconnect()
IConferenceListener.lostConnection(ConferenceEvent)
IClient getClient()
String getClientName()
Some protocols (currently only ICQ
and
JABBER
) may use different usernames for
conferences than the ones used to connect to the IM server. This method
should be called to discover the client's conference username.
Most protocols use the client's IM username for conferences. For those
protocols, this method will return the same value as
IClient.getName()
.
IBuddy getBuddy(String name)
IBuddy[] getBuddies()
void invite(String recipient, String message) throws IOException
recipient
- the user to invitemessage
- the message to send along with the invitation
IOException
- if this conference is not online, or some other
problem occurredvoid invite(String[] recipients, String message) throws IOException
recipients
- the users to invitemessage
- the message to send along with the invitation
IOException
- if this conference is not online, or some other
problem occurredvoid sendIM(String message) throws IOException
IM
to this conference.
message
- the message contents
IOException
- if this conference is not online, or some other
problem occurredvoid sendMessage(IMessage message) throws IOException
Use IMessageFactory
to create an IMessage
that can
be passed to this method.
Currently only IM
,
AUTO_RESPONSE
,
TYPING
(MSN
and LCS
only), and
TYPING_OFF
(MSN
and LCS
only)
messages are supported by conferences.
message
- the message to send
IOException
- if this conference is not online, or some other
problem occurred
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |