Interface TokenApi
- All Known Implementing Classes:
TokenApiImpl
public interface TokenApi
API for creating and verifying Tokens used for new Notifications
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(NotificationTokenRequestRepresentation tokenRequest) Creates new access Token.Refreshes an expired Token.void
unsubscribe
(Token token) Unsubscribe a subscriber using supplied Token.Verifies supplied Token.
-
Method Details
-
create
Token create(NotificationTokenRequestRepresentation tokenRequest) throws IllegalArgumentException, SDKException Creates new access Token.- Parameters:
tokenRequest
- containing claim - subscriber, subscription and desired validity duration for the Token.- Returns:
- generated Token with JWT Token string
- Throws:
IllegalArgumentException
- if the tokenClaim is nullSDKException
- if the Token could not be created
-
verify
Verifies supplied Token.- Parameters:
token
- to be verified- Returns:
- TokenClaim if the supplied Token was successfully verified
- Throws:
SDKException
- if the Token failed verification or could not be verified
-
refresh
Refreshes an expired Token.- Parameters:
token
- to be refreshed- Returns:
- refreshed Token, valid for the same duration of time as the original Token
- Throws:
IllegalArgumentException
- if the supplied Token is nullSDKException
- if the Token wasn't valid or the operation fails
-
unsubscribe
Unsubscribe a subscriber using supplied Token.- Parameters:
token
-- Throws:
SDKException
-