gluu
公開メンバ関数 | 非公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.gluu.oxtrust.api.openidconnect.ScopeWebResource クラス
org.gluu.oxtrust.api.openidconnect.ScopeWebResource の継承関係図
Inheritance graph
org.gluu.oxtrust.api.openidconnect.ScopeWebResource 連携図
Collaboration graph

公開メンバ関数

 ScopeWebResource ()
 
Response getAllScopes ()
 
Response getScopeByInum (@PathParam(OxTrustApiConstants.INUM) @NotNull String inum)
 
Response searchScope (@QueryParam(OxTrustApiConstants.SEARCH_PATTERN) String pattern, @DefaultValue("10") @QueryParam("size") int size)
 
Response createScope (OxAuthScope scope)
 
Response updateScope (OxAuthScope scope)
 
Response getScopeClaims (@PathParam(OxTrustApiConstants.INUM) @NotNull String inum)
 
Response deleteScope (@PathParam(OxTrustApiConstants.INUM) @NotNull String inum)
 
Response deleteScopes ()
 
void log (Logger logger, Exception e)
 

非公開メンバ関数

void log (String message)
 

非公開変数類

Logger logger
 
ScopeService scopeService
 
AttributeService attributeService
 

詳解

構築子と解体子

◆ ScopeWebResource()

org.gluu.oxtrust.api.openidconnect.ScopeWebResource.ScopeWebResource ( )
inline
44  {
45  }

関数詳解

◆ createScope()

Response org.gluu.oxtrust.api.openidconnect.ScopeWebResource.createScope ( OxAuthScope  scope)
inline
94  {
95  log("Create scope");
96  try {
97  Objects.requireNonNull(scope, "Attempt to create null scope");
98  String inum = scopeService.generateInumForNewScope();
99  scope.setInum(inum);
100  scope.setDn(scopeService.getDnForScope(inum));
101  scopeService.addScope(scope);
102  return Response.ok(scopeService.getScopeByInum(inum)).build();
103  } catch (Exception e) {
104  log(logger, e);
105  return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
106  }
107  }
String getDnForScope(String inum)
Definition: ScopeService.java:92
Logger logger
Definition: ScopeWebResource.java:37
void log(String message)
Definition: ScopeWebResource.java:180
void addScope(OxAuthScope scope)
Definition: ScopeService.java:52
OxAuthScope getScopeByInum(String inum)
Definition: ScopeService.java:74
ScopeService scopeService
Definition: ScopeWebResource.java:40
String generateInumForNewScope()
Definition: ScopeService.java:116

◆ deleteScope()

Response org.gluu.oxtrust.api.openidconnect.ScopeWebResource.deleteScope ( @PathParam(OxTrustApiConstants.INUM) @NotNull String  inum)
inline
159  {
160  log("Delete openidconnect scope " + inum);
161  try {
162  OxAuthScope scope = scopeService.getScopeByInum(inum);
163  if (scope != null) {
164  scopeService.removeScope(scope);
165  return Response.ok().build();
166  } else {
167  return Response.status(Response.Status.NOT_FOUND).build();
168  }
169  } catch (Exception e) {
170  log(logger, e);
171  return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
172  }
173  }
Logger logger
Definition: ScopeWebResource.java:37
void removeScope(OxAuthScope scope)
Definition: ScopeService.java:62
void log(String message)
Definition: ScopeWebResource.java:180
OxAuthScope getScopeByInum(String inum)
Definition: ScopeService.java:74
ScopeService scopeService
Definition: ScopeWebResource.java:40

◆ deleteScopes()

Response org.gluu.oxtrust.api.openidconnect.ScopeWebResource.deleteScopes ( )
inline
176  {
177  return Response.status(Response.Status.UNAUTHORIZED).build();
178  }

◆ getAllScopes()

Response org.gluu.oxtrust.api.openidconnect.ScopeWebResource.getAllScopes ( )
inline
49  {
50  log("List openid connect scopes ");
51  try {
52  return Response.ok(scopeService.searchScopes(null, 100)).build();
53  } catch (Exception e) {
54  log(logger, e);
55  return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
56  }
57  }
Logger logger
Definition: ScopeWebResource.java:37
void log(String message)
Definition: ScopeWebResource.java:180
ScopeService scopeService
Definition: ScopeWebResource.java:40
List< OxAuthScope > searchScopes(String pattern, int sizeLimit)
Definition: ScopeService.java:138

◆ getScopeByInum()

Response org.gluu.oxtrust.api.openidconnect.ScopeWebResource.getScopeByInum ( @PathParam(OxTrustApiConstants.INUM) @NotNull String  inum)
inline
62  {
63  log("Get openid connect scope by " + inum);
64  try {
65  OxAuthScope scope = scopeService.getScopeByInum(inum);
66  if (scope != null) {
67  return Response.ok(scope).build();
68  } else {
69  return Response.ok(Response.Status.NOT_FOUND).build();
70  }
71  } catch (Exception e) {
72  log(logger, e);
73  return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
74  }
75  }
Logger logger
Definition: ScopeWebResource.java:37
void log(String message)
Definition: ScopeWebResource.java:180
OxAuthScope getScopeByInum(String inum)
Definition: ScopeService.java:74
ScopeService scopeService
Definition: ScopeWebResource.java:40

