Interface PushNotificationDelegate
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
SnsHttpDelegate
public interface PushNotificationDelegate extends Closeable
ThePushNotificationServiceis responsible for monitoring configuration changes and detecting when it should create new instances of any givenPushNotificationDelegate. If a configuration change takes place, the service will ascertain whether a new instance is required by callingisRequireNewDelegate(PushNotificationServiceConfig). If a new instance is required, the previous instance will be shutdown by calling theCloseable.close()method before creating a new instance. If a new instance is not required then the existing instance will be updated by callingupdateDelegate(PushNotificationServiceConfig).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<Predicate>getAuthenticationMessagePredicates()Returns a set of authentication message predicates required by this delegate.StringgetAuthServiceLocation()Returns the (public, relative) authentication service location of this delegate - if appropriate.MessageDispatchergetMessageDispatcher()Returns the MessageDispatcher for this delegate.Set<Predicate>getRegistrationMessagePredicates()Returns a set of registration message predicates required by this delegate.StringgetRegServiceLocation()Returns the (public, relative) registration service location of this delegate - if appropriate.booleanisRequireNewDelegate(PushNotificationServiceConfig newConfig)Returns whether or not the new config is so different from the old that the existing delegate should be removed from the pool.voidsend(PushMessage message)Used to send a message out to the PushNotificationDelegate to be delivered.voidstartServices()Starts any required services for this delegate.voidupdateDelegate(PushNotificationServiceConfig newConfig)Updates the existing delegate's config.
-
-
-
Method Detail
-
startServices
void startServices() throws PushNotificationExceptionStarts any required services for this delegate. This may include e.g. listeners to specific ports. This method is called once after a new delegate is generated, but before it is made available for general use by the PushNotificationService.- Throws:
PushNotificationException- if there were any issues starting the service.
-
send
void send(PushMessage message)
Used to send a message out to the PushNotificationDelegate to be delivered.- Parameters:
message- The message to send.
-
isRequireNewDelegate
boolean isRequireNewDelegate(PushNotificationServiceConfig newConfig)
Returns whether or not the new config is so different from the old that the existing delegate should be removed from the pool.- Parameters:
newConfig- The new configuration to check against the old.- Returns:
- True if the configuration change requires the PushNotificationService to instantiate a new instance of this delegate.
-
updateDelegate
void updateDelegate(PushNotificationServiceConfig newConfig)
Updates the existing delegate's config. Implementors must not alter the connection parameters of the delegate, but may alter extraneous information such as values added to static fields in the delegate's communicated messages.- Parameters:
newConfig- The new config from which to update the existing delegate.
-
getRegServiceLocation
String getRegServiceLocation()
Returns the (public, relative) registration service location of this delegate - if appropriate. Otherwise returns null.- Returns:
- The (public, relative) service location of this delegate as exposed to the world, may be relative to the OpenAM server instance ID {@see WebtopNaming}.
-
getAuthServiceLocation
String getAuthServiceLocation()
Returns the (public, relative) authentication service location of this delegate - if appropriate. Otherwise returns null.- Returns:
- The (public, relative) service location of this delegate as exposed to the world, may be relative to the OpenAM server instance ID {@see WebtopNaming}.
-
getRegistrationMessagePredicates
Set<Predicate> getRegistrationMessagePredicates()
Returns a set of registration message predicates required by this delegate. Must return an empty set if there are no predicates to be run.- Returns:
- A set of predicate delegates.
-
getAuthenticationMessagePredicates
Set<Predicate> getAuthenticationMessagePredicates()
Returns a set of authentication message predicates required by this delegate. Must return an empty set if there are no predicates to be run.- Returns:
- A set of predicate delegates.
-
getMessageDispatcher
MessageDispatcher getMessageDispatcher()
Returns the MessageDispatcher for this delegate. Used to get messages back to the originator when returned through a different medium.- Returns:
- The MessageDispatcher for this delegate.
-
-