Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@matzew
Last active December 14, 2015 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzew/c5fbc23bc97dfead46e1 to your computer and use it in GitHub Desktop.
Save matzew/c5fbc23bc97dfead46e1 to your computer and use it in GitHub Desktop.
Functionality for "Sending" and App "registration

The main functionality of sending messages is handled by an implementation of the Sender interface

// TODO....... name.......!!!!
public interface Sender {
    
    /**
     * Sends message to all registered <code>PushApplication</code>s... 
     */
    <T> void sendMessage(T message);
    
    /**
     * Sends message to a specfic <code>PushApplication</code>... 
     */
    <T> void sendMessageToApplication(T message, Application app);

    /**
     * Sends message to a filtered list of <code>PushApplication</code>s... 
     */
    <T> void sendMessageToApplications(T message, List<Application> apps);

    /**
     * Sends message to a specfic <code>MobileApplication</code>... 
     */
    <T> void sendMessageToMobileApplication(T message, MobileApplication app);

    /**
     * Sends message to a filtered list of <code>MobileApplication</code>s... 
     */
    <T> void sendMessageToMobileApplications(T message, List<MobileApplication> apps);
    
    /**
     * Sends message to a specfic device 
     */
    <T> void sendMessageToDevice(T message, MobileApplicationInstance installation);

    /**
     * Sends message to a filtered list of devices 
     */
    <T> void sendMessageToDevices(T message, List<MobileApplicationInstance> installations);
}

The management of the application, it's mobile views etc is handled via the UnifiedPushManager:

/**
 * Manages all "Push applications"
 */
public interface UnifiedPushManager {
    
    /**
     * Adds a <code>PushApplication</code> instance to the Unified Push Server.
     */
    void registerPushApplication(Application pushApplication);
    
    /**
     * Removes a <code>PushApplication</code> instance to the Unified Push Server.
     */
    void unregisterPushApplication(Application pushApplication);
    
    /**
     * Returns a specific <code>PushApplication</code> instance, identified by its
     * applicationKey.
     */
    Application getPushApplication(String applicationKey);
    
    /**
     * List of all registered <code>PushApplication</code>s...
     */
    List<Application> getPushApplications();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment