gluu
公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.xdi.oxauth.client.TokenResponse クラス
org.xdi.oxauth.client.TokenResponse の継承関係図
Inheritance graph
org.xdi.oxauth.client.TokenResponse 連携図
Collaboration graph

公開メンバ関数

 TokenResponse ()
 
 TokenResponse (ClientResponse< String > clientResponse)
 
TokenErrorResponseType fromString (String p_str)
 
void injectDataFromJson ()
 
void injectDataFromJson (String p_json)
 
String getAccessToken ()
 
void setAccessToken (String accessToken)
 
TokenType getTokenType ()
 
void setTokenType (TokenType tokenType)
 
Integer getExpiresIn ()
 
void setExpiresIn (Integer expiresIn)
 
String getRefreshToken ()
 
void setRefreshToken (String refreshToken)
 
String getScope ()
 
void setScope (String scope)
 
String getIdToken ()
 
void setIdToken (String idToken)
 
String getErrorDescription ()
 
void setErrorDescription (String p_errorDescription)
 
getErrorType ()
 
void setErrorType (T p_errorType)
 
String getErrorUri ()
 
void setErrorUri (String p_errorUri)
 
void injectErrorIfExistSilently (JSONObject jsonObj) throws JSONException
 
void injectErrorIfExistSilently (String p_entity)
 

非公開変数類

String accessToken
 
TokenType tokenType
 
Integer expiresIn
 
String refreshToken
 
String scope
 
String idToken
 

静的非公開変数類

static final Logger LOG = Logger.getLogger(TokenResponse.class)
 

詳解

Represents a token response received from the authorization server.

著者
Javier Rojas Blum Date: 10.19.2011

構築子と解体子

◆ TokenResponse() [1/2]

org.xdi.oxauth.client.TokenResponse.TokenResponse ( )
inline
33  {
34  }

◆ TokenResponse() [2/2]

org.xdi.oxauth.client.TokenResponse.TokenResponse ( ClientResponse< String >  clientResponse)
inline

Constructs a token response.

引数
clientResponseThe response
41  {
42  super(clientResponse);
43  }

関数詳解

◆ fromString()

TokenErrorResponseType org.xdi.oxauth.client.TokenResponse.fromString ( String  p_str)
inline
46  {
47  return TokenErrorResponseType.fromString(p_str);
48  }

◆ getAccessToken()

String org.xdi.oxauth.client.TokenResponse.getAccessToken ( )
inline

Returns the access token issued by the authorization server.

戻り値
The access token issued by the authorization server.
89  {
90  return accessToken;
91  }
String accessToken
Definition: TokenResponse.java:26

◆ getErrorDescription()

String org.xdi.oxauth.client.BaseResponseWithErrors< T extends IErrorType >.getErrorDescription ( )
inlineinherited
40  {
41  return errorDescription;
42  }
String errorDescription
Definition: BaseResponseWithErrors.java:25

◆ getErrorType()

T org.xdi.oxauth.client.BaseResponseWithErrors< T extends IErrorType >.getErrorType ( )
inlineinherited
48  {
49  return errorType;
50  }

◆ getErrorUri()

String org.xdi.oxauth.client.BaseResponseWithErrors< T extends IErrorType >.getErrorUri ( )
inlineinherited
56  {
57  return errorUri;
58  }
String errorUri
Definition: BaseResponseWithErrors.java:26

◆ getExpiresIn()

Integer org.xdi.oxauth.client.TokenResponse.getExpiresIn ( )
inline

Returns the lifetime in seconds of the access token.

戻り値
The lifetime in seconds of the access token.
125  {
126  return expiresIn;
127  }
Integer expiresIn
Definition: TokenResponse.java:28

◆ getIdToken()

String org.xdi.oxauth.client.TokenResponse.getIdToken ( )
inline

Gets the value of the id token.

戻り値
The id token.
181  {
182  return idToken;
183  }
String idToken
Definition: TokenResponse.java:31

