Interface PushRelayApi

All Known Implementing Classes:
PushRelay

public interface PushRelayApi
The PushRelayApi interface provides prototypes of Moera Push Relay API calls.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    feedStatus(String feedName, int notViewed, long notViewedMoment, String nodeName, long signedAt, byte[] signature)
    Send a message to node's clients about number of new stories in a feed.
    void
    register(String clientId, String nodeName, String lang, long signedAt, byte[] signature)
    Register a client to receive messages from the specified node.
    void
    storyAdded(StoryInfo story, String nodeName, long signedAt, byte[] signature)
    Send a message to node's clients about a new story.
    void
    storyDeleted(String storyId, String nodeName, long signedAt, byte[] signature)
    Send a message to node's clients about deleting a story.
  • Method Details

    • register

      void register(String clientId, String nodeName, String lang, long signedAt, byte[] signature)
      Register a client to receive messages from the specified node. The client will be unregistered automatically if the relay gets an error from the push service indicating that the client cannot receive messages anymore.
      Parameters:
      clientId - ID/token of the target client to receive messages
      nodeName - name of the node that will send messages
      lang - language of the messages (use standard language codes, like "en_US" or "uk")
      signedAt - timestamp of the signature, the signature will be valid 2 minutes after the time specified
      signature - the signature (use Fingerprints.pushRelayRegister(java.lang.String, java.lang.String, java.sql.Timestamp) fingerprint)
    • feedStatus

      void feedStatus(String feedName, int notViewed, long notViewedMoment, String nodeName, long signedAt, byte[] signature)
      Send a message to node's clients about number of new stories in a feed.
      Parameters:
      feedName - name of the feed
      notViewed - number of stories that have not been viewed yet
      notViewedMoment - moment of the oldest non-viewed story
      nodeName - name of the node that is sending the message
      signedAt - timestamp of the signature, the signature will be valid 2 minutes after the time specified
      signature - the signature (use Fingerprints.pushRelayMessage(java.sql.Timestamp) fingerprint)
    • storyAdded

      void storyAdded(StoryInfo story, String nodeName, long signedAt, byte[] signature)
      Send a message to node's clients about a new story.
      Parameters:
      story - the story
      nodeName - name of the node that is sending the message
      signedAt - timestamp of the signature, the signature will be valid 2 minutes after the time specified
      signature - the signature (use Fingerprints.pushRelayMessage(java.sql.Timestamp) fingerprint)
    • storyDeleted

      void storyDeleted(String storyId, String nodeName, long signedAt, byte[] signature)
      Send a message to node's clients about deleting a story.
      Parameters:
      storyId - ID of the story
      nodeName - name of the node that is sending the message
      signedAt - timestamp of the signature, the signature will be valid 2 minutes after the time specified
      signature - the signature (use Fingerprints.pushRelayMessage(java.sql.Timestamp) fingerprint)