gluu
公開メンバ関数 | 非公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.gluu.oxtrust.exception.UncaughtException クラス
org.gluu.oxtrust.exception.UncaughtException の継承関係図
Inheritance graph
org.gluu.oxtrust.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"
 

詳解

Created by eugeniuparvan on 9/1/17.

構築子と解体子

◆ UncaughtException()

org.gluu.oxtrust.exception.UncaughtException.UncaughtException ( )
inline
39  {
40  }

関数詳解

◆ getRedirectURI()

String org.gluu.oxtrust.exception.UncaughtException.getRedirectURI ( ) throws Exception
inlineprivate
54  {
55  String baseUri = uriInfo.getBaseUri().toString();
56  String contextPath = httpRequest.getContextPath();
57 
58  int startIndex = baseUri.indexOf(contextPath);
59  if (startIndex == -1)
60  throw new Exception("Can't build redirect URI");
61 
62  return baseUri.substring(0, startIndex + contextPath.length()) + ERROR_PAGE;
63  }
static final String ERROR_PAGE
Definition: UncaughtException.java:29
UriInfo uriInfo
Definition: UncaughtException.java:37
HttpServletRequest httpRequest
Definition: UncaughtException.java:34

◆ toResponse()

Response org.gluu.oxtrust.exception.UncaughtException.toResponse ( Throwable  exception)
inline
44  {
45  try {
46  log.error("Jersey error.", exception);
47  return Response.temporaryRedirect(new URI(getRedirectURI())).build();
48  } catch (Exception e) {
49  log.error("Jersey error.", e);
50  return Response.status(500).entity("Something bad happened. Please try again later!").type("text/plain").build();
51  }
52  }
String getRedirectURI()
Definition: UncaughtException.java:54
Logger log
Definition: UncaughtException.java:31

メンバ詳解

◆ ERROR_PAGE

final String org.gluu.oxtrust.exception.UncaughtException.ERROR_PAGE = "/error"
staticprivate

◆ httpRequest

HttpServletRequest org.gluu.oxtrust.exception.UncaughtException.httpRequest
private

◆ log

Logger org.gluu.oxtrust.exception.UncaughtException.log = LoggerFactory.getLogger(UncaughtException.class)
private

◆ serialVersionUID

final long org.gluu.oxtrust.exception.UncaughtException.serialVersionUID = 1L
staticprivate

◆ uriInfo

UriInfo org.gluu.oxtrust.exception.UncaughtException.uriInfo
private

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