gluu
公開メンバ関数 | 静的公開メンバ関数 | 静的公開変数類 | 限定公開メンバ関数 | 関数 | 変数 | 非公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator クラス
org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator の継承関係図
Inheritance graph
org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator 連携図
Collaboration graph

公開メンバ関数

Response createGroup (GroupResource group, String attrsList, String excludedAttrsList)
 
Response getGroupById (String id, String attrsList, String excludedAttrsList)
 
Response updateGroup (GroupResource group, String id, String attrsList, String excludedAttrsList)
 
Response deleteGroup (String id)
 
Response searchGroups (String filter, Integer startIndex, Integer count, String sortBy, String sortOrder, String attrsList, String excludedAttrsList)
 
Response searchGroupsPost (SearchRequest searchRequest)
 
Response patchGroup (PatchRequest request, String id, String attrsList, String excludedAttrsList)
 
String getEndpointUrl ()
 
Response createGroup (GroupResource group, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList)
 
Response getGroupById ( @PathParam("id") String id, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList)
 
Response updateGroup (GroupResource group, @PathParam("id") String id, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList)
 
Response deleteGroup (@PathParam("id") String id)
 
Response searchGroups ( @QueryParam(QUERY_PARAM_FILTER) String filter, @QueryParam(QUERY_PARAM_START_INDEX) Integer startIndex, @QueryParam(QUERY_PARAM_COUNT) Integer count, @QueryParam(QUERY_PARAM_SORT_BY) String sortBy, @QueryParam(QUERY_PARAM_SORT_ORDER) String sortOrder, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList)
 
Response patchGroup (PatchRequest request, @PathParam("id") String id, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList)
 

静的公開メンバ関数

static Response getErrorResponse (Response.Status status, String detail)
 
static Response getErrorResponse (Response.Status status, ErrorScimType scimType, String detail)
 
static Response getErrorResponse (int statusCode, ErrorScimType scimType, String detail)
 

静的公開変数類

static final String SEARCH_SUFFIX = ".search"
 

限定公開メンバ関数

void assignMetaInformation (BaseScimResource resource)
 
void executeDefaultValidation (BaseScimResource resource) throws SCIMException
 
void executeValidation (BaseScimResource resource, boolean skipRequired) throws SCIMException
 
Response prepareSearchRequest (List< String > schemas, String filter, String sortBy, String sortOrder, Integer startIndex, Integer count, String attrsList, String excludedAttrsList, SearchRequest request)
 
Response inspectPatchRequest (PatchRequest patch, Class<? extends BaseScimResource > cls)
 

関数

int getMaxCount ()
 
String getValueFromHeaders (HttpHeaders headers, String name)
 
String translateSortByAttribute (Class<? extends BaseScimResource > cls, String sortBy)
 
String getListResponseSerialized (int total, int startIndex, List< BaseScimResource > resources, String attrsList, String excludedAttrsList, boolean ignoreResults) throws IOException
 

変数

IGroupWebService service
 
AppConfiguration appConfiguration
 
ScimResourceSerializer resourceSerializer
 
ExtensionService extService
 
String endpointUrl
 

非公開メンバ関数

Response validateExistenceOfGroup (String id)
 
void checkDisplayNameExistence (String displayName) throws DuplicateEntryException
 
void checkDisplayNameExistence (String displayName, String id) throws DuplicateEntryException
 

非公開変数類

Logger log
 
IGroupService groupService
 

詳解

Aims at decorating SCIM group service methods. Currently applies validations via ResourceValidator class or other custom validation logic

Created by jgomer on 2017-10-18.

関数詳解

◆ assignMetaInformation()

void org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.assignMetaInformation ( BaseScimResource  resource)
inlineprotectedinherited
102  {
103 
104  //Generate some meta information (this replaces the info client passed in the request)
105  long now=new Date().getTime();
106  String val= ISODateTimeFormat.dateTime().withZoneUTC().print(now);
107 
108  Meta meta=new Meta();
109  meta.setResourceType(ScimResourceUtil.getType(resource.getClass()));
110  meta.setCreated(val);
111  meta.setLastModified(val);
112  //For version attritute: Service provider support for this attribute is optional and subject to the service provider's support for versioning
113  //For location attribute: this will be set after current user creation in LDAP
114  resource.setMeta(meta);
115 
116  }

◆ checkDisplayNameExistence() [1/2]

void org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.checkDisplayNameExistence ( String  displayName) throws DuplicateEntryException
inlineprivate
63  {
64 
65  boolean flag=false;
66  try {
67  flag=groupService.getGroupByDisplayName(displayName) != null;
68  }
69  catch (Exception e){
70  log.error(e.getMessage(), e);
71  }
72  if (flag)
73  throw new DuplicateEntryException("Duplicate group displayName value: " + displayName);
74 
75  }
Logger log
Definition: GroupWebServiceDecorator.java:42
abstract GluuGroup getGroupByDisplayName(String DisplayName)
IGroupService groupService
Definition: GroupWebServiceDecorator.java:48

◆ checkDisplayNameExistence() [2/2]

void org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.checkDisplayNameExistence ( String  displayName,
String  id 
) throws DuplicateEntryException
inlineprivate
77  {
78  //Validate if there is an attempt to supply a displayName already in use by a group other than current
79 
80  GluuGroup groupToFind = new GluuGroup();
81  groupToFind.setDisplayName(displayName);
82 
83  List<GluuGroup> list=groupService.findGroups(groupToFind,2 );
84  if (list!=null){
85  for (GluuGroup g : list)
86  if (!g.getInum().equals(id))
87  throw new DuplicateEntryException("Duplicate group displayName value: " + displayName);
88  }
89 
90  }
IGroupService groupService
Definition: GroupWebServiceDecorator.java:48
abstract List< GluuGroup > findGroups(GluuGroup group, int sizeLimit)

◆ createGroup() [1/2]

Response org.gluu.oxtrust.ws.rs.scim2.IGroupWebService.createGroup ( GroupResource  group,
@QueryParam(QUERY_PARAM_ATTRIBUTES) String  attrsList,
@QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String  excludedAttrsList 
)
inherited

Service method that allows creating a Group resource via POST (as per section 3.3 of RFC 7644).

引数
groupAn object that represents the Group to create
attrsListSee notes about attributes query param
excludedAttrsListSee notes about excludedAttributes query param
戻り値
An object abstracting the response obtained from the server to this request. A succesful response for this operation should contain a status code of 201 (created) and a GroupResource in the entity body (the resource just created)

◆ createGroup() [2/2]

Response org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.createGroup ( GroupResource  group,
String  attrsList,
String  excludedAttrsList 
)
inline
92  {
93 
94  Response response;
95  try {
96  //empty externalId, no place to store it in LDAP
97  group.setExternalId(null);
98 
100  checkDisplayNameExistence(group.getDisplayName());
101  assignMetaInformation(group);
102  //Proceed with actual implementation of createGroup method
103  response=service.createGroup(group, attrsList, excludedAttrsList);
104  }
105  catch (DuplicateEntryException e){
106  log.error(e.getMessage());
107  response=getErrorResponse(Response.Status.CONFLICT, ErrorScimType.UNIQUENESS, e.getMessage());
108  }
109  catch (SCIMException e){
110  log.error("Validation check at createGroup returned: {}", e.getMessage());
111  response = getErrorResponse(Response.Status.BAD_REQUEST, ErrorScimType.INVALID_VALUE, e.getMessage());
112  }
113  return response;
114 
115  }
IGroupWebService service
Definition: GroupWebServiceDecorator.java:45
Logger log
Definition: GroupWebServiceDecorator.java:42
void assignMetaInformation(BaseScimResource resource)
Definition: BaseScimWebService.java:102
void executeDefaultValidation(BaseScimResource resource)
Definition: BaseScimWebService.java:118
Response createGroup(GroupResource group, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList)
static Response getErrorResponse(Response.Status status, String detail)
Definition: BaseScimWebService.java:75
void checkDisplayNameExistence(String displayName)
Definition: GroupWebServiceDecorator.java:63

