public class AccessToken extends java.lang.Object implements CodeFetcher
Some of the node APIs requires access token when handling request.
| Constructor and Description |
|---|
AccessToken(ServiceEndpoint endpoint,
DataStorage storage,
BridgeHandler bridge)
Create the access token by service end point, data storage, and bridge handler.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
fetch()
Fetch the code.
|
java.lang.String |
getCanonicalizedAccessToken()
Get the access token without exception.
|
void |
invalidate()
Invalidate the code for getting the code from remote server.
|
public AccessToken(ServiceEndpoint endpoint, DataStorage storage, BridgeHandler bridge)
endpoint - The service end point.storage - The data storage which is used to save the access token.bridge - The bridge handle is used for caller to do sth when getting the access token.public java.lang.String getCanonicalizedAccessToken()
public java.lang.String fetch()
throws NodeRPCException
CodeFetcherfetch in interface CodeFetcherNodeRPCException - The exception shows the error returned by hive node.public void invalidate()
CodeFetcherinvalidate in interface CodeFetcher