bdemers commented on code in PR #411:
URL: https://github.com/apache/directory-scimple/pull/411#discussion_r1401218712
##########
scim-core/src/main/java/org/apache/directory/scim/core/repository/Repository.java:
##########
@@ -60,14 +63,31 @@ public interface Repository<T extends ScimResource> {
/**
* Allows the SCIM server's REST implementation to update and existing
* resource via a PUT to a valid end-point.
- *
- * @param updateRequest The ScimResource to update and persist.
+ *
+ * @param id the identifier of the ScimResource to update and persist.
+ * @param version an optional version (usually used as an ETag) that be used
to optimize update requests, may be compared against, the current {@code
ScimResource.meta.version}.
+ * @param resource an updated resource to persist
+ * @param includedAttributes optional set of attributes to include from
ScimResource, may be used to optimize queries.
+ * @param excludedAttributes optional set of attributes to exclude from
ScimResource, may be used to optimize queries.
* @return The newly updated ScimResource.
- * @throws ResourceException When the ScimResource cannot be
- * updated.
+ * @throws ResourceException When the ScimResource cannot be updated.
*/
- T update(UpdateRequest<T> updateRequest) throws ResourceException;
-
+ T update(String id, String version, T resource, Set<AttributeReference>
includedAttributes, Set<AttributeReference> excludedAttributes) throws
ResourceException;
+
+ /**
+ * Allows the SCIM server's REST implementation to update and existing
Review Comment:
Thanks!
##########
scim-server/src/main/java/org/apache/directory/scim/server/rest/BaseResourceTypeResourceImpl.java:
##########
@@ -382,35 +358,51 @@ private ScimException notFoundException(String id) {
return new ScimException(Status.NOT_FOUND, "Resource " + id + " not
found");
}
- private void validatePreconditions(String id, EntityTag etag) {
- ResponseBuilder response = request.evaluatePreconditions(etag);
- if (response != null) {
- throw new WebApplicationException(response
- .entity(new ErrorResponse(Status.PRECONDITION_FAILED, "Failed to
update record, backing record has changed - " + id))
- .build());
- }
- }
+// private void validatePreconditions(String id, EntityTag etag) {
+// ResponseBuilder response = request.evaluatePreconditions(etag);
+// if (response != null) {
+// throw new WebApplicationException(response
+// .entity(new ErrorResponse(Status.PRECONDITION_FAILED, "Failed to
update record, backing record has changed - " + id))
+// .build());
+// }
+// }
+//
+// private EntityTag requireEtag(ScimResource resource) throws ScimException {
+// try {
+// return etagGenerator.generateEtag(resource);
+// } catch (EtagGenerationException e) {
+// throw new ScimException(Status.INTERNAL_SERVER_ERROR, "Failed to
generate the etag", e);
+// }
+// }
+//
+// private EntityTag etag(ScimResource resource) {
+// try {
+// return etagGenerator.generateEtag(resource);
+// } catch (EtagGenerationException e) {
+// log.warn("Failed to generate etag for resource", e);
+// return null;
+// }
+// }
Review Comment:
Removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]