◆ deleteGroup() [1/2]

Response org.gluu.oxtrust.ws.rs.scim2.IGroupWebService.deleteGroup ( @PathParam("id") String  id)
inherited

Removes a Group via DELETE HTTP method (see section 3.6 of RFC 7644).

引数
idThe "id" attribute of the resource to be removed
戻り値
An object abstracting the response obtained from the server to this request. A succesful response for this operation should contain a status code of 204 (no content)

org.gluu.oxtrust.ws.rs.scim2.GroupWebServiceで実装されています。

◆ deleteGroup() [2/2]

Response org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.deleteGroup ( String  id)
inline
161  {
162 
163  Response response=validateExistenceOfGroup(id);
164  if (response==null)
165  //Proceed with actual implementation of deleteGroup method
166  response= service.deleteGroup(id);
167 
168  return response;
169 
170  }
IGroupWebService service
Definition: GroupWebServiceDecorator.java:45
Response validateExistenceOfGroup(String id)
Definition: GroupWebServiceDecorator.java:50
Response deleteGroup(@PathParam("id") String id)

◆ executeDefaultValidation()

void org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.executeDefaultValidation ( BaseScimResource  resource) throws SCIMException
inlineprotectedinherited
118  {
119  executeValidation(resource, false);
120  }
void executeValidation(BaseScimResource resource, boolean skipRequired)
Definition: BaseScimWebService.java:122

◆ executeValidation()

void org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.executeValidation ( BaseScimResource  resource,
boolean  skipRequired 
) throws SCIMException
inlineprotectedinherited
122  {
123 
124  ResourceValidator rv=new ResourceValidator(resource, extService.getResourceExtensions(resource.getClass()));
125  if (!skipRequired){
126  rv.validateRequiredAttributes();
127  rv.validateSchemasAttribute();
128  }
129  rv.validateValidableAttributes();
130  //By section 7 of RFC 7643, we are not forced to constrain attribute values when they have a list of canonical values associated
131  //rv.validateCanonicalizedAttributes();
132  rv.validateExtendedAttributes();
133 
134  }
List< Extension > getResourceExtensions(Class<? extends BaseScimResource > cls)
Definition: ExtensionService.java:46
ExtensionService extService
Definition: BaseScimWebService.java:65

◆ getEndpointUrl()

String org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.getEndpointUrl ( )
inlineinherited
71  {
72  return endpointUrl;
73  }
String endpointUrl
Definition: BaseScimWebService.java:69

◆ getErrorResponse() [1/3]

static Response org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.getErrorResponse ( Response.Status  status,
String  detail 
)
inlinestaticinherited
75  {
76  return getErrorResponse(status.getStatusCode(), null, detail);
77  }
static Response getErrorResponse(Response.Status status, String detail)
Definition: BaseScimWebService.java:75

◆ getErrorResponse() [2/3]

static Response org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.getErrorResponse ( Response.Status  status,
ErrorScimType  scimType,
String  detail 
)
inlinestaticinherited
79  {
80  return getErrorResponse(status.getStatusCode(), scimType, detail);
81  }
static Response getErrorResponse(Response.Status status, String detail)
Definition: BaseScimWebService.java:75

◆ getErrorResponse() [3/3]

static Response org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.getErrorResponse ( int  statusCode,
ErrorScimType  scimType,
String  detail 
)
inlinestaticinherited
83  {
84 
85  ErrorResponse errorResponse = new ErrorResponse();
86  errorResponse.setStatus(String.valueOf(statusCode));
87  errorResponse.setScimType(scimType);
88  errorResponse.setDetail(detail);
89 
90  return Response.status(statusCode).entity(errorResponse).build();
91  }

◆ getGroupById() [1/2]

Response org.gluu.oxtrust.ws.rs.scim2.IGroupWebService.getGroupById ( @PathParam("id") String  id,
@QueryParam(QUERY_PARAM_ATTRIBUTES) String  attrsList,
@QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String  excludedAttrsList 
)
inherited

