public interface Security extends EventProducer
Modifier and Type | Method and Description |
---|---|
void |
banClient(java.lang.String address,
int duration,
java.lang.String reason)
Ban a client from connecting to the server.
|
void |
checkAccountInfoAccess(Client client)
Throws a UnionSecurityException if the client is not allowed access
to account information.
|
void |
checkAccountListAccess(Client client)
Throws a UnionSecurityException if the client is not allowed access
to the account list.
|
void |
checkAddRole(Client client)
Throws a UnionSecurityException if the client is not allowed to add
roles to clients.
|
void |
checkBan(Client client)
Throws a UnionSecurityException if the client is not allowed to ban addresses.
|
void |
checkBannedListAccess(Client client)
Throws a UnionSecurityException if the client is not allowed access
to the list of the banned addresses.
|
void |
checkClientInfoAccess(Client client)
Throws a UnionSecurityException if the client is not allowed access
to client information (eg.
|
void |
checkClientListAccess(Client client)
Throws a UnionSecurityException if the client is not allowed access
to the client list.
|
void |
checkCreateAccount(Client client)
Throws a UnionSecurityException if the client is not allowed to create
accounts.
|
void |
checkCreateRoom(Client client)
Throws a UnionSecurityException if the client is not allowed to create
rooms.
|
void |
checkJoinRoom(Client client,
Room room)
Throws a UnionSecurityException if the client is not allowed to
join the room.
|
void |
checkKickClient(Client client)
Throws a UnionSecurityException if the client is not allowed to
kick other clients.
|
void |
checkLogin(Client client)
Throws a UnionSecurityException if the client is not allowed to
login.
|
void |
checkLogoff(Client client,
Account account)
Throws a UnionSecurityException if the client is not allowed to
logoff the account.
|
void |
checkModifyAccountAttribute(Client client,
Account account)
Throws a UnionSecurityException if the client is not allowed to
modify the attributes of the account.
|
void |
checkModifyClientAttribute(Client actingClient,
Client targetClient)
Throws a UnionSecurityException if the acting client is not allowed to
modify the attributes of the target client.
|
void |
checkModifyRoomAttribute(Client client,
Room room)
Throws a UnionSecurityException if the client is not allowed to modify
the attributes of the room.
|
void |
checkModifyRoomSetting(Client client,
Room room)
Throws a UnionSecurityException if the client is not allowed to modify
the settings of the room.
|
void |
checkModuleAccess(Client client)
Throws a UnionSecurityException if the client is not allowed access
to the module list and cannot clear the module cache.
|
void |
checkNodeListAccess(Client client)
Throws a UnionSecurityException if the client is not allowed access
to the list of nodes connected to this server.
|
void |
checkRemoveAccount(Client client,
Account account)
Throws a UnionSecurityException if the client is not allowed to remove
an account.
|
void |
checkRemoveRole(Client client)
Throws a UnionSecurityException if the client is not allowed to add
remove roles from clients.
|
void |
checkRemoveRoom(Client client,
Room room)
Throws a UnionSecurityException if the client is not allowed to
remove the room.
|
void |
checkRoomInfoAccess(Client client,
Room room)
Throws a UnionSecurityException if the client is not allowed access
to room information.
|
void |
checkRoomListAccess(Client client)
Throws a UnionSecurityException if the client is not allowed access
to the room list.
|
void |
checkSendMessageToClient(Client client)
Throws a UnionSecurityException if the client is not allowed to send
messages to clients.
|
void |
checkSendMessageToRoom(Client client,
Room room)
Throws a UnionSecurityException if the client is not allowed to send
messages to rooms.
|
void |
checkSendMessageToServer(Client client)
Throws a UnionSecurityException if the client is not allowed to send
messages to the entire server.
|
void |
checkSendRoomModuleMessage(Client client,
Room room)
Throws a UnionSecurityException if the client is not allowed to
send a room module message to the room.
|
void |
checkSendServerModuleMessage(Client client)
Throws a UnionSecurityException if the client is not allowed to
send server module messages.
|
void |
checkServerStatisticsAccess(Client client)
Throws a UnionSecurityException if the client is not allowed access
to the server statistics.
|
void |
checkUnban(Client client)
Throws a UnionSecurityException if the client is not allowed to unban addresses.
|
void |
checkUPCAccess(Client client)
Throws a UnionSecurityException if the client is not allowed access
to UPC stats or to listen to the UPCs being processed on the server.
|
BannedDetails |
getBannedDetails(java.lang.String address)
Returns the banned details for an address.
|
java.util.List<BannedDetails> |
getBannedList()
Return a list of Objects containing information about the banned
addresses.
|
java.util.Set<java.lang.String> |
getConnectRefusalRecipients()
Returns a Set of the recipients that should receive a CONNECTION_REFUSED (u164) if their connection
was refused.
|
boolean |
isBanned(java.lang.String address)
Returns true if the given address is banned.
|
void |
setPermission(SecurityAction action,
SecurityRole... roles)
Gives permission for the given roles to execute the given action.
|
void |
unbanClient(java.lang.String address) |
addEventListener, dispatchEvent, getEventClassMap, removeEventListener
void banClient(java.lang.String address, int duration, java.lang.String reason)
address
- - the address of client to be banned, can be obtained from client.getAddress()duration
- - the duration in seconds the client will be banned for,
use net.user1.union.security.BanInterval.FOREVER for perma ban.reason
- - the reason the client was banned.BanInterval
void unbanClient(java.lang.String address)
address
- - the address of the client that was bannedboolean isBanned(java.lang.String address)
address
- - the address to checkBannedDetails getBannedDetails(java.lang.String address)
address
- - the address to get the banned details forjava.util.List<BannedDetails> getBannedList()
void setPermission(SecurityAction action, SecurityRole... roles)
action
- - the action to give permission toroles
- - the roles allowed to perform the actionvoid checkBan(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkUnban(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkBannedListAccess(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkCreateRoom(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkSendMessageToRoom(Client client, Room room) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkSendMessageToClient(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkSendMessageToServer(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkModifyClientAttribute(Client actingClient, Client targetClient) throws UnionSecurityException
actionClient
- - the client trying to modify the attributetargetClient
- - the client to checkUnionSecurityException
void checkModifyAccountAttribute(Client client, Account account) throws UnionSecurityException
client
- - the client trying to modify the attributeaccount
- - the account being modifiedUnionSecurityException
void checkJoinRoom(Client client, Room room) throws UnionSecurityException
client
- - the client to checkroom
- - the room to joinUnionSecurityException
void checkRemoveRoom(Client client, Room room) throws UnionSecurityException
client
- - the client to checkroom
- - the room to removeUnionSecurityException
void checkModifyRoomSetting(Client client, Room room) throws UnionSecurityException
client
- - the client to checkroom
- - the room which attributes are to be modifiedUnionSecurityException
void checkModifyRoomAttribute(Client client, Room room) throws UnionSecurityException
client
- - the client to checkroom
- - the room which attributes are to be modifiedUnionSecurityException
void checkCreateAccount(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkRemoveAccount(Client client, Account account) throws UnionSecurityException
client
- - the client to checkaccount
- - the account to be removedUnionSecurityException
void checkRoomInfoAccess(Client client, Room room) throws UnionSecurityException
client
- - the client to checkroom
- - the room to observeUnionSecurityException
void checkSendRoomModuleMessage(Client client, Room room) throws UnionSecurityException
client
- - the client to checkroom
- - the room to send the room module message toUnionSecurityException
void checkSendServerModuleMessage(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkClientListAccess(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkRoomListAccess(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkClientInfoAccess(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkKickClient(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkLogin(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkLogoff(Client client, Account account) throws UnionSecurityException
actionClient
- - the client trying to logoff an accounttargetClient
- - the account being logged offUnionSecurityException
void checkAddRole(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkRemoveRole(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkAccountListAccess(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkAccountInfoAccess(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkModuleAccess(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkUPCAccess(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkNodeListAccess(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
void checkServerStatisticsAccess(Client client) throws UnionSecurityException
client
- - the client to checkUnionSecurityException
java.util.Set<java.lang.String> getConnectRefusalRecipients()