Class Schema
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonSerializable.Base
-
- com.fasterxml.jackson.databind.JsonNode
-
- com.fasterxml.jackson.databind.node.BaseJsonNode
-
- com.fasterxml.jackson.databind.node.ContainerNode<com.fasterxml.jackson.databind.node.ObjectNode>
-
- com.fasterxml.jackson.databind.node.ObjectNode
-
- de.captaingoldfish.scim.sdk.common.resources.base.ScimObjectNode
-
- de.captaingoldfish.scim.sdk.common.resources.AbstractSchemasHolder
-
- de.captaingoldfish.scim.sdk.common.resources.ResourceNode
-
- de.captaingoldfish.scim.sdk.common.schemas.Schema
-
- All Implemented Interfaces:
com.fasterxml.jackson.core.TreeNode,com.fasterxml.jackson.databind.JsonSerializable,com.fasterxml.jackson.databind.node.JsonNodeCreator,ScimNode,Serializable,Iterable<com.fasterxml.jackson.databind.JsonNode>
public class Schema extends ResourceNode
author Pascal Knueppel
created at: 03.10.2019 - 13:24
this class will represent a SCIM schema definition- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static SchemaAttributeSCHEMAS_ATTRIBUTEthe attribute definition for the schemas-attribute that is part of each schema
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(com.fasterxml.jackson.databind.JsonNode schemaAttribute)adds a new attribute definition to this schemavoidaddSchemaAttribute(SchemaAttribute schemaAttribute)allows the childSchemaAttributes to add themselves to this schema into theattributeRegisterSet<String>getAttributeNames()the names of the attributes of this schema inclusive the subattribute names.Map<String,SchemaAttribute>getAttributeRegister()this register shall be a simple reference map that is used for scim filter expressions to find the attributes fast without iterating again and again of the attributes list.
All attributes will be added with the value output of the methodSchemaAttribute.getScimNodeName()in lowercaseList<SchemaAttribute>getAttributes()gets the schema attributes of this schemaList<SchemaAttribute>getComplexBulkIdCandidates()this list will hold references to all schema attributes that might be used to set bulkId references in a bulk request.Optional<String>getDescription()The schema's human-readable description.Optional<String>getName()The schema's human-readable name.StringgetNonNullId()used explicitly for schema validation for easier code readingSchemaAttributegetSchemaAttribute(String scimNodeName)gets aSchemaAttributedefinition by its scimNodeName e.g.List<SchemaAttribute>getSimpleBulkIdCandidates()this list will hold references to all schema attributes that define itself as type 'reference' with 'referenceType=resource'.voidremoveAttribute(SchemaAttribute schemaAttribute)removes an attribute definition from this schema-
Methods inherited from class de.captaingoldfish.scim.sdk.common.resources.ResourceNode
getExternalId, getId, getMeta, getSortingAttribute, setExternalId, setId, setMeta
-
Methods inherited from class de.captaingoldfish.scim.sdk.common.resources.AbstractSchemasHolder
addSchema, getSchemas, removeSchema, setSchemas, setSchemas
-
Methods inherited from class de.captaingoldfish.scim.sdk.common.resources.base.ScimObjectNode
addAttribute, getArrayAttribute, getBooleanAttribute, getDateTimeAttribute, getDoubleAttribute, getIntegerAttribute, getLongAttribute, getObjectAttribute, getSchemaAttribute, getSimpleArrayAttribute, getSimpleArrayAttribute, getSimpleArrayAttributeSet, getSimpleArrayAttributeSet, getStringAttribute, getStringAttribute, isEmpty, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeList, setDateTimeAttribute, setDateTimeAttribute, setDateTimeAttribute, setDateTimeAttribute, setStringAttributeList, setStringAttributeList, toPrettyString, toString
-
Methods inherited from class com.fasterxml.jackson.databind.node.ObjectNode
_at, _childrenEqual, _put, asToken, deepCopy, elements, equals, equals, fieldNames, fields, findParent, findParents, findValue, findValues, findValuesAsText, get, get, getNodeType, hashCode, isEmpty, isObject, path, path, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, putArray, putIfAbsent, putNull, putObject, putPOJO, putRawValue, remove, remove, removeAll, replace, required, retain, retain, serialize, serializeWithType, set, setAll, setAll, size, with, withArray, without, without
-
Methods inherited from class com.fasterxml.jackson.databind.node.ContainerNode
arrayNode, arrayNode, asText, binaryNode, binaryNode, booleanNode, missingNode, nullNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, objectNode, pojoNode, rawValueNode, textNode
-
Methods inherited from class com.fasterxml.jackson.databind.node.BaseJsonNode
findPath, numberType, required, traverse, traverse
-
Methods inherited from class com.fasterxml.jackson.databind.JsonNode
_reportRequiredViolation, _this, asBoolean, asBoolean, asDouble, asDouble, asInt, asInt, asLong, asLong, asText, at, at, bigIntegerValue, binaryValue, booleanValue, canConvertToExactIntegral, canConvertToInt, canConvertToLong, decimalValue, doubleValue, findParents, findValues, findValuesAsText, floatValue, has, has, hasNonNull, hasNonNull, intValue, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainerNode, isDouble, isFloat, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isMissingNode, isNull, isNumber, isPojo, isShort, isTextual, isValueNode, iterator, longValue, numberValue, require, requiredAt, requiredAt, requireNonNull, shortValue, textValue
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface de.captaingoldfish.scim.sdk.common.resources.base.ScimNode
getAttributeDescription, getAttributeName, getCanonicalValues, getMutability, getReferenceTypes, getReturned, getScimNodeName, getUniqueness, getValueType, isCaseExact, isMultiValued, isRequired
-
-
-
-
Field Detail
-
SCHEMAS_ATTRIBUTE
public static final SchemaAttribute SCHEMAS_ATTRIBUTE
the attribute definition for the schemas-attribute that is part of each schema
-
-
Constructor Detail
-
Schema
public Schema(com.fasterxml.jackson.databind.JsonNode jsonNode, String namePrefix)
-
Schema
public Schema(com.fasterxml.jackson.databind.JsonNode jsonNode)
-
Schema
public Schema()
-
-
Method Detail
-
getNonNullId
public String getNonNullId()
used explicitly for schema validation for easier code reading
-
getName
public Optional<String> getName()
The schema's human-readable name. When applicable, service providers MUST specify the name, e.g., "User" or "Group". OPTIONAL.
-
getDescription
public Optional<String> getDescription()
The schema's human-readable description. When applicable, service providers MUST specify the description. OPTIONAL.
-
getAttributes
public List<SchemaAttribute> getAttributes()
gets the schema attributes of this schema
-
addAttribute
public void addAttribute(com.fasterxml.jackson.databind.JsonNode schemaAttribute)
adds a new attribute definition to this schema
-
getAttributeNames
public Set<String> getAttributeNames()
the names of the attributes of this schema inclusive the subattribute names. Subattributes will be displayed in their scimNodeName notation separated with a dot e.g. "name.givenName"- Returns:
- a set of attributes that belongs to this schema
-
removeAttribute
public void removeAttribute(SchemaAttribute schemaAttribute)
removes an attribute definition from this schema
-
getSchemaAttribute
public SchemaAttribute getSchemaAttribute(String scimNodeName)
gets aSchemaAttributedefinition by its scimNodeName e.g. "userName" or "name.givenName".
This method is for resolving filter expressions and therefore thescimNodeNamevalues are evaluated as case-insensitive. It is also allowed to use the complete schema-uri as prefix before the attributes name
Attribute names and attribute operators used in filters are case insensitive. For example, the following two expressions will evaluate to the same logical value: filter=userName Eq "john" filter=Username eq "john"
-
addSchemaAttribute
public void addSchemaAttribute(SchemaAttribute schemaAttribute)
allows the childSchemaAttributes to add themselves to this schema into theattributeRegister
-
getAttributeRegister
public Map<String,SchemaAttribute> getAttributeRegister()
this register shall be a simple reference map that is used for scim filter expressions to find the attributes fast without iterating again and again of the attributes list.
All attributes will be added with the value output of the methodSchemaAttribute.getScimNodeName()in lowercase
-
getComplexBulkIdCandidates
public List<SchemaAttribute> getComplexBulkIdCandidates()
this list will hold references to all schema attributes that might be used to set bulkId references in a bulk request. The condition to get added into this list for an attribute is: be of typeType.COMPLEX, mutability of other thanMutability.READ_ONLYand define the following three attributes:AttributeNames.RFC7643.VALUE,AttributeNames.RFC7643.TYPEandAttributeNames.RFC7643.REFas a resource-reference
-
getSimpleBulkIdCandidates
public List<SchemaAttribute> getSimpleBulkIdCandidates()
this list will hold references to all schema attributes that define itself as type 'reference' with 'referenceType=resource'. Such reference fields will then also be usable for bulkId-resolving and such fields must possess an additional attribute 'resourceType=${resourceName}' (name of the resourceType not resource) in order to make the resource accessible by the bulk endpoint.
The condition to get added into this list for an attribute is: be of type other thanType.COMPLEX, mutability of other thanMutability.READ_ONLYand by of typeType.REFERENCEand of referenceTypeReferenceTypes.RESOURCEand define the custom-attributeAttributeNames.Custom.RESOURCE_TYPE_REFERENCE_NAME{ "name": "userId", "type": "reference", "referenceTypes": [ "resource" ] "resourceType": "User" }
-
-