Class ProviderManager

java.lang.Object
com.jalios.jcms.push.servlet.ProviderManager

public class ProviderManager extends Object
  • Method Details

    • getInstance

      public static ProviderManager getInstance()
    • getCurrentConnections

      public ConcurrentHashMap<String,Set<DeviceToken>> getCurrentConnections()
    • shutdown

      public void shutdown()
    • 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 AtomicInteger getInstanceCount()
    • getMaximumProcessDuration

      public Integer getMaximumProcessDuration()
    • getKeepAliveDelay

      public Integer getKeepAliveDelay()
    • getRetryValue

      public Integer getRetryValue()
    • getDelayBetweenNotificationCheck

      public Integer getDelayBetweenNotificationCheck()
    • getMaximumInstancePerMember

      public 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, String deviceId, javax.servlet.http.HttpServletRequest request, boolean isShortLivedDeviceToken) throws TooManyDeviceException
      add a device to connection map
      Parameters:
      loggedMember - the Member
      deviceId - the deviceId
      request - the HttpServletRequest used to get remote IP
      isShortLivedDeviceToken - true is the token is targeted for a short lived stream
      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
    • removeDeviceToken

      public void removeDeviceToken(Member loggedMember, DeviceToken token)
      remove a device token from connection map
      Parameters:
      loggedMember - the Member
      token - the DeviceToken
    • cleanConnections

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

      public void removeAuthorization(Object runningAuthorization)
    • isAuthorized

      public boolean isAuthorized(Object runningAuthorization)
    • addPushEventListener

      public void addPushEventListener(PushEventListener listener)
    • removePushEventListener

      public boolean removePushEventListener(PushEventListener listener)
    • getPushEventListenerSet

      public LinkedHashSet<PushEventListener> getPushEventListenerSet()
    • triggerPushEvent

      public void triggerPushEvent(PushEvent event)