gluu
公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.xdi.oxauth.uma.ws.rs.UmaScopeIconWS クラス
org.xdi.oxauth.uma.ws.rs.UmaScopeIconWS 連携図
Collaboration graph

公開メンバ関数

Response getScopeDescription (@PathParam("id") String id)
 

非公開変数類

Logger log
 
ErrorResponseFactory errorResponseFactory
 
UmaScopeService umaScopeService
 
XmlService xmlService
 

詳解

著者
Yuriy Zabrovarnyy
バージョン
0.9, 02/05/2013

関数詳解

◆ getScopeDescription()

Response org.xdi.oxauth.uma.ws.rs.UmaScopeIconWS.getScopeDescription ( @PathParam("id") String  id)
inline
54  {
55  log.trace("UMA - get scope's icon : id: {}", id);
56  try {
57  if (StringUtils.isNotBlank(id)) {
58  final UmaScopeDescription scope = umaScopeService.getScope(id);
59  if (scope != null && StringUtils.isNotBlank(scope.getFaviconImageAsXml())) {
60  final GluuImage gluuImage = xmlService.getGluuImageFromXML(scope.getFaviconImageAsXml());
61 
62  if (gluuImage != null && ArrayUtils.isNotEmpty(gluuImage.getData())) {
63  // todo yuriyz : it must be clarified how exactly content of image must be shared between oxTrust and oxAuth
64  // currently oxTrust save content on disk however oxAuth expects it in ldap as we must support clustering!
65 
66  // send non-streamed image as it's anyway picked up in memory (i know it's not nice...)
67 
68  return Response.status(Response.Status.OK).entity(gluuImage.getData()).build();
69  }
70  }
71  }
72  } catch (Exception e) {
73  log.error(e.getMessage(), e);
74  throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR)
75  .entity(errorResponseFactory.getUmaJsonErrorResponse(UmaErrorResponseType.SERVER_ERROR)).build());
76  }
77  throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
78  .entity(errorResponseFactory.getUmaJsonErrorResponse(UmaErrorResponseType.NOT_FOUND)).build());
79  }
XmlService xmlService
Definition: UmaScopeIconWS.java:49
ErrorResponseFactory errorResponseFactory
Definition: UmaScopeIconWS.java:43
UmaScopeService umaScopeService
Definition: UmaScopeIconWS.java:46
UmaScopeDescription getScope(String scopeId)
Definition: UmaScopeService.java:68
String getUmaJsonErrorResponse(IErrorType type)
Definition: ErrorResponseFactory.java:181
Logger log
Definition: UmaScopeIconWS.java:40

メンバ詳解

◆ errorResponseFactory

ErrorResponseFactory org.xdi.oxauth.uma.ws.rs.UmaScopeIconWS.errorResponseFactory
private

◆ log

Logger org.xdi.oxauth.uma.ws.rs.UmaScopeIconWS.log
private

◆ umaScopeService

UmaScopeService org.xdi.oxauth.uma.ws.rs.UmaScopeIconWS.umaScopeService
private

◆ xmlService

XmlService org.xdi.oxauth.uma.ws.rs.UmaScopeIconWS.xmlService
private

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