Class SFSInvitationManager

  • All Implemented Interfaces:
    com.smartfoxserver.bitswarm.service.IService, InvitationManager

    public class SFSInvitationManager
    extends java.lang.Object
    implements com.smartfoxserver.bitswarm.service.IService, InvitationManager
    • Field Detail

      • serviceName

        protected java.lang.String serviceName
      • log

        protected final org.slf4j.Logger log
      • invitationsById

        protected final java.util.Map<java.lang.Integer,​Invitation> invitationsById
      • invitationsByOwner

        protected final java.util.Map<User,​java.util.List<Invitation>> invitationsByOwner
      • maxInvitationsPerUser

        protected int maxInvitationsPerUser
    • Constructor Detail

      • SFSInvitationManager

        public SFSInvitationManager()
    • 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
        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
        Parameters:
        o - custom parameters
      • getName

        public java.lang.String getName()
        Description copied from interface: com.smartfoxserver.bitswarm.service.IService
        Get the service name
        Specified by:
        getName in interface com.smartfoxserver.bitswarm.service.IService
        Returns:
        the service name
      • setName

        public void setName​(java.lang.String name)
        Description copied from interface: com.smartfoxserver.bitswarm.service.IService
        Set the service name
        Specified by:
        setName in interface com.smartfoxserver.bitswarm.service.IService
        Parameters:
        name - the service name
      • handleMessage

        public void handleMessage​(java.lang.Object o)
        Description copied from interface: com.smartfoxserver.bitswarm.service.IService
        Send message to service
        Specified by:
        handleMessage in interface com.smartfoxserver.bitswarm.service.IService
        Parameters:
        o - the message
      • getMaxInvitationsPerUser

        public int getMaxInvitationsPerUser()
        Specified by:
        getMaxInvitationsPerUser in interface InvitationManager
        Returns:
        the max amount of invitations a User can run simultaneously
      • setMaxInvitationsPerUser

        public void setMaxInvitationsPerUser​(int value)
        Specified by:
        setMaxInvitationsPerUser in interface InvitationManager
        Parameters:
        value - the max amount of invitations a User can run simultaneously
      • initCleanUpTask

        protected void initCleanUpTask()
      • handleAcceptedInvitation

        protected void handleAcceptedInvitation​(Invitation invitation,
                                                ISFSObject params)
      • handleRefusedInvitation

        protected void handleRefusedInvitation​(Invitation invitation,
                                               ISFSObject params)
      • removeInvitation

        protected void removeInvitation​(Invitation invitation)