Class GlueSchemaRegistryDeserializationFacade
- java.lang.Object
-
- com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializationFacade
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class GlueSchemaRegistryDeserializationFacade extends Object implements Closeable
Protocol agnostic AWS Generic de-serializer
-
-
Constructor Summary
Constructors Constructor Description GlueSchemaRegistryDeserializationFacade(@NonNull GlueSchemaRegistryConfiguration configuration, @NonNull software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider)GlueSchemaRegistryDeserializationFacade(Map<String,?> configs, Properties properties, @NonNull software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialProvider, AWSSchemaRegistryClient schemaRegistryClient)Constructor accepting various dependencies.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDeserialize(byte[] data)Returns if the given data array can be deserialized.voidclose()Resource clean up for Closeable.Objectdeserialize(@NonNull AWSDeserializerInput deserializerInput)De-serializes the given data and returns an Object.byte[]getActualData(byte[] data)SchemagetSchema(@lombok.NonNull byte[] data)StringgetSchemaDefinition(@lombok.NonNull byte[] data)Fetches the schema definition for a the serialized data.StringgetSchemaDefinition(@NonNull ByteBuffer buffer)Fetches the schema definition for the serialized data.voidoverrideUserAgentApp(String name)Method to override user-agent app name for the de-serializer.
-
-
-
Constructor Detail
-
GlueSchemaRegistryDeserializationFacade
public GlueSchemaRegistryDeserializationFacade(Map<String,?> configs, Properties properties, @NonNull @NonNull software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialProvider, AWSSchemaRegistryClient schemaRegistryClient)
Constructor accepting various dependencies.- Parameters:
configs- configuration mapproperties- configuration propertiescredentialProvider- credentials provider for integrating with schema registry serviceschemaRegistryClient- schema registry client for communicating with schema registry service
-
GlueSchemaRegistryDeserializationFacade
public GlueSchemaRegistryDeserializationFacade(@NonNull @NonNull GlueSchemaRegistryConfiguration configuration, @NonNull @NonNull software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider)
-
-
Method Detail
-
overrideUserAgentApp
public void overrideUserAgentApp(String name)
Method to override user-agent app name for the de-serializer. This overrides the previously set value in GlueSchemaRegistryConfiguration.- Parameters:
name- AppName
-
getSchemaDefinition
public String getSchemaDefinition(@NonNull @NonNull ByteBuffer buffer)
Fetches the schema definition for the serialized data.- Parameters:
buffer- data for which schema definition is needed as ByteBuffer- Returns:
- schema definition
- Throws:
GlueSchemaRegistryIncompatibleDataException- when data is incompatible with schema registry
-
getActualData
public byte[] getActualData(byte[] data)
-
getSchema
public Schema getSchema(@NonNull @lombok.NonNull byte[] data)
-
getSchemaDefinition
public String getSchemaDefinition(@NonNull @lombok.NonNull byte[] data)
Fetches the schema definition for a the serialized data.- Parameters:
data- data for which schema definition is needed as byte array- Returns:
- schema for the passed data
- Throws:
GlueSchemaRegistryIncompatibleDataException- when data is incompatible with schema registry
-
deserialize
public Object deserialize(@NonNull @NonNull AWSDeserializerInput deserializerInput) throws AWSSchemaRegistryException
De-serializes the given data and returns an Object. Accepts encapsulated deserializer input.- Parameters:
deserializerInput- Input data object for deserializer- Returns:
- de-serialized object instance
- Throws:
AWSSchemaRegistryException- Exception during de-serialization
-
canDeserialize
public boolean canDeserialize(byte[] data)
Returns if the given data array can be deserialized.- Parameters:
data- byte[] of data.- Returns:
- boolean.
-
close
public void close()
Resource clean up for Closeable. This method internally shuts down the background thread for publishing cloud watch metrics. After this is called, a new instance of this class should be created to enable the metrics publishing feature.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-