Class ResourceType

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>
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 ResourceType extends ResourceNode
author Pascal Knueppel
created at: 03.10.2019 - 19:36

represents a resource type in SCIM. A resource type defines an endpoint definition that can be used by clients.
See Also:
  • Constructor Details

    • ResourceType

      public ResourceType()
    • ResourceType

      protected ResourceType(SchemaFactory schemaFactory, String resourceDocument)
    • ResourceType

      protected ResourceType(SchemaFactory schemaFactory, com.fasterxml.jackson.databind.JsonNode resourceTypeDocument)
  • Method Details

    • getMainSchema

      public Schema getMainSchema()
      Returns:
      the main schema that represents this resource type
    • getAllSchemaExtensions

      public List<Schema> getAllSchemaExtensions()
      Returns:
      the resource schema extensions that represents this resource type
    • getRequiredResourceSchemaExtensions

      public List<Schema> getRequiredResourceSchemaExtensions()
      Returns:
      the required resource schema extensions that represents this resource type
    • getMetaSchema

      public Schema getMetaSchema()
      a delegation method to retrieve the schema that represents the meta-attribute. This attribute has received its own schema under the URI "urn:ietf:params:scim:schemas:core:2.0:Meta"
      Returns:
      the meta schema definition
    • getSchemaAttribute

      public Optional<SchemaAttribute> getSchemaAttribute(String scimNodeName)
      tries to find a scim node of this resource type in the registered schemas. This method may return the wrong attribute if there are colliding attribute names among the main-schema and an extension or among two extensions.
      Parameters:
      scimNodeName - the scim node name of the attribute that should be extracted
      Returns:
      the schema attribute if it does exist or an empty.
    • getNotRequiredResourceSchemaExtensions

      public List<Schema> getNotRequiredResourceSchemaExtensions()
      Returns:
      the not required resource schema extensions that represents this resource type
    • getAllSchemas

      public List<Schema> getAllSchemas()
      this method will extract all Schema definitions that belong to this resource type. The first entry in the list will always be the main Schema referenced in the attribute getSchema(). All other Schemas in the list will be the extensions of this resource
      Returns:
      a list of all Schema definitions that describe this resource type
    • getSchemaByUri

      public final Schema getSchemaByUri(String schemaUri)
      gets a member schema of this resource type by its uri
      Parameters:
      schemaUri - the uri of the schema that is wanted
      Returns:
      the schema if it does exist and is a member of this resource type
      Throws:
      BadRequestException - if the schemaUri is not a member of this resource type
    • setId

      public void setId(String id)
      Overrides:
      setId in class ResourceNode
    • getEndpoint

      public String getEndpoint()
      The resource type's HTTP-addressable endpoint relative to the Base URL of the service provider, e.g., "Users". REQUIRED.
    • getName

      public String getName()
      The resource type name. When applicable, service providers MUST specify the name, e.g., "User" or "Group". This name is referenced by the "meta.resourceType" attribute in all resources. REQUIRED.
    • getDescription

      public Optional<String> getDescription()
      The resource type's human-readable description. When applicable, service providers MUST specify the description. OPTIONAL.
    • setDescription

      public void setDescription(String description)
      The resource type's human-readable description. When applicable, service providers MUST specify the description. OPTIONAL.
    • getSchema

      public String getSchema()
      The resource type's primary/base schema URI, e.g., "urn:ietf:params:scim:schemas:core:2.0:User". This MUST be equal to the "id" attribute of the associated "Schema" resource. REQUIRED.
    • getSchemaExtensions

      public List<ResourceType.SchemaExtension> getSchemaExtensions()
      A list of URIs of the resource type's schema extensions. OPTIONAL
    • getFeatures

      public ResourceTypeFeatures getFeatures()
      See Also:
    • setFeatures

      public void setFeatures(ResourceTypeFeatures filterExtension)
      See Also:
    • isDisabled

      public boolean isDisabled()
      Returns:
      true if this resource type was disabled, false else
    • setDisabled

      public void setDisabled(Boolean disabled)
      disables or enables this resourcetype
    • getSchemaFactory

      protected SchemaFactory getSchemaFactory()
      used for unit tests in order to prevent application context pollution
    • getResourceHandlerImpl

      public ResourceHandler getResourceHandlerImpl()
      the resource handler implementation that is able to handle this kind of resource
    • setResourceHandlerImpl

      public void setResourceHandlerImpl(ResourceHandler resourceHandlerImpl)
      the resource handler implementation that is able to handle this kind of resource