AeroGear SimplePush Server API 0.11.0

org.jboss.aerogear.simplepush.server
Interface SimplePushServer


public interface SimplePushServer

A Java implementation of a SimplePush Server.


Method Summary
 SimplePushServerConfig config()
          Returns the configuration for this SimplePush server.
 Set<org.jboss.aerogear.simplepush.protocol.Ack> getUnacknowledged(String uaid)
          Returns all the un-acknowledged notifications for a specific UserAgent.
 Set<org.jboss.aerogear.simplepush.protocol.Ack> handleAcknowledgement(org.jboss.aerogear.simplepush.protocol.AckMessage ackMessage, String uaid)
          Handles the 'ack' message in the SimplePush protocol which is acknowledge a notification.
 org.jboss.aerogear.simplepush.protocol.HelloResponse handleHandshake(org.jboss.aerogear.simplepush.protocol.HelloMessage handshakeMessage)
          Handles the handshake ('hello') message in the SimplePush protocol.
 Notification handleNotification(String endpointToken, String payload)
          Handles the notification for a single channel
 org.jboss.aerogear.simplepush.protocol.RegisterResponse handleRegister(org.jboss.aerogear.simplepush.protocol.RegisterMessage register, String uaid)
          Handles the 'register' message in the SimplePush protocol which is used to register a channel.
 org.jboss.aerogear.simplepush.protocol.UnregisterResponse handleUnregister(org.jboss.aerogear.simplepush.protocol.UnregisterMessage unregisterMessage, String uaid)
          Handles the 'unregister' message in the SimplePush protocol which is used to register a channel.
 void removeAllChannels(String uaid)
          Removes all the channels associated with the UserAgent.
 

Method Detail

handleHandshake

org.jboss.aerogear.simplepush.protocol.HelloResponse handleHandshake(org.jboss.aerogear.simplepush.protocol.HelloMessage handshakeMessage)
Handles the handshake ('hello') message in the SimplePush protocol.

Parameters:
handshakeMessage - the HelloMessage.
Returns:
HelloResponse the handshake response.

handleRegister

org.jboss.aerogear.simplepush.protocol.RegisterResponse handleRegister(org.jboss.aerogear.simplepush.protocol.RegisterMessage register,
                                                                       String uaid)
Handles the 'register' message in the SimplePush protocol which is used to register a channel.

Parameters:
register - the RegisterMessage.
uaid - the UserAgent identifier that this channel will be registered for.
Returns:
RegisterResponse the response for this register message.

handleUnregister

org.jboss.aerogear.simplepush.protocol.UnregisterResponse handleUnregister(org.jboss.aerogear.simplepush.protocol.UnregisterMessage unregisterMessage,
                                                                           String uaid)
Handles the 'unregister' message in the SimplePush protocol which is used to register a channel.

Parameters:
unregisterMessage - the UnregisterMessage.
uaid - the UserAgent identifier that this channel will be unregistered for.
Returns:
UnregisterResponse the response for this register message.

handleAcknowledgement

Set<org.jboss.aerogear.simplepush.protocol.Ack> handleAcknowledgement(org.jboss.aerogear.simplepush.protocol.AckMessage ackMessage,
                                                                      String uaid)
Handles the 'ack' message in the SimplePush protocol which is acknowledge a notification.

Parameters:
ackMessage - the UnregisterMessage.
uaid - the UserAgent identifier that this channel will be unregistered for.
Returns:
Set<Ack> a set of un-acknowledged channel ids.

getUnacknowledged

Set<org.jboss.aerogear.simplepush.protocol.Ack> getUnacknowledged(String uaid)
Returns all the un-acknowledged notifications for a specific UserAgent.

Parameters:
uaid - the UserAgent identifier for which unacked notifications should be retrieved.
Returns:
Set<Ack> a set of un-acknowledged channel ids.

handleNotification

Notification handleNotification(String endpointToken,
                                String payload)
                                throws ChannelNotFoundException
Handles the notification for a single channel

Parameters:
endpointToken - the endpointToken for which this notification belongs
payload - the payload which must be in the format "version=N".
Returns:
NotificationMessage The notification message that should be sent over the network to the UserAgent. The actual communication is left to the underlying implementation.
Throws:
ChannelNotFoundException

removeAllChannels

void removeAllChannels(String uaid)
Removes all the channels associated with the UserAgent.

Parameters:
uaid - the UserAgent Identifier for which all associated channels should be removed.

config

SimplePushServerConfig config()
Returns the configuration for this SimplePush server.

Returns:
SimplePushServerConfig this servers configuration.

AeroGear SimplePush Server API 0.11.0

Copyright © 2014 JBoss by Red Hat. All Rights Reserved.