Class ProviderManager


  • public class ProviderManager
    extends java.lang.Object
    • Method Detail

      • getCurrentConnections

        public java.util.concurrent.ConcurrentHashMap<java.lang.String,​java.util.Set<DeviceToken>> getCurrentConnections()
      • initProtocolProperties

        public void initProtocolProperties​(Channel channel)
        set protocol properties from channel properties, not done before because channel may not be initialized when the servlet initializes
        Parameters:
        channel - the channel instance
      • isEnabled

        public boolean isEnabled()
      • getInstanceCount

        public java.util.concurrent.atomic.AtomicInteger getInstanceCount()
      • getMaximumProcessDuration

        public java.lang.Integer getMaximumProcessDuration()
      • getKeepAliveDelay

        public java.lang.Integer getKeepAliveDelay()
      • getRetryValue

        public java.lang.Integer getRetryValue()
      • getDelayBetweenNotificationCheck

        public java.lang.Integer getDelayBetweenNotificationCheck()
      • getMaximumInstancePerMember

        public java.lang.Integer getMaximumInstancePerMember()
      • acquire

        public boolean acquire()
        Acquire a connection
        Returns:
        true if the connection has been acquired, false if limits are reached
      • release

        public void release()
        Release a connection
      • addDevice

        public DeviceToken addDevice​(Member loggedMember,
                                     java.lang.String deviceId,
                                     javax.servlet.http.HttpServletRequest request)
                              throws TooManyDeviceException
        add a device to connection map
        Parameters:
        loggedMember - the Member
        deviceId - the deviceId
        request - the HttpServletRequest used to get remote IP
        Returns:
        the DeviceToken returned if the device can be added.
        Throws:
        TooManyDeviceException - exception thrown if maximum of existing connection (with another device id) is reached
      • cleanConnections

        public void cleanConnections()
        Clean old connections in connection map
      • removeAuthorization

        public void removeAuthorization​(java.lang.Object runningAuthorization)
      • isAuthorized

        public boolean isAuthorized​(java.lang.Object runningAuthorization)