Class SFSBannedUserManager
- java.lang.Object
-
- com.smartfoxserver.v2.core.service.BaseCoreService
-
- com.smartfoxserver.v2.entities.managers.SFSBannedUserManager
-
- All Implemented Interfaces:
com.smartfoxserver.bitswarm.service.IService
,com.smartfoxserver.v2.core.ICoreService
,com.smartfoxserver.v2.entities.managers.IBannedUserManager
public final class SFSBannedUserManager extends com.smartfoxserver.v2.core.service.BaseCoreService implements com.smartfoxserver.v2.entities.managers.IBannedUserManager
-
-
Constructor Summary
Constructors Constructor Description SFSBannedUserManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
banUser(User userToBan, User modUser, int durationMinutes, BanMode mode, java.lang.String reason, java.lang.String banMessage, int delaySeconds)
void
banUser(java.lang.String userName, java.lang.String zoneName, int durationMinutes, BanMode mode, java.lang.String reason)
void
banUser(java.lang.String userName, java.lang.String zoneName, int durationMinutes, BanMode mode, java.lang.String reason, java.lang.String adminName)
void
destroy(java.lang.Object o)
Destroy serviceBannedUser
getBannedUserByIp(java.lang.String ipAddress)
BannedUser
getBannedUserByName(java.lang.String zoneName, java.lang.String userName)
java.util.List<BannedUser>
getBannedUsersByIp()
java.util.List<BannedUser>
getBannedUsersByName(java.lang.String zoneName)
int
getKickCount(java.lang.String name, java.lang.String zoneName, int rangeInSeconds)
Calculates how many times a user has been kicked in the last amount of time passed in the second argument and expressed in seconds.void
init(java.lang.Object o)
Initialize serviceboolean
isAutoRemoveBan()
boolean
isIpBanned(java.lang.String ipAddress)
boolean
isNameBanned(java.lang.String userName, java.lang.String zoneName)
boolean
isPersistent()
void
kickUser(User userToKick, User modUser, java.lang.String kickMessage, int delaySeconds)
void
kickUser(User userToKick, User modUser, java.lang.String kickMessage, int delaySeconds, boolean isBan)
void
removeBannedUser(java.lang.String id, java.lang.String zoneName, BanMode mode)
void
sendWarningMessage(User recipient, User senderMod, java.lang.String message)
void
setAutoRemoveBan(boolean flag)
void
setPersistenceClass(java.lang.String className)
void
setPersistent(boolean flag)
-
Methods inherited from class com.smartfoxserver.v2.core.service.BaseCoreService
getId, getName, handleMessage, isActive, setName, toString
-
-
-
-
Method Detail
-
init
public void init(java.lang.Object o)
Description copied from interface:com.smartfoxserver.bitswarm.service.IService
Initialize service- Specified by:
init
in interfacecom.smartfoxserver.bitswarm.service.IService
- Overrides:
init
in classcom.smartfoxserver.v2.core.service.BaseCoreService
- Parameters:
o
- custom parameters
-
destroy
public void destroy(java.lang.Object o)
Description copied from interface:com.smartfoxserver.bitswarm.service.IService
Destroy service- Specified by:
destroy
in interfacecom.smartfoxserver.bitswarm.service.IService
- Overrides:
destroy
in classcom.smartfoxserver.v2.core.service.BaseCoreService
- Parameters:
o
- custom parameters
-
kickUser
public void kickUser(User userToKick, User modUser, java.lang.String kickMessage, int delaySeconds)
- Specified by:
kickUser
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
kickUser
public void kickUser(User userToKick, User modUser, java.lang.String kickMessage, int delaySeconds, boolean isBan)
- Specified by:
kickUser
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
banUser
public void banUser(User userToBan, User modUser, int durationMinutes, BanMode mode, java.lang.String reason, java.lang.String banMessage, int delaySeconds)
- Specified by:
banUser
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
banUser
public void banUser(java.lang.String userName, java.lang.String zoneName, int durationMinutes, BanMode mode, java.lang.String reason, java.lang.String adminName)
- Specified by:
banUser
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
banUser
public void banUser(java.lang.String userName, java.lang.String zoneName, int durationMinutes, BanMode mode, java.lang.String reason)
- Specified by:
banUser
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
getKickCount
public int getKickCount(java.lang.String name, java.lang.String zoneName, int rangeInSeconds)
Calculates how many times a user has been kicked in the last amount of time passed in the second argument and expressed in seconds.- Specified by:
getKickCount
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
- Parameters:
name
- the user namezoneName
- the name of the ZonerangeInSeconds
- the time range in seconds
-
isIpBanned
public boolean isIpBanned(java.lang.String ipAddress)
- Specified by:
isIpBanned
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
isNameBanned
public boolean isNameBanned(java.lang.String userName, java.lang.String zoneName)
- Specified by:
isNameBanned
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
removeBannedUser
public void removeBannedUser(java.lang.String id, java.lang.String zoneName, BanMode mode)
- Specified by:
removeBannedUser
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
getBannedUsersByIp
public java.util.List<BannedUser> getBannedUsersByIp()
- Specified by:
getBannedUsersByIp
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
getBannedUsersByName
public java.util.List<BannedUser> getBannedUsersByName(java.lang.String zoneName)
- Specified by:
getBannedUsersByName
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
getBannedUserByIp
public BannedUser getBannedUserByIp(java.lang.String ipAddress)
- Specified by:
getBannedUserByIp
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
getBannedUserByName
public BannedUser getBannedUserByName(java.lang.String zoneName, java.lang.String userName)
- Specified by:
getBannedUserByName
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
isAutoRemoveBan
public boolean isAutoRemoveBan()
- Specified by:
isAutoRemoveBan
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
isPersistent
public boolean isPersistent()
- Specified by:
isPersistent
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
setAutoRemoveBan
public void setAutoRemoveBan(boolean flag)
- Specified by:
setAutoRemoveBan
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
setPersistent
public void setPersistent(boolean flag)
- Specified by:
setPersistent
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
setPersistenceClass
public void setPersistenceClass(java.lang.String className)
- Specified by:
setPersistenceClass
in interfacecom.smartfoxserver.v2.entities.managers.IBannedUserManager
-
-