Class 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
    • Field Summary

      • Fields inherited from class com.smartfoxserver.v2.core.service.BaseCoreService

        active, name
    • 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 service
      BannedUser 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 service
      boolean 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.smartfoxserver.v2.core.ICoreService

        isActive
      • Methods inherited from interface com.smartfoxserver.bitswarm.service.IService

        getName, handleMessage, setName
    • Constructor Detail

      • SFSBannedUserManager

        public SFSBannedUserManager()
    • 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 interface com.smartfoxserver.bitswarm.service.IService
        Overrides:
        init in class com.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 interface com.smartfoxserver.bitswarm.service.IService
        Overrides:
        destroy in class com.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 interface com.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 interface com.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 interface com.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 interface com.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 interface com.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 interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
        Parameters:
        name - the user name
        zoneName - the name of the Zone
        rangeInSeconds - the time range in seconds
      • isIpBanned

        public boolean isIpBanned​(java.lang.String ipAddress)
        Specified by:
        isIpBanned in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • isNameBanned

        public boolean isNameBanned​(java.lang.String userName,
                                    java.lang.String zoneName)
        Specified by:
        isNameBanned in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • removeBannedUser

        public void removeBannedUser​(java.lang.String id,
                                     java.lang.String zoneName,
                                     BanMode mode)
        Specified by:
        removeBannedUser in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • getBannedUsersByIp

        public java.util.List<BannedUser> getBannedUsersByIp()
        Specified by:
        getBannedUsersByIp in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • getBannedUsersByName

        public java.util.List<BannedUser> getBannedUsersByName​(java.lang.String zoneName)
        Specified by:
        getBannedUsersByName in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • getBannedUserByIp

        public BannedUser getBannedUserByIp​(java.lang.String ipAddress)
        Specified by:
        getBannedUserByIp in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • getBannedUserByName

        public BannedUser getBannedUserByName​(java.lang.String zoneName,
                                              java.lang.String userName)
        Specified by:
        getBannedUserByName in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • isAutoRemoveBan

        public boolean isAutoRemoveBan()
        Specified by:
        isAutoRemoveBan in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • isPersistent

        public boolean isPersistent()
        Specified by:
        isPersistent in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • setAutoRemoveBan

        public void setAutoRemoveBan​(boolean flag)
        Specified by:
        setAutoRemoveBan in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • setPersistent

        public void setPersistent​(boolean flag)
        Specified by:
        setPersistent in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • setPersistenceClass

        public void setPersistenceClass​(java.lang.String className)
        Specified by:
        setPersistenceClass in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager
      • sendWarningMessage

        public void sendWarningMessage​(User recipient,
                                       User senderMod,
                                       java.lang.String message)
        Specified by:
        sendWarningMessage in interface com.smartfoxserver.v2.entities.managers.IBannedUserManager