Interface ResourceRegistrySchemaClient

All Known Implementing Classes:
ResourceRegistrySchemaClientImpl

public interface ResourceRegistrySchemaClient
Client interface for accessing Information System type schemas and model knowledge from the Resource Registry. Purpose: This interface provides comprehensive access to the Information System model definitions, type schemas, hierarchical relationships, and model knowledge within the Resource Registry service. It enables applications to understand the structure and constraints of available entity and relation types. Instantiation: Clients should be created using the factory pattern for proper configuration:
 // Recommended way to create a client
 ResourceRegistrySchemaClient client = ResourceRegistrySchemaClientFactory.create();
 
Supported Operations:
  • Schema Access: Retrieve type definitions, properties, and constraints for all Information System types
  • Model Knowledge: Access comprehensive model information including type hierarchies and relationships
  • Type Discovery: Find available types, their inheritance chains, and compatible subtypes
  • Type Validation: Validate type names and class compatibility
  • Schema Navigation: Traverse type hierarchies and understand type relationships.
Model Knowledge: The schema client provides access to complete model knowledge including:
  • Type definitions for Resources, Facets, ConsistsOf relations, and IsRelatedTo relations
  • Property definitions with types, constraints, and validation rules
  • Inheritance hierarchies and polymorphic type relationships
  • Schema versioning and evolution information.
Caching Behavior: The client implements intelligent caching of model knowledge to improve performance:
  • Model knowledge is cached locally to reduce network requests
  • Cache can be manually refreshed when schema changes are detected
  • Automatic cache invalidation based on schema version changes.
Authorization: Schema access is generally available to all authenticated users, but some advanced schema information may be filtered based on user roles and permissions. Query Parameter Configuration: Most methods support optional query parameters that can be configured via the client configuration:
  • includeMeta: Include metadata in schema responses.
