Package com.jalios.jcms.push.servlet
Class ProviderManager
- java.lang.Object
- 
- com.jalios.jcms.push.servlet.ProviderManager
 
- 
 public class ProviderManager extends java.lang.Object
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacquire()Acquire a connectionDeviceTokenaddDevice(Member loggedMember, java.lang.String deviceId, javax.servlet.http.HttpServletRequest request)add a device to connection mapvoidaddPushEventListener(PushEventListener listener)voidcleanConnections()Clean old connections in connection mapjava.util.concurrent.ConcurrentHashMap<java.lang.String,java.util.Set<DeviceToken>>getCurrentConnections()java.lang.IntegergetDelayBetweenNotificationCheck()static ProviderManagergetInstance()java.util.concurrent.atomic.AtomicIntegergetInstanceCount()java.lang.IntegergetKeepAliveDelay()java.lang.IntegergetMaximumInstancePerMember()java.lang.IntegergetMaximumProcessDuration()java.util.LinkedHashSet<PushEventListener>getPushEventListenerSet()java.lang.IntegergetRetryValue()voidinitProtocolProperties(Channel channel)set protocol properties from channel properties, not done before because channel may not be initialized when the servlet initializesbooleanisAuthorized(java.lang.Object runningAuthorization)booleanisEnabled()voidrelease()Release a connectionvoidremoveAuthorization(java.lang.Object runningAuthorization)booleanremovePushEventListener(PushEventListener listener)voidshutdown()voidtriggerPushEvent(PushEvent event)
 
- 
- 
- 
Method Detail- 
getInstancepublic static ProviderManager getInstance() 
 - 
getCurrentConnectionspublic java.util.concurrent.ConcurrentHashMap<java.lang.String,java.util.Set<DeviceToken>> getCurrentConnections() 
 - 
shutdownpublic void shutdown() 
 - 
initProtocolPropertiespublic 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
 
 - 
isEnabledpublic boolean isEnabled() 
 - 
getInstanceCountpublic java.util.concurrent.atomic.AtomicInteger getInstanceCount() 
 - 
getMaximumProcessDurationpublic java.lang.Integer getMaximumProcessDuration() 
 - 
getKeepAliveDelaypublic java.lang.Integer getKeepAliveDelay() 
 - 
getRetryValuepublic java.lang.Integer getRetryValue() 
 - 
getDelayBetweenNotificationCheckpublic java.lang.Integer getDelayBetweenNotificationCheck() 
 - 
getMaximumInstancePerMemberpublic java.lang.Integer getMaximumInstancePerMember() 
 - 
acquirepublic boolean acquire() Acquire a connection- Returns:
- true if the connection has been acquired, false if limits are reached
 
 - 
releasepublic void release() Release a connection
 - 
addDevicepublic 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- HttpServletRequestused to get remote IP
- Returns:
- the DeviceTokenreturned if the device can be added.
- Throws:
- TooManyDeviceException- exception thrown if maximum of existing connection (with another device id) is reached
 
 - 
cleanConnectionspublic void cleanConnections() Clean old connections in connection map
 - 
removeAuthorizationpublic void removeAuthorization(java.lang.Object runningAuthorization) 
 - 
isAuthorizedpublic boolean isAuthorized(java.lang.Object runningAuthorization) 
 - 
addPushEventListenerpublic void addPushEventListener(PushEventListener listener) 
 - 
removePushEventListenerpublic boolean removePushEventListener(PushEventListener listener) 
 - 
getPushEventListenerSetpublic java.util.LinkedHashSet<PushEventListener> getPushEventListenerSet() 
 - 
triggerPushEventpublic void triggerPushEvent(PushEvent event) 
 
- 
 
-