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

公開メンバ関数

IErrorType getType ()
 
void setType (IErrorType type)
 
String getState ()
 
void setState (String p_state)
 
String getErrorCode ()
 
String getErrorDescription ()
 
void setErrorDescription (String errorDescription)
 
String getErrorUri ()
 
void setErrorUri (String errorUri)
 
String getReason ()
 
void setReason (String reason)
 
String toQueryString ()
 
String toJSonString ()
 

非公開変数類

IErrorType type
 
String state
 

詳解

著者
Yuriy Zabrovarnyy
バージョン
0.9, 19/09/2012

関数詳解

◆ getErrorCode()

String org.xdi.oxauth.model.error.DefaultErrorResponse.getErrorCode ( )
inline
47  {
48  if (type != null)
49  return type.toString();
50  return null;
51  }
IErrorType type
Definition: DefaultErrorResponse.java:16

◆ getErrorDescription()

String org.xdi.oxauth.model.error.ErrorResponse.getErrorDescription ( )
inlineinherited

Returns a human-readable UTF-8 encoded text providing additional information, used to assist the client developer in understanding the error that occurred.

戻り値
Description about the error.
54  {
55  return errorDescription;
56  }
String errorDescription
Definition: ErrorResponse.java:28

◆ getErrorUri()

String org.xdi.oxauth.model.error.ErrorResponse.getErrorUri ( )
inlineinherited

Return an URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.

戻り値
URI with more information about the error.
77  {
78  return errorUri;
79  }
String errorUri
Definition: ErrorResponse.java:29

◆ getReason()

String org.xdi.oxauth.model.error.ErrorResponse.getReason ( )
inlineinherited
93  {
94  return reason;
95  }
String reason
Definition: ErrorResponse.java:30

◆ getState()

String org.xdi.oxauth.model.error.DefaultErrorResponse.getState ( )
inline
38  {
39  return state;
40  }
String state
Definition: DefaultErrorResponse.java:17

◆ getType()

IErrorType org.xdi.oxauth.model.error.DefaultErrorResponse.getType ( )
inline

Returns the error response type.

戻り値
The error response type.
24  {
25  return type;
26  }
IErrorType type
Definition: DefaultErrorResponse.java:16

◆ setErrorDescription()

void org.xdi.oxauth.model.error.ErrorResponse.setErrorDescription ( String  errorDescription)
inlineinherited

Sets a human-readable UTF-8 encoded text providing additional information, used to assist the client developer in understanding the error that occurred.

引数
errorDescriptionDescription about the error.
66  {
68  }
String errorDescription
Definition: ErrorResponse.java:28

◆ setErrorUri()

void org.xdi.oxauth.model.error.ErrorResponse.setErrorUri ( String  errorUri)
inlineinherited

Sets an URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.

引数
errorUriURI with more information about the error.
89  {
90  this.errorUri = errorUri;
91  }
String errorUri
Definition: ErrorResponse.java:29

◆ setReason()

void org.xdi.oxauth.model.error.ErrorResponse.setReason ( String  reason)
inlineinherited
97  {
98  this.reason = reason;
99  }
String reason
Definition: ErrorResponse.java:30

◆ setState()

void org.xdi.oxauth.model.error.DefaultErrorResponse.setState ( String  p_state)
inline
42  {
43  state = p_state;
44  }
String state
Definition: DefaultErrorResponse.java:17

◆ setType()

void org.xdi.oxauth.model.error.DefaultErrorResponse.setType ( IErrorType  type)
inline

Sets the IErrorType that represents the code of the error that occurred.

引数
typeThe error response type.
33  {
34  this.type = type;
35  }
IErrorType type
Definition: DefaultErrorResponse.java:16

◆ toJSonString()

String org.xdi.oxauth.model.error.ErrorResponse.toJSonString ( )
inlineinherited

Return a JSon string representation of the object.

戻り値
The object represented in a JSon string.
142  {
143  JSONObject jsonObj = new JSONObject();
144 
145  try {
146  jsonObj.put("error", getErrorCode());
147 
148  if (errorDescription != null && !errorDescription.isEmpty()) {
149  jsonObj.put("error_description", errorDescription);
150  }
151 
152  if (errorUri != null && !errorUri.isEmpty()) {
153  jsonObj.put("error_uri", errorUri);
154  }
155 
156  if (StringUtils.isNotBlank(reason)) {
157  jsonObj.put("reason", reason);
158  }
159 
160  if (getState() != null && !getState().isEmpty()) {
161  jsonObj.put("state", getState());
162  }
163 
164  } catch (JSONException e) {
165  log.error(e.getMessage(), e);
166  return null;
167  }
168 
169  return jsonObj.toString();
170  }
String errorDescription
Definition: ErrorResponse.java:28
String errorUri
Definition: ErrorResponse.java:29
String reason
Definition: ErrorResponse.java:30
static final Logger log
Definition: ErrorResponse.java:26

◆ toQueryString()

String org.xdi.oxauth.model.error.ErrorResponse.toQueryString ( )
inlineinherited

Returns a query string representation of the object.

戻り値
The object represented in a query string.
106  {
107  StringBuilder queryStringBuilder = new StringBuilder();
108 
109  try {
110  queryStringBuilder.append("error=").append(getErrorCode());
111 
112  if (errorDescription != null && !errorDescription.isEmpty()) {
113  queryStringBuilder.append("&error_description=").append(
114  URLEncoder.encode(errorDescription, "UTF-8"));
115  }
116 
117  if (errorUri != null && !errorUri.isEmpty()) {
118  queryStringBuilder.append("&error_uri=").append(
119  URLEncoder.encode(errorUri, "UTF-8"));
120  }
121 
122  if (StringUtils.isNotBlank(reason)) {
123  queryStringBuilder.append("&reason=").append(URLEncoder.encode(reason, "UTF-8"));
124  }
125 
126  if (getState() != null && !getState().isEmpty()) {
127  queryStringBuilder.append("&state=").append(getState());
128  }
129  } catch (UnsupportedEncodingException e) {
130  log.error(e.getMessage(), e);
131  return null;
132  }
133 
134  return queryStringBuilder.toString();
135  }
String errorDescription
Definition: ErrorResponse.java:28
String errorUri
Definition: ErrorResponse.java:29
String reason
Definition: ErrorResponse.java:30
static final Logger log
Definition: ErrorResponse.java:26

メンバ詳解

◆ state

String org.xdi.oxauth.model.error.DefaultErrorResponse.state
private

◆ type

IErrorType org.xdi.oxauth.model.error.DefaultErrorResponse.type
private

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