Context Support: The client automatically operates within the context determined by the authorization token. Thread Safety: This client is designed to be thread-safe for concurrent access to cached model knowledge and schema information across multiple threads.
Author:
Luca Frosini (ISTI - CNR)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addHeader(String name, boolean value)
    Adds a custom HTTP header to be included in requests.
    void
    addHeader(String name, String value)
    Adds a custom HTTP header to be included in requests.
    <ME extends org.gcube.informationsystem.model.reference.ModelElement>
    org.gcube.informationsystem.types.reference.Type
    create(Class<ME> clz)
    Creates a new type definition in the Information System using a model element class.
    create(String typeDefinitition)
    Creates a new type definition in the Information System using JSON schema definition.
    <ME extends org.gcube.informationsystem.model.reference.ModelElement>
    boolean
    exist(Class<ME> clz)
    Checks if a type definition exists in the Information System using a model element class.
    boolean
    exist(String typeName)
    Checks if a type definition exists in the Information System using the type name.
    org.gcube.informationsystem.model.knowledge.ModelKnowledge<org.gcube.informationsystem.types.reference.Type,org.gcube.informationsystem.types.knowledge.TypeInformation>
    Retrieves the complete model knowledge containing type definitions and their information.
    <ME extends org.gcube.informationsystem.model.reference.ModelElement>
    org.gcube.informationsystem.tree.Node<org.gcube.informationsystem.types.reference.Type>
    Retrieves the type tree node for a specific type identified by its model element class.
    org.gcube.informationsystem.tree.Node<org.gcube.informationsystem.types.reference.Type>
    Retrieves the type tree node for a specific type identified by its name.
    boolean
    Returns whether metadata should be included in schema requests.
    <ME extends org.gcube.informationsystem.model.reference.ModelElement>
    List<org.gcube.informationsystem.types.reference.Type>
    read(Class<ME> clz, int level)
    Reads the type definitions for a specified model element class up to a specific hierarchy level.
    <ME extends org.gcube.informationsystem.model.reference.ModelElement>
    List<org.gcube.informationsystem.types.reference.Type>
    read(Class<ME> clz, Boolean polymorphic)
    Reads the type definitions for a specified model element class.
    read(String typeName, int level)
    Reads the schema definition for a specified type by name up to a specific hierarchy level.
    read(String typeName, Boolean polymorphic)
    Reads the schema definition for a specified type by name.
    void
    Forces a renewal of the cached model knowledge by fetching the latest version from the Resource Registry.
    void
    setIncludeMeta(boolean includeMeta)
    Sets whether metadata should be included in schema requests.
  • Method Details

    • includeMeta

      boolean includeMeta()
      Returns whether metadata should be included in schema requests.
      Returns:
      true if metadata should be included, false otherwise
    • setIncludeMeta

      void setIncludeMeta(boolean includeMeta)
      Sets whether metadata should be included in schema requests.
      Parameters:
      includeMeta - true to include metadata, false to exclude it
    • getModelKnowledge

      org.gcube.informationsystem.model.knowledge.ModelKnowledge<org.gcube.informationsystem.types.reference.Type,org.gcube.informationsystem.types.knowledge.TypeInformation> getModelKnowledge()
      Retrieves the complete model knowledge containing type definitions and their information. The model knowledge provides access to all registered types and their hierarchical relationships.
      Returns:
      the model knowledge containing type definitions and information
    • renewModelKnowledge

      void renewModelKnowledge()
      Forces a renewal of the cached model knowledge by fetching the latest version from the Resource Registry. This method should be called when the schema has been modified and the local cache needs to be updated.
    • getTypeTreeNode

      org.gcube.informationsystem.tree.Node<org.gcube.informationsystem.types.reference.Type> getTypeTreeNode(String typeName) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Retrieves the type tree node for a specific type identified by its name. The tree node contains the type definition and its hierarchical position within the type system.
      Parameters:
      typeName - the name of the type to retrieve
      Returns:
      the tree node containing the type and its hierarchical information
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the specified type name does not exist in the schema
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the operation
    • getTypeTreeNode

      <ME extends org.gcube.informationsystem.model.reference.ModelElement> org.gcube.informationsystem.tree.Node<org.gcube.informationsystem.types.reference.Type> getTypeTreeNode(Class<ME> clz) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Retrieves the type tree node for a specific type identified by its model element class. The tree node contains the type definition and its hierarchical position within the type system.
      Type Parameters:
      ME - the model element type parameter
      Parameters:
      clz - the class of the model element type to retrieve
      Returns:
      the tree node containing the type and its hierarchical information
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the specified type does not exist in the schema
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the operation
    • addHeader

      void addHeader(String name, String value)
      Adds a custom HTTP header to be included in requests.
      Parameters:
      name - Header name
      value - Header value
    • addHeader

      void addHeader(String name, boolean value)
      Adds a custom HTTP header to be included in requests.
      Parameters:
      name - Header name
      value - boolean value
    • create

      String create(String typeDefinitition) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Creates a new type definition in the Information System using JSON schema definition. Corresponding REST API: PUT /types/{type-name} Operation Behavior:
      • Creates a new type definition from JSON schema representation
      • Type name is extracted from the JSON schema definition
      • Validates the JSON schema against Information System type schema requirements
      • Type definitions become available system-wide for instance creation
      • Returns the complete type definition including metadata and schema information.
      HTTP Response Codes:
      • 201 Created: Type successfully created
      • 409 Conflict: Type already exists with the given name
      • 400 Bad Request: Invalid JSON schema or malformed request
      • 403 Forbidden: User lacks authorization to create types.
      Input Processing:
      • JSON schema must conform to Information System type schema format
      • Type name must be unique in the system
      • Schema must define valid properties, relationships, and constraints.
      Schema Validation:
      • All type properties and relationships are validated against the Information System model
      • Type hierarchy and inheritance rules are enforced
      • Property types and constraints are validated
      • Relationship definitions must reference valid types.
      Authorization Requirements:
      • IS-Manager: Can create any type definition without restrictions
      • Infrastructure-Manager: Can create any type definition without restrictions
      • All Other Users: Cannot create type definitions (will receive authorization errors)
      • Type creation is restricted to prevent system-wide compatibility issues.
      Example Usage:
       ResourceRegistrySchemaClient client = ResourceRegistrySchemaClientFactory.create();
      
       // Create a new type from JSON schema
       String jsonSchema = "{ \"@class\": \"ContactFacet\", ... }";
       String createdType = client.create(jsonSchema);
       
      Context Access:
      • Type definitions are global and not bound to a specific context.
      Parameters:
      typeDefinitition - the JSON schema definition of the type to create
      Returns:
      the JSON representation of the created type definition
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException - if the provided schema is invalid or malformed
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - for creation errors or authorization failures
    • create

      <ME extends org.gcube.informationsystem.model.reference.ModelElement> org.gcube.informationsystem.types.reference.Type create(Class<ME> clz) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Creates a new type definition in the Information System using a model element class. Corresponding REST API: PUT /types/{type-name} Operation Behavior:
      • Creates a new type definition derived from the provided model element class
      • Type name is automatically derived from the class using reflection
      • Analyzes class annotations and structure to generate the type schema
      • Type definitions become available system-wide for instance creation
      • Returns the complete Type object with metadata and schema information.
      HTTP Response Codes:
      • 201 Created: Type successfully created
      • 409 Conflict: Type already exists with the given name
      • 400 Bad Request: Invalid class definition or schema generation failure
      • 403 Forbidden: User lacks authorization to create types.
      Input Processing:
      • Type name is automatically derived from the provided class using TypeUtility.getTypeName(Class)
      • Class must extend ModelElement or its subtypes
      • Annotations are processed to generate schema constraints
      • Property definitions are extracted from class fields and methods.
      Schema Validation:
      • All class properties and relationships are validated against the Information System model
      • Type hierarchy and inheritance rules are enforced
      • Property types and constraints are validated from class annotations
      • Relationship definitions must reference valid types.
      Authorization Requirements:
      • IS-Manager: Can create any type definition without restrictions
      • Infrastructure-Manager: Can create any type definition without restrictions
      • All Other Users: Cannot create type definitions (will receive authorization errors)
      • Type creation is restricted to prevent system-wide compatibility issues.
      Example Usage:
       ResourceRegistrySchemaClient client = ResourceRegistrySchemaClientFactory.create();
       
       // Create a new type from model element class
       Type createdType = client.create(ContactFacet.class);
       
      Type Parameters:
      ME - the model element type parameter
      Parameters:
      clz - the class of the model element type to create
      Returns:
      the Type object representing the created type definition
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException - if the class definition is invalid or schema generation fails
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - for creation errors or authorization failures Context Access:
      • Type definitions are global and not bound to a specific context.
    • exist

      boolean exist(String typeName) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Checks if a type definition exists in the Information System using the type name. Corresponding REST API: HEAD /types/{type-name}[?polymorphic={true|false}&includeMeta={true|false}] Operation Behavior:
      • Verifies the existence of the specified type definition using its name
      • Does not return the type data, only confirms existence
      • Checks accessibility within the current user authorization level
      • Most direct method when type name is already known.
      HTTP Response Codes:
      • 200 OK: Type exists and is accessible
      • 404 Not Found: Type does not exist in the system
      • 403 Forbidden: User lacks authorization to access type information
      • 401 Unauthorized: Invalid or missing authentication credentials.
      Input Processing:
      • Type name must be a valid Information System model type
      • Supports all Information System model types and their subtypes: Entities (Resources and all Resource subtypes, Facets and all Facet subtypes) and Relations (ConsistsOf and all ConsistsOf subtypes, IsRelatedTo and all IsRelatedTo subtypes)
      • Type name is case-sensitive and must match exactly.
      Authorization Requirements:
      • IS-Manager: Can check existence of any type definition
      • Infrastructure-Manager: Can check existence of any type definition
      • All Other Users: Can check existence of any type definition with filtered access to sensitive metadata.
      Example Usage:
       ResourceRegistrySchemaClient client = ResourceRegistrySchemaClientFactory.create();
       
       // Check if ContactFacet type exists
       boolean contactFacetExists = client.exist("ContactFacet");
       
       // Check if a custom resource type exists
       boolean customResourceExists = client.exist("MyCustomResource");
       
      Parameters:
      typeName - the name of the type to check for existence (case-sensitive)
      Returns:
      true if the type exists in the system, false if not found
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the existence check
    • exist

      <ME extends org.gcube.informationsystem.model.reference.ModelElement> boolean exist(Class<ME> clz) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Checks if a type definition exists in the Information System using a model element class. Corresponding REST API: HEAD /types/{type-name}[?polymorphic={true|false}&includeMeta={true|false}] Operation Behavior:
      • Verifies the existence of the specified type definition using its model element class
      • Type name is automatically derived from the class using reflection
      • Does not return the type data, only confirms existence
      • Checks accessibility within the current user authorization level
      • Convenient method when working with strongly-typed classes.
      HTTP Response Codes:
      • 200 OK: Type exists and is accessible
      • 404 Not Found: Type corresponding to the class does not exist in the system
      • 403 Forbidden: User lacks authorization to access type information
      • 401 Unauthorized: Invalid or missing authentication credentials.
      Input Processing:
      • The type name is automatically derived from the provided class using TypeUtility.getTypeName(Class)
      • Class must extend ModelElement or its subtypes
      • Supports all Information System model types and their subtypes: Entities (Resources and all Resource subtypes, Facets and all Facet subtypes) and Relations (ConsistsOf and all ConsistsOf subtypes, IsRelatedTo and all IsRelatedTo subtypes).
      Authorization Requirements:
      • IS-Manager: Can check existence of any type definition
      • Infrastructure-Manager: Can check existence of any type definition
      • All Other Users: Can check existence of any type definition with filtered access to sensitive metadata.
      Example Usage:
       ResourceRegistrySchemaClient client = ResourceRegistrySchemaClientFactory.create();
       
       // Check if ContactFacet type exists
       boolean contactFacetExists = client.exist(ContactFacet.class);
       
       // Check if EService type exists
       boolean eServiceExists = client.exist(EService.class);
       
      Type Parameters:
      ME - the model element type parameter
      Parameters:
      clz - the class of the model element type to check for existence
      Returns:
      true if the type corresponding to the class exists in the system, false if not found
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the existence check
    • read

      String read(String typeName, Boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Reads the schema definition for a specified type by name. Corresponding REST API: GET /types/{type-name}[?polymorphic={true|false}&includeMeta={true|false}] Operation Behavior:
      • Retrieves type schema definition(s) for the specified type name
      • When polymorphic=false: returns only the specified type definition
      • When polymorphic=true: returns the specified type AND all its existing subtypes
      • Metadata inclusion is controlled by client configuration and user authorization
      • Response detail level varies based on user authorization (IS/Infrastructure managers get full metadata).
      HTTP Response Codes:
      • 200 OK: Type successfully retrieved
      • 404 Not Found: Type with the specified name does not exist
      • 403 Forbidden: User lacks authorization to access type information.
      Query Parameters: polymorphic (parameter of this method):
      • Whether to include subtypes in the response
      • Default value: false (returns only the specified type)
      • Values: true (includes all subtypes) | false (specified type only)
      • When true: returns the specified type AND all its existing subtypes
      • When false: returns only the specified type definition
      • Note: No pagination is applied - ALL subtypes are returned when polymorphic=true.
      includeMeta (configurable via client configuration):
      • Whether to include metadata in the response type definition
      • Default value: false (basic type information only)
      • Usage: client.setIncludeMeta(true)
      • Values: true (includes metadata with role-based filtering) | false (basic information only)
      • Query parameter: TypePath.INCLUDE_META_QUERY_PARAMETER
      • Restriction: IS-Manager and Infrastructure-Manager see complete metadata including sensitive information (createdBy, lastUpdatedBy); other users see filtered metadata with sensitive fields obfuscated.
      Authorization Requirements:
      • IS-Manager: Receive complete type definitions with full metadata when requested
      • Infrastructure-Manager: Receive complete type definitions with full metadata when requested
      • All Other Users: Receive basic type information with filtered metadata (sensitive information obfuscated).
      Example Usage:
       ResourceRegistrySchemaClient client = ResourceRegistrySchemaClientFactory.create();
       
       // Read a ContactFacet type definition only
       String contactFacetSchema = client.read("ContactFacet", false);
       
       // Read ContactFacet and all its subtypes
       String contactFacetAndSubtypes = client.read("ContactFacet", true);
       
      Parameters:
      typeName - the name of the type to retrieve (case-sensitive)
      polymorphic - whether to include subtypes in the response (when true, includes all subtypes)
      Returns:
      JSON string containing type schema definition(s) with authorization-appropriate detail level
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the specified type is not found in the system
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - for retrieval errors or other system failures
    • read

      <ME extends org.gcube.informationsystem.model.reference.ModelElement> List<org.gcube.informationsystem.types.reference.Type> read(Class<ME> clz, Boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Reads the type definitions for a specified model element class. Corresponding REST API: GET /types/{type-name}[?polymorphic={true|false}&includeMeta={true|false}] Operation Behavior:
      • Retrieves type definitions for the specified model element class
      • Type name is automatically derived from the class using reflection
      • When polymorphic=false: returns only the specified type definition
      • When polymorphic=true: returns the specified type AND all its existing subtypes
      • Returns strongly-typed Type objects instead of JSON strings
      • Response detail level varies based on user authorization.
      HTTP Response Codes:
      • 200 OK: Type successfully retrieved
      • 404 Not Found: Type corresponding to the specified class does not exist
      • 403 Forbidden: User lacks authorization to access type information.
      Query Parameters: polymorphic (parameter of this method):
      • Whether to include subtypes in the response
      • Default value: false (returns only the specified type)
      • Values: true (includes all subtypes) | false (specified type only)
      • When true: returns the specified type AND all its existing subtypes
      • When false: returns only the specified type definition
      • Note: No pagination is applied - ALL subtypes are returned when polymorphic=true.
      includeMeta (configurable via client configuration):
      • Whether to include metadata in the response type definition
      • Default value: false (basic type information only)
      • Usage: client.setIncludeMeta(true)
      • Values: true (includes metadata with role-based filtering) | false (basic information only)
      • Query parameter: TypePath.INCLUDE_META_QUERY_PARAMETER
      • Restriction: IS-Manager and Infrastructure-Manager see complete metadata including sensitive information (createdBy, lastUpdatedBy); other users see filtered metadata with sensitive fields obfuscated.
      Input Processing:
      • The type name is automatically derived from the provided class using TypeUtility.getTypeName(Class).
      Authorization Requirements:
      • IS-Manager: Receive complete type definitions with full metadata when requested
      • Infrastructure-Manager: Receive complete type definitions with full metadata when requested
      • All Other Users: Receive basic type information with filtered metadata (sensitive information obfuscated).
      Example Usage:
       ResourceRegistrySchemaClient client = ResourceRegistrySchemaClientFactory.create();
       
       // Read ContactFacet type definition only
       List<Type> contactFacetType = client.read(ContactFacet.class, false);
       
       // Read ContactFacet and all its subtypes
       List<Type> contactFacetAndSubtypes = client.read(ContactFacet.class, true);
       
      Type Parameters:
      ME - the model element type parameter
      Parameters:
      clz - the class of the model element type to retrieve
      polymorphic - whether to include subtypes in the response (when true, includes all subtypes)
      Returns:
      list of Type objects representing the type definition(s) with authorization-appropriate detail level
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the type corresponding to the specified class is not found
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - for retrieval errors or other system failures
    • read

      String read(String typeName, int level) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Reads the schema definition for a specified type by name up to a specific hierarchy level. Corresponding REST API: GET /types/{type-name}[?polymorphic={true|false}&includeMeta={true|false}] Operation Behavior:
      • Retrieves type schema definition for the specified type name
      • Limits the depth of hierarchical relationships to the specified level
      • Level parameter controls how deep into related types the response includes
      • Useful for preventing overly complex responses in deeply nested type hierarchies
      • Response detail level varies based on user authorization.
      HTTP Response Codes:
      • 200 OK: Type successfully retrieved
      • 404 Not Found: Type with the specified name does not exist
      • 403 Forbidden: User lacks authorization to access type information.
      Query Parameters: level (parameter of this method):
      • Controls the depth of hierarchical relationships included in the response
      • Higher values include more detailed relationship information
      • Lower values provide more concise responses with limited relationship depth
      • Useful for controlling response size and complexity.
      includeMeta (configurable via client configuration):
      • Whether to include metadata in the response type definition
      • Default value: false (basic type information only)
      • Usage: client.setIncludeMeta(true)
      • Values: true (includes metadata with role-based filtering) | false (basic information only)
      • Query parameter: TypePath.INCLUDE_META_QUERY_PARAMETER
      • Restriction: IS-Manager and Infrastructure-Manager see complete metadata including sensitive information (createdBy, lastUpdatedBy); other users see filtered metadata with sensitive fields obfuscated.
      Authorization Requirements:
      • IS-Manager: Receive complete type definitions with full metadata when requested
      • Infrastructure-Manager: Receive complete type definitions with full metadata when requested
      • All Other Users: Receive basic type information with filtered metadata (sensitive information obfuscated).
      Example Usage:
       ResourceRegistrySchemaClient client = ResourceRegistrySchemaClientFactory.create();
       
       // Read ContactFacet type definition with hierarchy level 1
       String contactFacetSchema = client.read("ContactFacet", 1);
       
       // Read ContactFacet type definition with deeper hierarchy level
       String contactFacetDeepSchema = client.read("ContactFacet", 3);
       
      Parameters:
      typeName - the name of the type to retrieve (case-sensitive)
      level - the maximum hierarchy level to include in the response
      Returns:
      JSON string containing type schema definition with hierarchy limited to the specified level
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the specified type is not found in the system
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - for retrieval errors or other system failures
    • read

      <ME extends org.gcube.informationsystem.model.reference.ModelElement> List<org.gcube.informationsystem.types.reference.Type> read(Class<ME> clz, int level) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Reads the type definitions for a specified model element class up to a specific hierarchy level. Corresponding REST API: GET /types/{type-name}[?polymorphic={true|false}&includeMeta={true|false}] Operation Behavior:
      • Retrieves type definitions for the specified model element class
      • Type name is automatically derived from the class using reflection
      • Limits the depth of hierarchical relationships to the specified level
      • Level parameter controls how deep into related types the response includes
      • Returns strongly-typed Type objects instead of JSON strings
      • Response detail level varies based on user authorization.
      HTTP Response Codes:
      • 200 OK: Type successfully retrieved
      • 404 Not Found: Type corresponding to the specified class does not exist
      • 403 Forbidden: User lacks authorization to access type information.
      Query Parameters: level (parameter of this method):
      • Controls the depth of hierarchical relationships included in the response
      • Higher values include more detailed relationship information
      • Lower values provide more concise responses with limited relationship depth
      • Useful for controlling response size and complexity.
      includeMeta (configurable via client configuration):
      • Whether to include metadata in the response type definition
      • Default value: false (basic type information only)
      • Usage: client.setIncludeMeta(true)
      • Values: true (includes metadata with role-based filtering) | false (basic information only)
      • Query parameter: TypePath.INCLUDE_META_QUERY_PARAMETER
      • Restriction: IS-Manager and Infrastructure-Manager see complete metadata including sensitive information (createdBy, lastUpdatedBy); other users see filtered metadata with sensitive fields obfuscated.
      Input Processing:
      • The type name is automatically derived from the provided class using TypeUtility.getTypeName(Class).
      Authorization Requirements:
      • IS-Manager: Receive complete type definitions with full metadata when requested
      • Infrastructure-Manager: Receive complete type definitions with full metadata when requested
      • All Other Users: Receive basic type information with filtered metadata (sensitive information obfuscated).
      Example Usage:
       ResourceRegistrySchemaClient client = ResourceRegistrySchemaClientFactory.create();
       
       // Read ContactFacet type definition with hierarchy level 1
       List<Type> contactFacetType = client.read(ContactFacet.class, 1);
       
       // Read ContactFacet type definition with deeper hierarchy level
       List<Type> contactFacetDeepType = client.read(ContactFacet.class, 3);
       
      Type Parameters:
      ME - the model element type parameter
      Parameters:
      clz - the class of the model element type to retrieve
      level - the maximum hierarchy level to include in the response
      Returns:
      list of Type objects representing the type definition(s) with hierarchy limited to the specified level
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the type corresponding to the specified class is not found
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - for retrieval errors or other system failures