◆ getRefreshToken()

String org.xdi.oxauth.client.TokenResponse.getRefreshToken ( )
inline

Returns the refresh token which can be used to obtain new access tokens using the same authorization grant.

戻り値
The refresh token.
144  {
145  return refreshToken;
146  }
String refreshToken
Definition: TokenResponse.java:29

◆ getScope()

String org.xdi.oxauth.client.TokenResponse.getScope ( )
inline

Returns the scope of the access token.

戻り値
The scope of the access token.
163  {
164  return scope;
165  }
String scope
Definition: TokenResponse.java:30

◆ getTokenType()

TokenType org.xdi.oxauth.client.TokenResponse.getTokenType ( )
inline

Returns the type of the token issued. Value is case insensitive.

戻り値
The type of the token issued.
107  {
108  return tokenType;
109  }
TokenType tokenType
Definition: TokenResponse.java:27

◆ injectDataFromJson() [1/2]

void org.xdi.oxauth.client.TokenResponse.injectDataFromJson ( )
inline
50  {
51  injectDataFromJson(entity);
52  }
void injectDataFromJson()
Definition: TokenResponse.java:50

◆ injectDataFromJson() [2/2]

void org.xdi.oxauth.client.TokenResponse.injectDataFromJson ( String  p_json)
inline
55  {
56  if (StringUtils.isNotBlank(entity)) {
57  try {
58  JSONObject jsonObj = new JSONObject(entity);
59  if (jsonObj.has("access_token")) {
60  setAccessToken(jsonObj.getString("access_token"));
61  }
62  if (jsonObj.has("token_type")) {
63  setTokenType(TokenType.fromString(jsonObj.getString("token_type")));
64  }
65  if (jsonObj.has("expires_in")) {
66  setExpiresIn(jsonObj.getInt("expires_in"));
67  }
68  if (jsonObj.has("refresh_token")) {
69  setRefreshToken(jsonObj.getString("refresh_token"));
70  }
71  if (jsonObj.has("scope")) {
72  setScope(jsonObj.getString("scope"));
73  }
74  if (jsonObj.has("id_token")) {
75  setIdToken(jsonObj.getString("id_token"));
76  }
77  } catch (JSONException e) {
78  LOG.error(e.getMessage(), e);
79  }
80  }
81  }
void setRefreshToken(String refreshToken)
Definition: TokenResponse.java:154
void setScope(String scope)
Definition: TokenResponse.java:172
void setIdToken(String idToken)
Definition: TokenResponse.java:190
static final Logger LOG
Definition: TokenResponse.java:24
void setExpiresIn(Integer expiresIn)
Definition: TokenResponse.java:134
void setTokenType(TokenType tokenType)
Definition: TokenResponse.java:116
void setAccessToken(String accessToken)
Definition: TokenResponse.java:98

◆ injectErrorIfExistSilently() [1/2]

void org.xdi.oxauth.client.BaseResponseWithErrors< T extends IErrorType >.injectErrorIfExistSilently ( JSONObject  jsonObj) throws JSONException
inlineinherited
69  {
70  if (jsonObj.has("error")) {
71  errorType = fromString(jsonObj.getString("error"));
72  }
73  if (jsonObj.has("error_description")) {
74  errorDescription = jsonObj.getString("error_description");
75  }
76  if (jsonObj.has("error_uri")) {
77  errorUri = jsonObj.getString("error_uri");
78  }
79  }
String errorDescription
Definition: BaseResponseWithErrors.java:25
String errorUri
Definition: BaseResponseWithErrors.java:26

◆ injectErrorIfExistSilently() [2/2]

