public interface IWWClient
Modifier and Type | Interface and Description |
---|---|
static class |
IWWClient.ClientType |
Modifier and Type | Method and Description |
---|---|
void |
authenticate()
Attempt authentication of the WWClient
|
String |
getAppCredentials()
Converts appId and appSecret into required content for Authorization header
|
IWWClient.ClientType |
getClientType()
Getter for ClientType, dependent upon the initialiser user
|
Date |
getExpireDate()
Gets the time the token expires from the
AuthenticationResult |
Object |
getExpiresIn()
Gets the length of time until the token expires from the
AuthenticationResult |
String |
getJWTToken()
Gets JWT token for the user / application from the
AuthenticationResult . |
String |
getResultContent()
Getter for resultContent from relevant endpoint
|
String |
getUserRefreshToken()
Gets the refreshtoken for a user authentication from the
AuthenticationResult |
boolean |
isAuthenticated()
Whether or not authentication has successfully occurred.
|
boolean |
isValid()
Tests whether the
AuthenticationResult is valid |
void |
setResultContent(String resultContent)
Setter for resultContent from relevant endpoint
|
IWWClient.ClientType getClientType()
IWWClient.ClientType.USER
or IWWClient.ClientType.APPLICATON
String getAppCredentials() throws UnsupportedEncodingException
UnsupportedEncodingException
- if the encoding option is not supportedboolean isAuthenticated()
authenticate()
firstvoid authenticate() throws UnsupportedEncodingException, WWException
UnsupportedEncodingException
- Authorization header could not be constructedWWException
- Some other error occurred during authenticationString getJWTToken()
AuthenticationResult
. The JWT token is an expiring token associated with the appId and appSecret. From the documentation: "This JWT
token is what you have to use in your App to pass to Watson Work Services on API calls so that you can use its services securely"String getUserRefreshToken()
AuthenticationResult
Object getExpiresIn()
AuthenticationResult
Date getExpireDate()
AuthenticationResult
boolean isValid()
AuthenticationResult
is validString getResultContent()
void setResultContent(String resultContent)
resultContent
- result content (data / errors) as JSON StringCopyright © 2018 OpenNTF. All rights reserved.