Class 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 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 a SchemaAttribute definition by its scimNodeName e.g. "userName" or "name.givenName".

        This method is for resolving filter expressions and therefore the scimNodeName values 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"
         
      • 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 method SchemaAttribute.getScimNodeName() in lowercase
      • 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 than Type.COMPLEX, mutability of other than Mutability.READ_ONLY and by of type Type.REFERENCE and of referenceType ReferenceTypes.RESOURCE and define the custom-attribute AttributeNames.Custom.RESOURCE_TYPE_REFERENCE_NAME
           {
             "name": "userId",
             "type": "reference",
             "referenceTypes": [
               "resource"
             ]
             "resourceType": "User"
           }