public final class RequestUtils extends Object
| Constructor and Description |
|---|
RequestUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<SchemaAttribute> |
getAttributes(ResourceType resourceType,
String attributes)
this method will parse either the attributes parameter or the excludedAttributes parameter into a list of
SchemaAttributes. |
static List<String> |
getAttributes(String attributes)
this method will parse either the attributes parameter or the excludedAttributes parameter into a list.
|
static int |
getEffectiveCount(ServiceProvider serviceProvider,
Integer count)
Will get the effective count value as described in RFC7644:
Non-negative integer. |
static int |
getEffectiveFailOnErrors(BulkRequest bulkRequest)
will check the failOnErrors attribute in a bulk request and return a sanitized value.
|
static long |
getEffectiveStartIndex(Long startIndex)
The 1-based index of the first query result.
|
static Map<String,String> |
getQueryParameters(String query)
gets the query parameter from the given URL
|
static SchemaAttribute |
getSchemaAttributeByAttributeName(ResourceType resourceType,
String attributeName)
gets the
SchemaAttribute from the given ResourceType |
static SchemaAttribute |
getSchemaAttributeForFilter(ResourceType resourceType,
FilterAttributeName attributeName)
gets the
SchemaAttribute from the given ResourceType |
static FilterNode |
parseFilter(ResourceType resourceType,
String filter)
parsed the filter of a list request
|
static AttributePathRoot |
parsePatchPath(ResourceType resourceType,
String path)
parses a value path context for patch path expressions
|
static void |
validateAttributesAndExcludedAttributes(String attributes,
String excludedAttributes)
From RFC7644 chapter 3.9:
Clients MAY request a partial resource representation on any operation that returns a resource within the response by specifying either of the mutually exclusive URL query parameters "attributes" or "excludedAttributes" so only one these parameters are allowed to be specified in a request |
public static List<String> getAttributes(String attributes)
attributes - the comma separated string of scim attribute namespublic static List<SchemaAttribute> getAttributes(ResourceType resourceType, String attributes)
SchemaAttributes. The expected form of the attributes list is: form (e.g., userName, name, emails)attributes - the comma separated string of scim attribute namespublic static void validateAttributesAndExcludedAttributes(String attributes, String excludedAttributes)
Clients MAY request a partial resource representation on any
operation that returns a resource within the response by specifying
either of the mutually exclusive URL query parameters "attributes" or
"excludedAttributes"
so only one these parameters are allowed to be specified in a requestattributes - the required attributes that should be present in the responseexcludedAttributes - the attributes that should not be returned in the responsepublic static FilterNode parseFilter(ResourceType resourceType, String filter)
resourceType - the resource type that describes the endpoint on which the filter is used so that the
filter expression can be correctly resolvedfilter - the filter expression that must apply to the given resource typepublic static AttributePathRoot parsePatchPath(ResourceType resourceType, String path)
resourceType - the resource type that describes the endpoint on which the path expression is usedpath - the path expression that must apply to the given resource typepublic static long getEffectiveStartIndex(Long startIndex)
startIndex - the index to start with to list the resourcespublic static int getEffectiveCount(ServiceProvider serviceProvider, Integer count)
public static SchemaAttribute getSchemaAttributeByAttributeName(ResourceType resourceType, String attributeName)
SchemaAttribute from the given ResourceTyperesourceType - the resource type from which the attribute definition should be extractedattributeName - this instance holds the attribute name to extract the SchemaAttribute from the
ResourceTypeSchemaAttribute definitionBadRequestException - if no SchemaAttribute was found for the given name attributepublic static SchemaAttribute getSchemaAttributeForFilter(ResourceType resourceType, FilterAttributeName attributeName)
SchemaAttribute from the given ResourceTyperesourceType - the resource type from which the attribute definition should be extractedattributeName - this instance holds the attribute name to extract the SchemaAttribute from the
ResourceTypeSchemaAttribute definitionInvalidFilterException - if no SchemaAttribute was found for the given name attributepublic static Map<String,String> getQueryParameters(String query)
query - the query stringpublic static int getEffectiveFailOnErrors(BulkRequest bulkRequest)
The "failOnErrors" attribute is set to '1', indicating that the service provider will stop processing and return results after one error
bulkRequest - the bulk requestCopyright © 2019. All rights reserved.