Service method that retrieves a Group resource using GET (as per section 3.4.1 of RFC 7644).

引数
idThe "id" attribute of the resource to retrieve
attrsListSee notes about attributes query param
excludedAttrsListSee notes about excludedAttributes query param
戻り値
An object abstracting the response obtained from the server to this request. A succesful response for this operation should contain a status code of 200 and a GroupResource in the entity body (the resource retrieved)

org.gluu.oxtrust.ws.rs.scim2.GroupWebServiceで実装されています。

◆ getGroupById() [2/2]

Response org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.getGroupById ( String  id,
String  attrsList,
String  excludedAttrsList 
)
inline
117  {
118 
119  Response response=validateExistenceOfGroup(id);
120  if (response==null)
121  //Proceed with actual implementation of getGroupById method
122  response=service.getGroupById(id, attrsList, excludedAttrsList);
123 
124  return response;
125 
126  }
IGroupWebService service
Definition: GroupWebServiceDecorator.java:45
Response validateExistenceOfGroup(String id)
Definition: GroupWebServiceDecorator.java:50
Response getGroupById( @PathParam("id") String id, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList)

◆ getListResponseSerialized()

String org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.getListResponseSerialized ( int  total,
int  startIndex,
List< BaseScimResource resources,
String  attrsList,
String  excludedAttrsList,
boolean  ignoreResults 
) throws IOException
inlinepackageinherited
203  {
204 
205  ListResponse listResponse = new ListResponse(startIndex, resources.size(), total);
206  listResponse.setResources(resources);
207 
208  ObjectMapper mapper = new ObjectMapper();
209  SimpleModule module = new SimpleModule("ListResponseModule", Version.unknownVersion());
210  module.addSerializer(ListResponse.class, new ListResponseJsonSerializer(resourceSerializer, attrsList, excludedAttrsList, ignoreResults));
211  mapper.registerModule(module);
212 
213  return mapper.writeValueAsString(listResponse);
214 
215  }
ScimResourceSerializer resourceSerializer
Definition: BaseScimWebService.java:62

◆ getMaxCount()

int org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.getMaxCount ( )
inlinepackageinherited
93  {
94  return appConfiguration.getScimProperties().getMaxCount();
95  }
AppConfiguration appConfiguration
Definition: BaseScimWebService.java:59

◆ getValueFromHeaders()

String org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.getValueFromHeaders ( HttpHeaders  headers,
String  name 
)
inlinepackageinherited
97  {
98  List<String> values=headers.getRequestHeaders().get(name);
99  return (values==null || values.size()==0) ? null : values.get(0);
100  }

◆ inspectPatchRequest()

