Class Message
java.lang.Object
de.svenkubiak.jpushover.apis.Message
- All Implemented Interfaces:
API
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEnables HTML in the pushover message Either HTML or monospace can be enabled (optional)Enables HTML in the pushover message Either HTML or monospace can be enabled (optional)push()Sends a message to pushoverSends a message to pushover asynchronouslybooleanvalidate()Sends a validation request to pushover ensuring that the token and user is correct, that there is at least one active device on the account.withCallback(String callback) Callback parameter may be supplied with a publicly-accessible URL that the pushover servers will send a request to when the user has acknowledged your notification.withDevice(String device) Your user's device name to send the message directly to that device, rather than all of the user's devices (optional)withExpire(int expire) Specifies how many seconds your notification will continue to be retried for (every retry seconds).withMessage(String message) Your message (required)withPriority(Priority priority) Priority of the message based on the @see documentation (optional)Sets the host and port for a proxy connection if neededwithRetry(int retry) Specifies how often (in seconds) the Pushover servers will send the same notification to the user.The name of one of the sounds supported by device clients to override the user's default sound choice (optional)withTimestamp(int timestamp) A Unix timestamp of your message's date and time to display to the user, rather than the time your message is received by our API (optional)Your message's title, otherwise your app's name is used (optional)Your application's API token (required)withTTL(int ttl) Adds a ttl to the Pushover messageA supplementary URL to show with your message (optional)withUrlTitle(String urlTitle) A title for your supplementary URL, otherwise just the URL is shown (optional)The user/group key (not e-mail address) of your user (or you), viewable when logged into the @see pushover dashboard (required)
-
Constructor Details
-
Message
public Message()
-
-
Method Details
-
withToken
-
withUser
The user/group key (not e-mail address) of your user (or you), viewable when logged into the @see pushover dashboard (required)- Parameters:
user- The username- Returns:
- Message instance
-
withRetry
Specifies how often (in seconds) the Pushover servers will send the same notification to the user. Only required if priority is set to emergency. (optional)- Parameters:
retry- Number of seconds- Returns:
- Message instance
-
withExpire
Specifies how many seconds your notification will continue to be retried for (every retry seconds). Only required if priority is set to emergency. (optional)- Parameters:
expire- Number of seconds- Returns:
- Message instance
-
withMessage
-
withDevice
-
withTitle
-
withUrl
-
enableMonospace
Enables HTML in the pushover message Either HTML or monospace can be enabled (optional)- Returns:
- Message instance
-
enableHtml
Enables HTML in the pushover message Either HTML or monospace can be enabled (optional)- Returns:
- Message instance
-
withUrlTitle
-
withTimestamp
A Unix timestamp of your message's date and time to display to the user, rather than the time your message is received by our API (optional)- Parameters:
timestamp- The Unix timestamp- Returns:
- Message instance
-
withPriority
Priority of the message based on the @see documentation (optional)- Parameters:
priority- The priority enum- Returns:
- Message instance
-
withSound
-
withCallback
Callback parameter may be supplied with a publicly-accessible URL that the pushover servers will send a request to when the user has acknowledged your notification. Only used if priority is set to emergency. (optional)- Parameters:
callback- The callback URL- Returns:
- Message instance
-
withTTL
Adds a ttl to the Pushover message- Parameters:
ttl- Seconds until this message should be automatically removed from the device. Needs to be positive- Returns:
- Message instance
-
withProxy
-
validate
Sends a validation request to pushover ensuring that the token and user is correct, that there is at least one active device on the account. Requires token parameter Requires user parameter Optional device parameter to check specific device- Returns:
- true if token and user are valid and at least on device is on the account, false otherwise
- Throws:
JPushoverException- on failure
-
push
Sends a message to pushover- Specified by:
pushin interfaceAPI- Returns:
- PushoverResponse instance
- Throws:
JPushoverException- on failure
-
pushAsync
Sends a message to pushover asynchronously- Returns:
- PushoverResponse instance
- Throws:
InterruptedException- if sending the message failsExecutionException- if sending the message fails
-
getValue
-