Package com.jalios.jcms.push.servlet
Class ProviderManager
java.lang.Object
com.jalios.jcms.push.servlet.ProviderManager
-
Method Summary
Modifier and TypeMethodDescriptionbooleanacquire()Acquire a connectionaddDevice(Member loggedMember, String deviceId, javax.servlet.http.HttpServletRequest request, boolean isShortLivedDeviceToken) add a device to connection mapvoidaddPushEventListener(PushEventListener listener) voidClean old connections in connection mapstatic ProviderManagervoidinitProtocolProperties(Channel channel) set protocol properties from channel properties, not done before because channel may not be initialized when the servlet initializesbooleanisAuthorized(Object runningAuthorization) booleanvoidrelease()Release a connectionvoidremoveAuthorization(Object runningAuthorization) voidremoveDeviceToken(Member loggedMember, DeviceToken token) remove a device token from connection mapbooleanremovePushEventListener(PushEventListener listener) voidshutdown()voidtriggerPushEvent(PushEvent event)
-
Method Details
-
getInstance
-
getCurrentConnections
-
shutdown
public void shutdown() -
initProtocolProperties
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
-
getMaximumProcessDuration
-
getKeepAliveDelay
-
getRetryValue
-
getDelayBetweenNotificationCheck
-
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- theMemberdeviceId- the deviceIdrequest- theHttpServletRequestused to get remote IPisShortLivedDeviceToken- true is the token is targeted for a short lived stream- Returns:
- the
DeviceTokenreturned if the device can be added. - Throws:
TooManyDeviceException- exception thrown if maximum of existing connection (with another device id) is reached
-
removeDeviceToken
remove a device token from connection map- Parameters:
loggedMember- theMembertoken- theDeviceToken
-
cleanConnections
public void cleanConnections()Clean old connections in connection map -
removeAuthorization
-
isAuthorized
-
addPushEventListener
-
removePushEventListener
-
getPushEventListenerSet
-
triggerPushEvent
-