void org.xdi.oxauth.client.BaseResponseWithErrors< T extends IErrorType >.injectErrorIfExistSilently ( String  p_entity)
inlineinherited
81  {
82  try {
83  injectErrorIfExistSilently(new JSONObject(p_entity));
84  } catch (JSONException e) {
85  // ignore : it's ok to skip exception because entity string can be json array or just trash
86  }
87  }
void injectErrorIfExistSilently(JSONObject jsonObj)
Definition: BaseResponseWithErrors.java:69

◆ setAccessToken()

void org.xdi.oxauth.client.TokenResponse.setAccessToken ( String  accessToken)
inline

Sets the access token issued by the authorization server.

引数
accessTokenThe access token issued by the authorization server.
98  {
99  this.accessToken = accessToken;
100  }
String accessToken
Definition: TokenResponse.java:26

◆ setErrorDescription()

void org.xdi.oxauth.client.BaseResponseWithErrors< T extends IErrorType >.setErrorDescription ( String  p_errorDescription)
inlineinherited
44  {
45  errorDescription = p_errorDescription;
46  }
String errorDescription
Definition: BaseResponseWithErrors.java:25

◆ setErrorType()

void org.xdi.oxauth.client.BaseResponseWithErrors< T extends IErrorType >.setErrorType ( p_errorType)
inlineinherited
52  {
53  errorType = p_errorType;
54  }

◆ setErrorUri()

void org.xdi.oxauth.client.BaseResponseWithErrors< T extends IErrorType >.setErrorUri ( String  p_errorUri)
inlineinherited
60  {
61  errorUri = p_errorUri;
62  }
String errorUri
Definition: BaseResponseWithErrors.java:26

◆ setExpiresIn()

void org.xdi.oxauth.client.TokenResponse.setExpiresIn ( Integer  expiresIn)
inline

Sets the lifetime in seconds of the access token.

引数
expiresInThe lifetime in seconds of the access token.
134  {
135  this.expiresIn = expiresIn;
136  }
Integer expiresIn
Definition: TokenResponse.java:28

◆ setIdToken()

void org.xdi.oxauth.client.TokenResponse.setIdToken ( String  idToken)
inline

Sets the value of the id token.

引数
idTokenThe id token.
190  {
191  this.idToken = idToken;
192  }
String idToken
Definition: TokenResponse.java:31

◆ setRefreshToken()

void org.xdi.oxauth.client.TokenResponse.setRefreshToken ( String  refreshToken)
inline

Sets the refresh token which can be used to obtain new access tokens using the same authorization grant.

引数
refreshTokenThe refresh token.
154  {
155  this.refreshToken = refreshToken;
156  }
String refreshToken
Definition: TokenResponse.java:29

◆ setScope()

void org.xdi.oxauth.client.TokenResponse.setScope ( String  scope)
inline

Sets the scope of the access token.

引数
scopeThe scope of the access token.
172  {
173  this.scope = scope;
174  }
String scope
Definition: TokenResponse.java:30

◆ setTokenType()

void org.xdi.oxauth.client.TokenResponse.setTokenType ( TokenType  tokenType)
inline

Sets the type of the token issued. Value is case insensitive.

引数
tokenTypeThe type of the token issued.
116  {
117  this.tokenType = tokenType;
118  }
TokenType tokenType
Definition: TokenResponse.java:27

メンバ詳解

◆ accessToken

String org.xdi.oxauth.client.TokenResponse.accessToken
private

◆ expiresIn

Integer org.xdi.oxauth.client.TokenResponse.expiresIn
private

◆ idToken

String org.xdi.oxauth.client.TokenResponse.idToken
private

◆ LOG

final Logger org.xdi.oxauth.client.TokenResponse.LOG = Logger.getLogger(TokenResponse.class)
staticprivate

◆ refreshToken

String org.xdi.oxauth.client.TokenResponse.refreshToken
private

◆ scope

String org.xdi.oxauth.client.TokenResponse.scope
private

◆ tokenType

TokenType org.xdi.oxauth.client.TokenResponse.tokenType
private

このクラス詳解は次のファイルから抽出されました: