Class AWSSchemaRegistryClient

java.lang.Object
com.amazonaws.services.schemaregistry.common.AWSSchemaRegistryClient

public class AWSSchemaRegistryClient extends Object
Handles all the requests related to the schema management.
  • Constructor Details

    • AWSSchemaRegistryClient

      public AWSSchemaRegistryClient(@NonNull @NonNull software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider, @NonNull @NonNull GlueSchemaRegistryConfiguration glueSchemaRegistryConfiguration, @NonNull @NonNull software.amazon.awssdk.core.retry.RetryPolicy retryPolicy)
      Create Amazon Schema Registry Client.
      Parameters:
      credentialsProvider - credentials provider
      glueSchemaRegistryConfiguration - schema registry configuration elements
      Throws:
      AWSSchemaRegistryException - on any error while building the client
    • AWSSchemaRegistryClient

      public AWSSchemaRegistryClient(@NonNull @NonNull software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider, @NonNull @NonNull GlueSchemaRegistryConfiguration glueSchemaRegistryConfiguration)
      Create Amazon Schema Registry Client.
      Parameters:
      credentialsProvider - credentials provider
      glueSchemaRegistryConfiguration - schema registry configuration elements
      Throws:
      AWSSchemaRegistryException - on any error while building the client
    • AWSSchemaRegistryClient

      public AWSSchemaRegistryClient(@NonNull @NonNull software.amazon.awssdk.services.glue.GlueClient glueClient)
  • Method Details

    • getSchemaVersionIdByDefinition

      public UUID getSchemaVersionIdByDefinition(@NonNull @NonNull String schemaDefinition, @NonNull @NonNull String schemaName, @NonNull @NonNull String dataFormat) throws AWSSchemaRegistryException
      Get Schema Version ID by passing the schema definition.
      Parameters:
      schemaDefinition - Schema Definition
      schemaName - Schema Name
      dataFormat - Data Format
      Returns:
      Schema Version ID
      Throws:
      AWSSchemaRegistryException - on any error while fetching the schema version ID
    • getSchemaVersionResponse

      public software.amazon.awssdk.services.glue.model.GetSchemaVersionResponse getSchemaVersionResponse(@NonNull @NonNull String schemaVersionId) throws AWSSchemaRegistryException
      Get the schema definition by passing the schema id.
      Parameters:
      schemaVersionId - schema version id
      Returns:
      schema definition returns the schema definition corresponding to the schema id passed and null in case service is not able to found the schema definition corresponding to schema id.
      Throws:
      AWSSchemaRegistryException - on any errors during schema retrieval from service
    • buildGetSchemaByDefinitionRequest

      public software.amazon.awssdk.services.glue.model.GetSchemaByDefinitionRequest buildGetSchemaByDefinitionRequest(String schemaDefinition, String schemaName)
      Create a request to get a schema using the schema definition and the schema name.
      Parameters:
      schemaDefinition - Schema Definition
      schemaName - Schema Name
      Returns:
      GetSchemaByDefinitionRequest object
    • buildGetSchemaByDefinitionRequest

      public software.amazon.awssdk.services.glue.model.GetSchemaByDefinitionRequest buildGetSchemaByDefinitionRequest(String schemaDefinition, String schemaName, String registryName)
      Create a request to get a schema using the schema definition and the schema name.
      Parameters:
      schemaDefinition - Schema Definition
      schemaName - Schema Name
      registryName - Registry name
      Returns:
      GetSchemaByDefinitionRequest object
    • createSchema

      public UUID createSchema(String schemaName, String dataFormat, String schemaDefinition, Map<String,String> metadata) throws AWSSchemaRegistryException
      Create a schema using the Glue client and return the response object
      Parameters:
      schemaName - Schema Name
      dataFormat - Data Format
      schemaDefinition - Schema Definition
      metadata - schema version metadata
      Returns:
      CreateSchemaResponse object
      Throws:
      AWSSchemaRegistryException - on any error during the schema creation
    • registerSchemaVersion

      public UUID registerSchemaVersion(String schemaDefinition, String schemaName, String dataFormat, Map<String,String> metadata)
      Register the schema and return schema version Id once it is available.
      Parameters:
      schemaDefinition - Schema Definition
      schemaName - Schema Name
      dataFormat - Data Format
      metadata - Metadata Map
      Returns:
      Unique schema version ID.
      Throws:
      AWSSchemaRegistryException - on any error during the registration and fetching of schema version
    • registerSchemaVersion

      public software.amazon.awssdk.services.glue.model.GetSchemaVersionResponse registerSchemaVersion(String schemaDefinition, String schemaName, String dataFormat) throws AWSSchemaRegistryException
      Register the schema and return get schema version response once it is available.
      Parameters:
      schemaDefinition - Schema Definition
      schemaName - Schema Name
      dataFormat - Data Format
      Returns:
      GetSchemaVersionResponse object.
      Throws:
      AWSSchemaRegistryException - on any error during the registration and fetching of schema version
    • putSchemaVersionMetadata

      public void putSchemaVersionMetadata(UUID schemaVersionId, Map<String,String> metadata)
      Put metadata to schema version asynchronously
      Parameters:
      schemaVersionId - Schema Version Id
      metadata - Metadata Map
    • putSchemaVersionMetadata

      public software.amazon.awssdk.services.glue.model.PutSchemaVersionMetadataResponse putSchemaVersionMetadata(UUID schemaVersionId, software.amazon.awssdk.services.glue.model.MetadataKeyValuePair metadataKeyValuePair) throws AWSSchemaRegistryException
      Put metadata to schema version and return the response object
      Parameters:
      schemaVersionId - Schema Version Id
      metadataKeyValuePair - Metadata Key Value Pair
      Returns:
      PutSchemaVersionMetadataResponse object
      Throws:
      AWSSchemaRegistryException - on any error during putting metadata
    • querySchemaVersionMetadata

      public software.amazon.awssdk.services.glue.model.QuerySchemaVersionMetadataResponse querySchemaVersionMetadata(UUID schemaVersionId)
      Query metadata for schema version and return the response object
      Parameters:
      schemaVersionId - Schema Version Id
      Returns:
      QuerySchemaVersionMetadataResponse object
      Throws:
      AWSSchemaRegistryException - on any error during putting metadata
    • querySchemaTags

      public software.amazon.awssdk.services.glue.model.GetTagsResponse querySchemaTags(String schemaDefinition, String schemaName)
      Query Schema Tags Response for a given schema name and definition
      Parameters:
      schemaDefinition - Schema Definition
      schemaName - Schema Name
      Returns:
      a GetTagsResponse with tags