Response org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.inspectPatchRequest ( PatchRequest  patch,
Class<? extends BaseScimResource cls 
)
inlineprotectedinherited
217  {
218 
219  Response response=null;
220  List<String> schemas=patch.getSchemas();
221 
222  if (schemas!=null && schemas.size()==1 && schemas.get(0).equals(PATCH_REQUEST_SCHEMA_ID)) {
223  List<PatchOperation> ops = patch.getOperations();
224 
225  if (ops != null) {
226  //Adjust paths if they came prefixed
227 
228  String defSchema=ScimResourceUtil.getDefaultSchemaUrn(cls);
229  List<String> urns=extService.getUrnsOfExtensions(cls);
230  urns.add(defSchema);
231 
232  for (PatchOperation op : ops){
233  if (op.getPath()!=null)
234  op.setPath(ScimResourceUtil.adjustNotationInPath(op.getPath(), defSchema, urns));
235  }
236 
237  for (PatchOperation op : ops) {
238 
239  if (op.getType() == null)
240  response = getErrorResponse(BAD_REQUEST, ErrorScimType.INVALID_SYNTAX, "Operation '" + op.getOperation() + "' not recognized");
241  else {
242  String path = op.getPath();
243 
244  if (StringUtils.isEmpty(path) && op.getType().equals(PatchOperationType.REMOVE))
245  response = getErrorResponse(BAD_REQUEST, ErrorScimType.NO_TARGET, "Path attribute is required for remove operation");
246  else
247  if (op.getValue() == null && !op.getType().equals(PatchOperationType.REMOVE))
248  response = getErrorResponse(BAD_REQUEST, ErrorScimType.INVALID_SYNTAX, "Value attribute is required for operations other than remove");
249  }
250  if (response != null)
251  break;
252  }
253  }
254  else
255  response = getErrorResponse(BAD_REQUEST, ErrorScimType.INVALID_SYNTAX, "Patch request MUST contain the attribute 'Operations'");
256  }
257  else
258  response = getErrorResponse(BAD_REQUEST, ErrorScimType.INVALID_SYNTAX, "Wrong schema(s) supplied in Search Request");
259 
260  log.info("inspectPatchRequest. Preprocessing of patch request {}", response==null ? "passed" : "failed");
261  return response;
262 
263  }
Logger log
Definition: BaseScimWebService.java:56
static Response getErrorResponse(Response.Status status, String detail)
Definition: BaseScimWebService.java:75
ExtensionService extService
Definition: BaseScimWebService.java:65
List< String > getUrnsOfExtensions(Class<? extends BaseScimResource > cls)
Definition: ExtensionService.java:86

◆ patchGroup() [1/2]

Response org.gluu.oxtrust.ws.rs.scim2.IGroupWebService.patchGroup ( PatchRequest  request,
@PathParam("id") String  id,
@QueryParam(QUERY_PARAM_ATTRIBUTES) String  attrsList,
@QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String  excludedAttrsList 
)
inherited

Service method that allows to modify a Group resource via PATCH (see section 3.5.2 of RFC 7644).

Note that patching offers a fine-grained control over the attributes to modify. While PUT is more intended to replace attribute values, PATCH allows to perform localized updates, removals and additions in certain portions of the target resource.

引数
requestA PatchRequest that contains the operations to apply upon the resource being updated
idThe id of the resource to update
attrsListSee notes about attributes query param
excludedAttrsListSee notes about excludedAttributes query param
戻り値
An object abstracting the response obtained from the server to this request. A succesful response for this operation should contain a status code of 200 and a GroupResource in the entity body (the resource after modifications took place)

org.gluu.oxtrust.ws.rs.scim2.GroupWebServiceで実装されています。

◆ patchGroup() [2/2]

Response org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.patchGroup ( PatchRequest  request,
String  id,
String  attrsList,
String  excludedAttrsList 
)
inline
201  {
202 
203  Response response=inspectPatchRequest(request, GroupResource.class);
204  if (response==null) {
205  response=validateExistenceOfGroup(id);
206 
207  if (response==null)
208  response = service.patchGroup(request, id, attrsList, excludedAttrsList);
209  }
210  return response;
211 
212  }
IGroupWebService service
Definition: GroupWebServiceDecorator.java:45
Response validateExistenceOfGroup(String id)
Definition: GroupWebServiceDecorator.java:50
Response inspectPatchRequest(PatchRequest patch, Class<? extends BaseScimResource > cls)
Definition: BaseScimWebService.java:217
Response patchGroup(PatchRequest request, @PathParam("id") String id, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList)

◆ prepareSearchRequest()

