public class ScopedToken extends BoxJSONObject
Constructor and Description |
---|
ScopedToken(JsonObject jsonObject)
Constructs a ScopedToken object from a parsed JsonObject.
|
Modifier and Type | Method and Description |
---|---|
String |
getAccessToken()
Gets the lower scoped token.
|
long |
getExpiresIn()
Gets the expires in time in milliseconds.
|
String |
getIssuedTokenType()
Gets the issued token type as per ietf namespace.
|
long |
getObtainedAt()
Gets the time in milliseconds when the token was obtained.
|
JsonArray |
getRestrictedTo()
Gets the restricted to information for the scoped token.
|
String |
getTokenType()
Gets the token type.
|
protected void |
parseJSONMember(JsonObject.Member member)
Invoked with a JSON member whenever this object is updated or created from a JSON object.
|
void |
setExpiresIn(long milliseconds)
Sets the time in milliseconds in which this token will expire.
|
void |
setObtainedAt(long milliseconds) |
clearPendingChanges, getJson, getPendingChanges, getPendingChangesAsJsonObject, getPendingJSONObject
public ScopedToken(JsonObject jsonObject)
jsonObject
- parsed json object from response of token exchangeprotected void parseJSONMember(JsonObject.Member member)
BoxJSONObject
Subclasses should override this method in order to parse any JSON members it knows about. This method is a no-op by default.
member
- the JSON member to be parsed.public String getAccessToken()
public long getExpiresIn()
public void setExpiresIn(long milliseconds)
milliseconds
- the number of milliseconds for which the access token is valid.public String getTokenType()
public String getIssuedTokenType()
public JsonArray getRestrictedTo()
public long getObtainedAt()
public void setObtainedAt(long milliseconds)
milliseconds
- the time in milliseconds at which it was obtained