◆ getScopeClaims()

Response org.gluu.oxtrust.api.openidconnect.ScopeWebResource.getScopeClaims ( @PathParam(OxTrustApiConstants.INUM) @NotNull String  inum)
inline
134  {
135  log("List all claims of scope ==> " + inum);
136  try {
137  Objects.requireNonNull(inum, "inum should not be null");
138  OxAuthScope oxAuthScope = scopeService.getScopeByInum(inum);
139  List<String> claimsDn = new ArrayList<String>();
140  List<GluuAttribute> attributes = new ArrayList<GluuAttribute>();
141  if (oxAuthScope != null) {
142  claimsDn = oxAuthScope.getOxAuthClaims();
143  for (String claimDn : claimsDn) {
144  attributes.add(attributeService.getAttributeByDn(claimDn));
145  }
146  return Response.ok(attributes).build();
147  } else {
148  return Response.status(Response.Status.NOT_FOUND).build();
149  }
150  } catch (Exception e) {
151  log(logger, e);
152  return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
153  }
154  }
GluuAttribute getAttributeByDn(String Dn)
Definition: AttributeService.java:723
Logger logger
Definition: ScopeWebResource.java:37
void log(String message)
Definition: ScopeWebResource.java:180
OxAuthScope getScopeByInum(String inum)
Definition: ScopeService.java:74
ScopeService scopeService
Definition: ScopeWebResource.java:40
List< String > getOxAuthClaims()
Definition: OxAuthScope.java:92
AttributeService attributeService
Definition: ScopeWebResource.java:42

◆ log() [1/2]

void org.gluu.oxtrust.api.openidconnect.BaseWebResource.log ( Logger  logger,
Exception  e 
)
inlineinherited
10  {
11  logger.debug("", e);
12  }

◆ log() [2/2]

void org.gluu.oxtrust.api.openidconnect.ScopeWebResource.log ( String  message)
inlineprivate
180  {
181  logger.debug("################# Request: " + message);
182  }
Logger logger
Definition: ScopeWebResource.java:37

◆ searchScope()

Response org.gluu.oxtrust.api.openidconnect.ScopeWebResource.searchScope ( @QueryParam(OxTrustApiConstants.SEARCH_PATTERN) String  pattern,
@DefaultValue("10") @QueryParam("size") int  size 
)
inline
81  {
82  log("Search openid connect scopes with pattern= " + pattern);
83  try {
84  List<OxAuthScope> scopes = scopeService.searchScopes(pattern, size);
85  return Response.ok(scopes).build();
86  } catch (Exception e) {
87  log(logger, e);
88  return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
89  }
90  }
Logger logger
Definition: ScopeWebResource.java:37
void log(String message)
Definition: ScopeWebResource.java:180
ScopeService scopeService
Definition: ScopeWebResource.java:40
List< OxAuthScope > searchScopes(String pattern, int sizeLimit)
Definition: ScopeService.java:138

◆ updateScope()

Response org.gluu.oxtrust.api.openidconnect.ScopeWebResource.updateScope ( OxAuthScope  scope)
inline
111  {
112  String inum = scope.getInum();
113  log("Update scope " + inum);
114  try {
115  Objects.requireNonNull(scope, "Attempt to update scope null value");
116  Objects.requireNonNull(inum);
117  OxAuthScope existingScope = scopeService.getScopeByInum(inum);
118  if (existingScope != null) {
119  scope.setInum(existingScope.getInum());
120  scopeService.updateScope(scope);
121  return Response.ok(scopeService.getScopeByInum(inum)).build();
122  } else {
123  return Response.status(Response.Status.NOT_FOUND).build();
124  }
125  } catch (Exception e) {
126  log(logger, e);
127  return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
128  }
129  }
void updateScope(OxAuthScope scope)
Definition: ScopeService.java:107
Logger logger
Definition: ScopeWebResource.java:37
void log(String message)
Definition: ScopeWebResource.java:180
OxAuthScope getScopeByInum(String inum)
Definition: ScopeService.java:74
ScopeService scopeService
Definition: ScopeWebResource.java:40
void setInum(String inum)
Definition: OxAuthScope.java:64

メンバ詳解

◆ attributeService

AttributeService org.gluu.oxtrust.api.openidconnect.ScopeWebResource.attributeService
private

◆ logger

Logger org.gluu.oxtrust.api.openidconnect.ScopeWebResource.logger
private

◆ scopeService

ScopeService org.gluu.oxtrust.api.openidconnect.ScopeWebResource.scopeService
private

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