Response org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.prepareSearchRequest ( List< String >  schemas,
String  filter,
String  sortBy,
String  sortOrder,
Integer  startIndex,
Integer  count,
String  attrsList,
String  excludedAttrsList,
SearchRequest  request 
)
inlineprotectedinherited
167  {
168 
169  Response response=null;
170 
171  if (schemas!=null && schemas.size()==1 && schemas.get(0).equals(SEARCH_REQUEST_SCHEMA_ID)) {
172  count = count == null ? getMaxCount() : count;
173  //Per spec, a negative value SHALL be interpreted as "0" for count
174  if (count<0)
175  count=0;
176 
177  if (count <= getMaxCount()) {
178  startIndex = (startIndex == null || startIndex < 1) ? 1 : startIndex;
179 
180  if (StringUtils.isEmpty(sortOrder) || !sortOrder.equals(SortOrder.DESCENDING.getValue()))
181  sortOrder = SortOrder.ASCENDING.getValue();
182 
183  request.setSchemas(schemas);
184  request.setAttributes(attrsList);
185  request.setExcludedAttributes(excludedAttrsList);
186  request.setFilter(filter);
187  request.setSortBy(sortBy);
188  request.setSortOrder(sortOrder);
189  request.setStartIndex(startIndex);
190  request.setCount(count);
191  }
192  else
193  response = getErrorResponse(BAD_REQUEST, ErrorScimType.TOO_MANY, "Maximum number of results per page is " + getMaxCount());
194  }
195  else
196  response = getErrorResponse(BAD_REQUEST, ErrorScimType.INVALID_SYNTAX, "Wrong schema(s) supplied in Search Request");
197 
198  return response;
199 
200  }
int getMaxCount()
Definition: BaseScimWebService.java:93
static Response getErrorResponse(Response.Status status, String detail)
Definition: BaseScimWebService.java:75

◆ searchGroups() [1/2]

Response org.gluu.oxtrust.ws.rs.scim2.IGroupWebService.searchGroups ( @QueryParam(QUERY_PARAM_FILTER) String  filter,
@QueryParam(QUERY_PARAM_START_INDEX) Integer  startIndex,
@QueryParam(QUERY_PARAM_COUNT) Integer  count,
@QueryParam(QUERY_PARAM_SORT_BY) String  sortBy,
@QueryParam(QUERY_PARAM_SORT_ORDER) String  sortOrder,
@QueryParam(QUERY_PARAM_ATTRIBUTES) String  attrsList,
@QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String  excludedAttrsList 
)
inherited

Sends a search query for Group resources using GET (see section 3.4.2 of RFC 7644).

引数
filterA filter expression so that the search will return only those resources matching the expression. To learn more about SCIM filter expressions and operators, see section 3.4.2.2 of RFC 7644.
startIndexThe 1-based index of the first query result. If a negative integer or null is provided, the search is performed as if 1 was provided as value.
countSpecifies the desired maximum number of query results per page the response must include. If null is provided, the maximum supported by the server is used. If count is zero, this is interpreted as no results should be included (only the total amount is). If a negative number is supplied, the search is performed as if zero was provided as value.
sortBySpecifies the attribute whose value will be used to order the returned resources. If sortBy is null the results will be sorted by userName attribute.
sortOrderThe order in which the sortBy parameter is applied. Allowed values are "ascending" or "descending", being "ascending" the default if null or an unknown value is passed.
attrsListSee notes about attributes query param
excludedAttrsListSee notes about excludedAttributes query param
戻り値
An object abstracting the response obtained from the server to this request. A succesful response for this operation should contain a status code of 200 and a ListResponse in the entity body (holding a collection of SCIM resources)

org.gluu.oxtrust.ws.rs.scim2.GroupWebServiceで実装されています。

◆ searchGroups() [2/2]

Response org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.searchGroups ( String  filter,
Integer  startIndex,
Integer  count,
String  sortBy,
String  sortOrder,
String  attrsList,
String  excludedAttrsList 
)
inline
173  {
174 
175  SearchRequest searchReq=new SearchRequest();
176  Response response=prepareSearchRequest(searchReq.getSchemas(), filter, sortBy, sortOrder, startIndex, count,
177  attrsList, excludedAttrsList, searchReq);
178 
179  if (response==null) {
180  response = service.searchGroups(searchReq.getFilter(), searchReq.getStartIndex(), searchReq.getCount(),
181  searchReq.getSortBy(), searchReq.getSortOrder(), searchReq.getAttributesStr(), searchReq.getExcludedAttributesStr());
182  }
183  return response;
184 
185  }
IGroupWebService service
Definition: GroupWebServiceDecorator.java:45
Response searchGroups( @QueryParam(QUERY_PARAM_FILTER) String filter, @QueryParam(QUERY_PARAM_START_INDEX) Integer startIndex, @QueryParam(QUERY_PARAM_COUNT) Integer count, @QueryParam(QUERY_PARAM_SORT_BY) String sortBy, @QueryParam(QUERY_PARAM_SORT_ORDER) String sortOrder, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList)
Response prepareSearchRequest(List< String > schemas, String filter, String sortBy, String sortOrder, Integer startIndex, Integer count, String attrsList, String excludedAttrsList, SearchRequest request)
Definition: BaseScimWebService.java:166

