public class AdminManager extends Object
Modifier and Type | Method and Description |
---|---|
void |
addAdminAccount(org.xmpp.packet.JID jid)
Adds a new account to the list of Admin accounts, based off a JID.
|
void |
addAdminAccount(String username)
Adds a new account to the list of Admin accounts, based off a username, which will be converted
into a JID.
|
void |
clearAdminUsers()
Clears the list of admin users.
|
List<org.xmpp.packet.JID> |
getAdminAccounts()
Returns the list of admin users from the provider.
|
static AdminProvider |
getAdminProvider()
Returns the currently-installed AdminProvider.
|
static AdminManager |
getInstance()
Returns a singleton instance of AdminManager.
|
boolean |
isUserAdmin(org.xmpp.packet.JID jid,
boolean allowAdminIfEmpty)
Returns true if the user is an admin.
|
boolean |
isUserAdmin(String username,
boolean allowAdminIfEmpty)
Returns true if the user is an admin.
|
void |
refreshAdminAccounts()
Refreshs the list of admin users from the provider.
|
void |
removeAdminAccount(org.xmpp.packet.JID jid)
Removes an account from the list of Admin accounts, based off JID.
|
void |
removeAdminAccount(String username)
Removes an account from the list of Admin accounts, based off username, which will be converted
to a JID.
|
void |
setAdminJIDs(List<org.xmpp.packet.JID> jids)
Sets the list of admin users based off of a list of jids.
|
void |
setAdminUsers(List<String> usernames)
Sets the list of admin users based off of a list of usernames.
|
public static AdminProvider getAdminProvider()
public static AdminManager getInstance()
public void refreshAdminAccounts()
public List<org.xmpp.packet.JID> getAdminAccounts()
public void addAdminAccount(String username)
username
- Username of account to add to list of admins.public void addAdminAccount(org.xmpp.packet.JID jid)
jid
- JID of account to add to list of admins.public void removeAdminAccount(String username)
username
- Username of user to remove from admin list.public void removeAdminAccount(org.xmpp.packet.JID jid)
jid
- JID of user to remove from admin list.public boolean isUserAdmin(String username, boolean allowAdminIfEmpty)
username
- Username of user to check whether they are an admin or not.allowAdminIfEmpty
- Allows the "admin" user to log in if the adminList is empty.public boolean isUserAdmin(org.xmpp.packet.JID jid, boolean allowAdminIfEmpty)
jid
- JID of user to check whether they are an admin or not.allowAdminIfEmpty
- Allows the "admin" user to log in if the adminList is empty.public void clearAdminUsers()
public void setAdminUsers(List<String> usernames)
usernames
- List of usernames to set as admins.public void setAdminJIDs(List<org.xmpp.packet.JID> jids)
jids
- List of jids to set as admins.Copyright © 2003-2008 Jive Software.