/** * Create a new replace patch operation. * * @param path The path targeted by this patch operation. * @param value The value(s) to replace. * @throws ScimException If a value is not valid. */ @JsonCreator private ReplaceOperation( @JsonProperty(value = "path") final Path path, @JsonProperty(value = "value", required = true) final JsonNode value) throws ScimException { super(path); if(value == null || value.isNull() || ((value.isArray() || value.isObject()) && value.size() == 0)) { throw BadRequestException.invalidSyntax( "value field must not be null or an empty container"); } if(path == null && !value.isObject()) { throw BadRequestException.invalidSyntax( "value field must be a JSON object containing the attributes to " + "replace"); } this.value = value; }
/** * Create a new replace patch operation. * * @param path The path targeted by this patch operation. * @param value The value(s) to replace. * @throws ScimException If a value is not valid. */ @JsonCreator private ReplaceOperation( @JsonProperty(value = "path") final Path path, @JsonProperty(value = "value", required = true) final JsonNode value) throws ScimException { super(path); if(value == null || value.isNull() || ((value.isArray() || value.isObject()) && value.size() == 0)) { throw BadRequestException.invalidSyntax( "value field must not be null or an empty container"); } if(path == null && !value.isObject()) { throw BadRequestException.invalidSyntax( "value field must be a JSON object containing the attributes to " + "replace"); } this.value = value; }
/** * finds the sort order by name. * * @param name the name of the mutability constraint. * @return the enum value for the given name. * @throws BadRequestException if the name of the sort order is invalid. */ @JsonCreator public static SortOrder fromName(final String name) throws BadRequestException { for(SortOrder sortOrder : SortOrder.values()) { if(sortOrder.getName().equals(name)) { return sortOrder; } } throw BadRequestException.invalidSyntax( "Unknown sort order value " + name); } }
((value.isArray() || value.isObject()) && value.size() == 0)) throw BadRequestException.invalidSyntax( "value field must not be null or an empty container"); throw BadRequestException.invalidSyntax( "value field must be a JSON object containing the attributes to " + "add");
/** * finds the uniqueness constraint by name. Throws a runtime * exception if the constraint cannot be found because an invalid * name was given. * * @param name the name of the uniqueness constraint. * @return the enum value for the given name. * @throws BadRequestException if the name of the uniqueness constraint is * invalid. */ @JsonCreator public static Uniqueness fromName(final String name) throws BadRequestException { for(Uniqueness uniqueness : Uniqueness.values()) { if(uniqueness.getName().equalsIgnoreCase(name)) { return uniqueness; } } throw BadRequestException.invalidSyntax( "Unknown SCIM uniquenessConstraint"); }
((value.isArray() || value.isObject()) && value.size() == 0)) throw BadRequestException.invalidSyntax( "value field must not be null or an empty container"); throw BadRequestException.invalidSyntax( "value field must be a JSON object containing the attributes to " + "add");
/** * finds the return constraint by name. Throws a runtime * exception if the constraint cannot be found because an invalid * name was given. * * @param name the name of the return constraint. * @return the enum value for the given name. * @throws BadRequestException if the name of the return constraint is * invalid. */ @JsonCreator public static Returned fromName(final String name) throws BadRequestException { for(Returned returned : Returned.values()) { if(returned.getName().equalsIgnoreCase(name)) { return returned; } } throw BadRequestException.invalidSyntax("Unknown SCIM return constraint"); }
/** * finds the sort order by name. * * @param name the name of the mutability constraint. * @return the enum value for the given name. * @throws BadRequestException if the name of the sort order is invalid. */ @JsonCreator public static SortOrder fromName(final String name) throws BadRequestException { for(SortOrder sortOrder : SortOrder.values()) { if(sortOrder.getName().equals(name)) { return sortOrder; } } throw BadRequestException.invalidSyntax( "Unknown sort order value " + name); } }
/** * finds the mutability constraint by name. Throws a runtime * exception if the constraint cannot be found because an invalid * name was given. * * @param name the name of the mutability constraint. * @return the enum value for the given name. * @throws BadRequestException if the name of the mutability constraint is * invalid. */ @JsonCreator public static Mutability fromName(final String name) throws BadRequestException { for(Mutability mutability : Mutability.values()) { if(mutability.getName().equalsIgnoreCase(name)) { return mutability; } } throw BadRequestException.invalidSyntax( "Unknown SCIM mutability constraint"); }
/** * finds the uniqueness constraint by name. Throws a runtime * exception if the constraint cannot be found because an invalid * name was given. * * @param name the name of the uniqueness constraint. * @return the enum value for the given name. * @throws BadRequestException if the name of the uniqueness constraint is * invalid. */ @JsonCreator public static Uniqueness fromName(final String name) throws BadRequestException { for(Uniqueness uniqueness : Uniqueness.values()) { if(uniqueness.getName().equalsIgnoreCase(name)) { return uniqueness; } } throw BadRequestException.invalidSyntax( "Unknown SCIM uniquenessConstraint"); }
throw BadRequestException.invalidSyntax(message);
throw BadRequestException.invalidSyntax(message);
/** * finds the return constraint by name. Throws a runtime * exception if the constraint cannot be found because an invalid * name was given. * * @param name the name of the return constraint. * @return the enum value for the given name. * @throws BadRequestException if the name of the return constraint is * invalid. */ @JsonCreator public static Returned fromName(final String name) throws BadRequestException { for(Returned returned : Returned.values()) { if(returned.getName().equalsIgnoreCase(name)) { return returned; } } throw BadRequestException.invalidSyntax("Unknown SCIM return constraint"); }
/** * finds the mutability constraint by name. Throws a runtime * exception if the constraint cannot be found because an invalid * name was given. * * @param name the name of the mutability constraint. * @return the enum value for the given name. * @throws BadRequestException if the name of the mutability constraint is * invalid. */ @JsonCreator public static Mutability fromName(final String name) throws BadRequestException { for(Mutability mutability : Mutability.values()) { if(mutability.getName().equalsIgnoreCase(name)) { return mutability; } } throw BadRequestException.invalidSyntax( "Unknown SCIM mutability constraint"); }
/** * Throws an exception if there are schema validation errors. The exception * will contain all of the syntax errors, mutability errors or path issues * (in that order of precedence). The exception message will be the content * of baseExceptionMessage followed by a space delimited list of all of the * issues of the type (syntax, mutability, or path) being reported. * * @throws BadRequestException if issues are found during schema checking. */ public void throwSchemaExceptions() throws BadRequestException { if(syntaxIssues.size() > 0) { throw BadRequestException.invalidSyntax(getErrorString(syntaxIssues)); } if(mutabilityIssues.size() > 0) { throw BadRequestException.mutability(getErrorString(mutabilityIssues)); } if(pathIssues.size() > 0) { throw BadRequestException.invalidPath(getErrorString(pathIssues)); } if(filterIssues.size() > 0) { throw BadRequestException.invalidFilter(getErrorString(filterIssues)); } }
BadRequestException.invalidSyntax(builder.toString()).getScimError();