◆ searchGroupsPost()

Response org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.searchGroupsPost ( SearchRequest  searchRequest)
inline

org.gluu.oxtrust.ws.rs.scim2.IGroupWebServiceを実装しています。

187  {
188 
189  SearchRequest searchReq=new SearchRequest();
190  Response response=prepareSearchRequest(searchRequest.getSchemas(), searchRequest.getFilter(), searchRequest.getSortBy(),
191  searchRequest.getSortOrder(), searchRequest.getStartIndex(), searchRequest.getCount(),
192  searchRequest.getAttributesStr(), searchRequest.getExcludedAttributesStr(), searchReq);
193 
194  if (response==null) {
195  response = service.searchGroupsPost(searchReq);
196  }
197  return response;
198 
199  }
IGroupWebService service
Definition: GroupWebServiceDecorator.java:45
Response prepareSearchRequest(List< String > schemas, String filter, String sortBy, String sortOrder, Integer startIndex, Integer count, String attrsList, String excludedAttrsList, SearchRequest request)
Definition: BaseScimWebService.java:166
Response searchGroupsPost(SearchRequest searchRequest)

◆ translateSortByAttribute()

String org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.translateSortByAttribute ( Class<? extends BaseScimResource cls,
String  sortBy 
)
inlinepackageinherited
137  {
138 
139  String type=ScimResourceUtil.getType(cls);
140  if (StringUtils.isEmpty(sortBy) || type==null)
141  sortBy=null;
142  else {
143  if (extService.extensionOfAttribute(cls, sortBy)==null) { //It's not a custom attribute...
144 
145  sortBy=ScimResourceUtil.stripDefaultSchema(cls, sortBy);
146  Field f=IntrospectUtil.findFieldFromPath(cls, sortBy);
147 
148  if (f==null){ //Not recognized!
149  log.warn("SortBy parameter value '{}' was not recognized as a SCIM attribute for resource {} - sortBy will be ignored.", sortBy, type);
150  sortBy=null;
151  //return getErrorResponse(Response.Status.BAD_REQUEST, ErrorScimType.INVALID_PATH, "sortBy parameter value not recognized");
152  }
153  else {
154  sortBy = FilterUtil.getLdapAttributeOfResourceAttribute(sortBy, cls).getFirst();
155  if (sortBy==null)
156  log.warn("There is no LDAP attribute mapping to sortBy attribute provided - sortBy will be ignored.");
157  }
158  }
159  else
160  sortBy = sortBy.substring(sortBy.lastIndexOf(":")+1);
161  }
162  return sortBy;
163 
164  }
Extension extensionOfAttribute(Class<? extends BaseScimResource > cls, String attribute)
Definition: ExtensionService.java:147
Logger log
Definition: BaseScimWebService.java:56
ExtensionService extService
Definition: BaseScimWebService.java:65

◆ updateGroup() [1/2]

Response org.gluu.oxtrust.ws.rs.scim2.IGroupWebService.updateGroup ( GroupResource  group,
@PathParam("id") String  id,
@QueryParam(QUERY_PARAM_ATTRIBUTES) String  attrsList,
@QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String  excludedAttrsList 
)
inherited

Service method that allows updating a Group resource via PUT (as per section 3.5.1 of RFC 7644).

This operation is not suitable to delete/remove/nullify attributes. For this purpose you can use the PATCH operation instead. PUT is intended to do replacements using the (not-null) values supplied in fidoDeviceResource parameter.

