Package org.moera.lib.pushrelay
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 TypeMethodDescriptionvoid
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 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
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 messagesnodeName
- name of the node that will send messageslang
- 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 specifiedsignature
- the signature (useFingerprints.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 feednotViewed
- number of stories that have not been viewed yetnotViewedMoment
- moment of the oldest non-viewed storynodeName
- name of the node that is sending the messagesignedAt
- timestamp of the signature, the signature will be valid 2 minutes after the time specifiedsignature
- the signature (useFingerprints.pushRelayMessage(java.sql.Timestamp)
fingerprint)
-
storyAdded
Send a message to node's clients about a new story.- Parameters:
story
- the storynodeName
- name of the node that is sending the messagesignedAt
- timestamp of the signature, the signature will be valid 2 minutes after the time specifiedsignature
- the signature (useFingerprints.pushRelayMessage(java.sql.Timestamp)
fingerprint)
-
storyDeleted
Send a message to node's clients about deleting a story.- Parameters:
storyId
- ID of the storynodeName
- name of the node that is sending the messagesignedAt
- timestamp of the signature, the signature will be valid 2 minutes after the time specifiedsignature
- the signature (useFingerprints.pushRelayMessage(java.sql.Timestamp)
fingerprint)
-