public class AccessToken extends java.lang.Object implements Token
Token
interface.
An object of this class is used to sign data requests.
Modifier and Type | Field and Description |
---|---|
java.lang.String |
access_token
The access token issued by the authorization server (Read only)
|
int |
expires_in
The lifetime in seconds of the access token (Read only)
|
java.lang.String |
refresh_token
The refresh token which can be used to obtain new access tokens (Read only)
|
java.lang.String |
scope
The scope of the access token (Read only)
|
java.lang.String |
token_type
The type of the token issued by the authorization server (Read only)
|
Constructor and Description |
---|
AccessToken(java.io.DataInputStream in)
creates a token that was serialized before into a stream.
|
Modifier and Type | Method and Description |
---|---|
void |
serialize(java.io.DataOutputStream out)
The method allows user to save a token in some storage
|
java.lang.String |
toString()
Returns a string representation of this AccessToken.
|
protected void |
writeStringOrNull(java.io.DataOutputStream out,
java.lang.String s)
Writes string in the output stream in the following format:
<true><string> or
<false> in case <string> is null
|
public final java.lang.String access_token
public final java.lang.String token_type
public final int expires_in
public final java.lang.String refresh_token
public final java.lang.String scope
public AccessToken(java.io.DataInputStream in) throws java.io.IOException
in
- Stream from that the token can be restoredjava.io.IOException
- thrown if IO error occurs or
data in the stream has wrong formatprotected void writeStringOrNull(java.io.DataOutputStream out, java.lang.String s) throws java.io.IOException
out
- output streams
- the string should be writtenjava.io.IOException
- thrown if IO error occurspublic void serialize(java.io.DataOutputStream out) throws java.io.IOException
Token
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2013, 2014, Oracle and/or its affiliates. All rights reserved.