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

公開メンバ関数

abstract String getErrorCode ()
 
abstract String getState ()
 
String getErrorDescription ()
 
void setErrorDescription (String errorDescription)
 
String getErrorUri ()
 
void setErrorUri (String errorUri)
 
String getReason ()
 
void setReason (String reason)
 
String toQueryString ()
 
String toJSonString ()
 

非公開変数類

String errorDescription
 
String errorUri
 
String reason
 

静的非公開変数類

static final Logger log = LoggerFactory.getLogger(ErrorResponse.class)
 

詳解

Base class for error responses.

著者
Javier Rojas Date: 09.22.2011

関数詳解

◆ getErrorCode()

abstract String org.xdi.oxauth.model.error.ErrorResponse.getErrorCode ( )
abstract

Returns the error code of the response.

戻り値
The error code.

◆ getErrorDescription()

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

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 ( )
inline

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 ( )
inline
93  {
94  return reason;
95  }
String reason
Definition: ErrorResponse.java:30

◆ getState()

abstract String org.xdi.oxauth.model.error.ErrorResponse.getState ( )
abstract

If a valid state parameter was present in the request, it returns the exact value received from the client.

戻り値
The state value of the request.

◆ setErrorDescription()

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

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)
inline

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)
inline
97  {
98  this.reason = reason;
99  }
String reason
Definition: ErrorResponse.java:30

◆ toJSonString()

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

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 ( )
inline

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

メンバ詳解

◆ errorDescription

String org.xdi.oxauth.model.error.ErrorResponse.errorDescription
private

◆ errorUri

String org.xdi.oxauth.model.error.ErrorResponse.errorUri
private

◆ log

final Logger org.xdi.oxauth.model.error.ErrorResponse.log = LoggerFactory.getLogger(ErrorResponse.class)
staticprivate

◆ reason

String org.xdi.oxauth.model.error.ErrorResponse.reason
private

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