To learn more about how the update works, read the replacement rules found at ScimResourceUtil#transferToResourceReplace.

引数
groupAn object that contains the data to update on a destination resource. There is no need to supply a full resource, just provide one with the attributes which are intended to be replaced in the destination
idThe "id" attribute of the resource to update (destination)
attrsListSee notes about attributes query param
excludedAttrsListSee notes about excludedAttributes query param
戻り値
An object abstracting the response obtained from the server to this request. A succesful response for this operation should contain a status code of 200 and a GroupResource in the entity body (the resource after the update took place)

◆ updateGroup() [2/2]

Response org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.updateGroup ( GroupResource  group,
String  id,
String  attrsList,
String  excludedAttrsList 
)
inline
128  {
129 
130  Response response;
131  try{
132  //empty externalId, no place to store it in LDAP
133  group.setExternalId(null);
134 
135  //Check if the ids match in case the group coming has one
136  if (group.getId()!=null && !group.getId().equals(id))
137  throw new SCIMException("Parameter id does not match with id attribute of Group");
138 
139  response=validateExistenceOfGroup(id);
140  if (response==null) {
141 
142  executeValidation(group, true);
143  if (StringUtils.isNotEmpty(group.getDisplayName()))
144  checkDisplayNameExistence(group.getDisplayName(), id);
145 
146  //Proceed with actual implementation of updateGroup method
147  response = service.updateGroup(group, id, attrsList, excludedAttrsList);
148  }
149  }
150  catch (DuplicateEntryException e){
151  log.error(e.getMessage());
152  response=getErrorResponse(Response.Status.CONFLICT, ErrorScimType.UNIQUENESS, e.getMessage());
153  }
154  catch (SCIMException e){
155  log.error("Validation check at updateGroup returned: {}", e.getMessage());
156  response = getErrorResponse(Response.Status.BAD_REQUEST, ErrorScimType.INVALID_VALUE, e.getMessage());
157  }
158  return response;
159  }
IGroupWebService service
Definition: GroupWebServiceDecorator.java:45
Logger log
Definition: GroupWebServiceDecorator.java:42
Response validateExistenceOfGroup(String id)
Definition: GroupWebServiceDecorator.java:50
void executeValidation(BaseScimResource resource, boolean skipRequired)
Definition: BaseScimWebService.java:122
static Response getErrorResponse(Response.Status status, String detail)
Definition: BaseScimWebService.java:75
void checkDisplayNameExistence(String displayName)
Definition: GroupWebServiceDecorator.java:63
Response updateGroup(GroupResource group, @PathParam("id") String id, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList)

◆ validateExistenceOfGroup()

Response org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.validateExistenceOfGroup ( String  id)
inlineprivate
50  {
51 
52  Response response=null;
53  GluuGroup group = StringUtils.isEmpty(id) ? null : groupService.getGroupByInum(id);
54 
55  if (group==null) {
56  log.info("Group with inum {} not found", id);
57  response = getErrorResponse(Response.Status.NOT_FOUND, "Resource " + id + " not found");
58  }
59  return response;
60 
61  }
Logger log
Definition: GroupWebServiceDecorator.java:42
abstract GluuGroup getGroupByInum(String inum)
IGroupService groupService
Definition: GroupWebServiceDecorator.java:48
static Response getErrorResponse(Response.Status status, String detail)
Definition: BaseScimWebService.java:75

メンバ詳解

◆ appConfiguration

AppConfiguration org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.appConfiguration
packageinherited

◆ endpointUrl

String org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.endpointUrl
packageinherited

◆ extService

ExtensionService org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.extService
packageinherited

◆ groupService

IGroupService org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.groupService
private

◆ log

Logger org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.log
private

◆ resourceSerializer

ScimResourceSerializer org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.resourceSerializer
packageinherited

◆ SEARCH_SUFFIX

final String org.gluu.oxtrust.ws.rs.scim2.BaseScimWebService.SEARCH_SUFFIX = ".search"
staticinherited

◆ service

IGroupWebService org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator.service
package

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