/** * Create a new add patch operation. * * @param value The value(s) to add. * * @return The new add patch operation. */ public static PatchOperation add(final JsonNode value) { return add((Path) null, value); }
/** * {@inheritDoc} */ @Override public String getMessage() { return scimError.getDetail(); }
/** * Retrieves a string representation of this operation type. * * @return A string representation of this operation type. */ public String toString() { return getStringValue(); } }
/** * Create a new SCIM exception from the provided information. * * @param statusCode The HTTP status code for this SCIM exception. * @param scimType The SCIM detailed error keyword. * @param errorMessage The error message for this SCIM exception. */ public ScimException(final int statusCode, final String scimType, final String errorMessage) { scimError = new ErrorResponse(statusCode); scimError.setScimType(scimType); scimError.setDetail(errorMessage); }
/** * Create a new remove patch operation. * * @param path The path targeted by this patch operation. * * @return The new delete patch operation. * @throws ScimException If the path is invalid. */ public static PatchOperation remove(final String path) throws ScimException { return remove(Path.fromString(path)); }
/** * Create a new replace patch operation. * * @param value The value(s) to replace. The value(s) must not be {@code null}. * * @return The new replace patch operation. */ public static PatchOperation replace(final ObjectNode value) { return replace((Path) null, value); }
/** * {@inheritDoc} */ @Override public Iterator<PatchOperation> iterator() { return getOperations().iterator(); }
private ErrorResponse errorResponse() { return new ErrorResponse(Response.Status.BAD_REQUEST.getStatusCode()); } }
/** * Create a new SCIM exception from the provided information. * * @param statusCode The HTTP status code for this SCIM exception. * @param scimType The SCIM detailed error keyword. * @param errorMessage The error message for this SCIM exception. */ public ScimException(final int statusCode, final String scimType, final String errorMessage) { scimError = new ErrorResponse(statusCode); scimError.setScimType(scimType); scimError.setDetail(errorMessage); }
/** * Remove all values of the attribute specified by the path. * * @param path The path to the attribute whose value to remove. * @return This patch operation request. * @throws ScimException If the path is invalid. */ public T removeValues(final Path path) throws ScimException { return addOperation(PatchOperation.remove(path)); }
/** * Create a new add patch operation. * * @param value The value(s) to add. * * @return The new add patch operation. */ public static PatchOperation add(final JsonNode value) { return add((Path) null, value); }
/** * Create a new replace patch operation. * * @param value The value(s) to replace. The value(s) must not be {@code null}. * * @return The new replace patch operation. */ public static PatchOperation replace(final ObjectNode value) { return replace((Path) null, value); }
/** * {@inheritDoc} */ @Override public String getMessage() { return scimError.getDetail(); }
/** * {@inheritDoc} */ @Override public Iterator<PatchOperation> iterator() { return getOperations().iterator(); }
/** * Retrieves a string representation of this operation type. * * @return A string representation of this operation type. */ public String toString() { return getStringValue(); } }
/** * Create a new remove patch operation. * * @param path The path targeted by this patch operation. * * @return The new delete patch operation. * @throws ScimException If the path is invalid. */ public static PatchOperation remove(final String path) throws ScimException { return remove(Path.fromString(path)); }
/** * {@inheritDoc} */ @Override public void apply(final ObjectNode node) throws ScimException { JsonUtils.removeValues(getPath(), node); }
/** * {@inheritDoc} */ @Override public void apply(final ObjectNode node) throws ScimException { JsonUtils.removeValues(getPath(), node); }