|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IBuddyList
This interface provides access to the Buddy List, Permit List, and Deny Lists. These lists are maintained for the user by the IClient instance, but may be queried for the online presence of the users or for other administrative reasons.
Field Summary | |
---|---|
static int |
BUDDY_LIST
The list type for users we wish to see the status of. |
static int |
DENY_ALL
A permit mode which denies all users. |
static int |
DENY_LIST
The list type for users we do not allow to send us messages. |
static int |
DENY_SOME
A permit mode which denies all users in the Deny List. |
static int |
IGNORE_IN_LIST
Deprecated. Since version 2.4, this permit mode is no longer used. |
static int |
IGNORE_NOT_IN_LIST
Deprecated. Since version 2.4, this permit mode is no longer used. |
static int |
PERMIT_ALL
A permit mode which permits all users. |
static int |
PERMIT_LIST
The list type for users we allow to send us messages. |
static int |
PERMIT_SOME
A permit mode which permits only users in the Permit List. |
static int |
REVERSE_LIST
The list type for users watching our status. |
Method Summary | |
---|---|
boolean |
addBuddyGroup(String name)
Adds a buddy group to this buddy list. |
boolean |
addBuddyToList(String username,
String nickname,
String groupName)
Adds a buddy to the specified group in the list. |
Enumeration |
getAllGroupsForBuddy(IBuddy buddy)
Returns the names of the groups that the specified buddy is a member of. |
Enumeration |
getAllGroupsForBuddy(String buddyName)
Returns the names of the groups that the specified buddy is a member of. |
IBuddy[] |
getBuddies()
Returns the buddies contained in this buddy list. |
Enumeration |
getBuddiesInGroup(String groupName)
Returns the buddies contained in the specified group. |
IBuddy |
getBuddyInGroup(String groupName,
String buddyName)
Returns a reference to the IBuddy object for the specified buddy. |
int |
getGroupCountForBuddyName(String buddyName)
Returns the number of groups that the specified buddy is a member of. |
Enumeration |
getListOfGroups()
Returns the names of the groups that are contained in this list. |
int |
getListType()
Returns this list's type. |
String |
getName()
Returns this list's name. |
int |
getNumberOfBuddiesInGroup(String groupName)
Returns the number of buddies contained in the specified group. |
int |
getNumberOfGroups()
Returns the number of groups in this list. |
int |
getTotalNumberOfBuddiesInList()
Returns the total number of buddies in the list. |
int |
getVersion()
Returns the current version number associated with this Buddy List. |
boolean |
removeBuddyGroup(String name)
Removes the specified buddy group (and the buddies it contains) from this buddy list. |
boolean |
renameBuddyGroup(String name,
String newName)
Renames the specified buddy group. |
void |
setName(String name)
Sets this list's name. |
void |
setVersion(int listVersion)
Sets the version number for this Buddy List. |
Field Detail |
---|
static final int DENY_ALL
No users are allowed to send messages to this client or receive presence
updates from this client.
Other side effects may occur depending on the protocol.
See setPermitMode
for details.
Valid on AIM, JABBER, JSC.
IClient.setPermitMode(int)
,
Constant Field Valuesstatic final int PERMIT_ALL
All users are allowed to send messages to this client or receive presence updates from this client.
Valid on AIM, JABBER, JSC.
IClient.setPermitMode(int)
,
Constant Field Valuesstatic final int PERMIT_SOME
Only users in the Permit List are allowed to send messages to this
client or receive presence updates from this client.
All other users are denied.
Other side effects may occur depending on the protocol.
See setPermitMode
for details.
Valid on AIM, JABBER, JSC, MSN, SAMETIME.
IClient.setPermitMode(int)
,
Constant Field Valuesstatic final int DENY_SOME
Users in the Deny List are not allowed to send messages to this client
or receive presence updates from this client.
Other side effects may occur depending on the protocol.
See setPermitMode
for details.
Valid on all protocols.
IClient.setPermitMode(int)
,
Constant Field Valuesstatic final int IGNORE_IN_LIST
IClient.setPermitMode(int)
,
Constant Field Valuesstatic final int IGNORE_NOT_IN_LIST
IClient.setPermitMode(int)
,
Constant Field Valuesstatic final int BUDDY_LIST
getListType()
,
Constant Field Valuesstatic final int PERMIT_LIST
getListType()
,
Constant Field Valuesstatic final int DENY_LIST
getListType()
,
Constant Field Valuesstatic final int REVERSE_LIST
getListType()
,
Constant Field ValuesMethod Detail |
---|
int getListType()
BUDDY_LIST
,
REVERSE_LIST
,
PERMIT_LIST
,
DENY_LIST
int getVersion()
Valid on MSN.
void setVersion(int listVersion)
This is currently valid for the MSN protocol only. Microsoft Network developers have indicated that good MSN Messenger citizens cache the Buddy Lists locally and set the version prior to connecting. MSN developers don't like to see this ignored because it means their servers must resend the full buddy lists each time your client signs on. Store the version number and lists in a local store such as a database to reduce the volume of messages received with the MSN protocol. Set the version before connecting to the IM server, and MSN will only send the Buddy List information if the server has a more up-to-date version of the Buddy List.
Note: If you avoid having the server send your buddy list, you may not be able to modify it further. Some buddy group information is lost in the process, because it is expected by the server but not supported in this API. Therefore, modifying the buddy list may lead to unspecified results.
String getName()
void setName(String name)
name
- the name you wish to assign to this listboolean addBuddyToList(String username, String nickname, String groupName)
This method should only be used to populate a client buddy list before calling connect().
username
- the buddy's unique namenickname
- the buddy's nicknamegroupName
- The name of the group in this list where you wish to
add the buddy. The group is created if it does not
exist, and it may be null.
IClient.addBuddy(String, String, String)
int getGroupCountForBuddyName(String buddyName)
buddyName
- the buddy's unique nameEnumeration getAllGroupsForBuddy(String buddyName)
buddyName
- the buddy's unique name
Enumeration getAllGroupsForBuddy(IBuddy buddy)
IBuddy[] getBuddies()
Buddies are added to the array in the order in which they are encountered in this buddy list. Each buddy that is contained in more than one buddy group appears only once (it is unique).
Enumeration getBuddiesInGroup(String groupName)
groupName
- the group's name
IBuddy getBuddyInGroup(String groupName, String buddyName)
groupName
- the name of the group which contains the buddybuddyName
- the buddy's unique nameEnumeration getListOfGroups()
int getNumberOfBuddiesInGroup(String groupName)
groupName
- the group's nameint getNumberOfGroups()
int getTotalNumberOfBuddiesInList()
boolean addBuddyGroup(String name) throws IOException
AIM and ICQ clients must call sendConfigToServer() for the changes to be saved to the server.
JABBER, JSC, and YIM don't currently save buddy groups on the server unless the groups contain at least one buddy.
name
- the buddy group's name
IOException
- if there is a problem communicating with the serverIClient.sendConfigToServer()
boolean removeBuddyGroup(String name) throws IOException
AIM and ICQ clients must call sendConfigToServer() for the changes to be saved to the server.
name
- the buddy group's name
IOException
- if there is a problem communicating with the serverIClient.sendConfigToServer()
boolean renameBuddyGroup(String name, String newName) throws IOException
AIM and ICQ clients must call sendConfigToServer() for the changes to be saved to the server.
JSC does not support renaming groups on the buddy list.
name
- the buddy group's current namenewName
- the buddy group's new name. This must not be equal to
another buddy group's name in this buddy list.
IOException
- if there is a problem communicating with the serverIClient.sendConfigToServer()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |