Interface TokenApi
-
- All Known Implementing Classes:
TokenApiImpl
public interface TokenApiAPI for creating and verifying Tokens used for new Notifications
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tokencreate(NotificationTokenRequestRepresentation tokenRequest)Creates new access Token.Tokenrefresh(Token token)Refreshes an expired Token.voidunsubscribe(Token token)Unsubscribe a subscriber using supplied Token.TokenClaimsverify(Token token)Verifies supplied Token.
-
-
-
Method Detail
-
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
TokenClaims verify(Token token) throws SDKException
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
Token refresh(Token token) throws IllegalArgumentException, SDKException
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
void unsubscribe(Token token) throws SDKException
Unsubscribe a subscriber using supplied Token.- Parameters:
token-- Throws:
SDKException
-
-