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

公開メンバ関数

 UncaughtException ()
 
Response toResponse (Throwable exception)
 

非公開メンバ関数

String getRedirectURI () throws Exception
 

非公開変数類

Logger log = LoggerFactory.getLogger(UncaughtException.class)
 
HttpServletRequest httpRequest
 
UriInfo uriInfo
 

静的非公開変数類

static final long serialVersionUID = 1L
 
static final String ERROR_PAGE = "/error_service"
 

詳解

Created by eugeniuparvan on 8/29/17.

構築子と解体子

◆ UncaughtException()

org.xdi.oxauth.exception.UncaughtException.UncaughtException ( )
inline
35  {
36  }

関数詳解

◆ getRedirectURI()

String org.xdi.oxauth.exception.UncaughtException.getRedirectURI ( ) throws Exception
inlineprivate
50  {
51  String baseUri = uriInfo.getBaseUri().toString();
52  String contextPath = httpRequest.getContextPath();
53 
54  int startIndex = baseUri.indexOf(contextPath);
55  if (startIndex == -1)
56  throw new Exception("Can't build redirect URI");
57 
58  return baseUri.substring(0, startIndex + contextPath.length()) + ERROR_PAGE;
59  }
static final String ERROR_PAGE
Definition: UncaughtException.java:25
HttpServletRequest httpRequest
Definition: UncaughtException.java:30
UriInfo uriInfo
Definition: UncaughtException.java:33

◆ toResponse()

Response org.xdi.oxauth.exception.UncaughtException.toResponse ( Throwable  exception)
inline
40  {
41  try {
42  log.error("Jersey error.", exception);
43  return Response.temporaryRedirect(new URI(getRedirectURI())).build();
44  } catch (Exception e) {
45  log.error("Jersey error.", e);
46  return Response.status(500).entity("Something bad happened. Please try again later!").type("text/plain").build();
47  }
48  }
String getRedirectURI()
Definition: UncaughtException.java:50
Logger log
Definition: UncaughtException.java:27

メンバ詳解

◆ ERROR_PAGE

final String org.xdi.oxauth.exception.UncaughtException.ERROR_PAGE = "/error_service"
staticprivate

◆ httpRequest

HttpServletRequest org.xdi.oxauth.exception.UncaughtException.httpRequest
private

◆ log

Logger org.xdi.oxauth.exception.UncaughtException.log = LoggerFactory.getLogger(UncaughtException.class)
private

◆ serialVersionUID

final long org.xdi.oxauth.exception.UncaughtException.serialVersionUID = 1L
staticprivate

◆ uriInfo

UriInfo org.xdi.oxauth.exception.UncaughtException.uriInfo
private

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