public class SchemaRegistryClient
extends java.lang.Object
implements com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClient
ISchemaRegistryClient which connects to the given rootCatalogURL.
An instance of SchemaRegistryClient can be instantiated by passing configuration properties like below.
SchemaRegistryClient schemaRegistryClient = new SchemaRegistryClient(config);
There are different options available as mentioned in SchemaRegistryClient.Configuration like
-SchemaRegistryClient.Configuration.SCHEMA_REGISTRY_URL. -SchemaRegistryClient.Configuration.SCHEMA_METADATA_CACHE_SIZE. -SchemaRegistryClient.Configuration.SCHEMA_METADATA_CACHE_EXPIRY_INTERVAL_SECS. -SchemaRegistryClient.Configuration.SCHEMA_VERSION_CACHE_SIZE. -SchemaRegistryClient.Configuration.SCHEMA_VERSION_CACHE_EXPIRY_INTERVAL_SECS. -SchemaRegistryClient.Configuration.SCHEMA_TEXT_CACHE_SIZE. -SchemaRegistryClient.Configuration.SCHEMA_TEXT_CACHE_EXPIRY_INTERVAL_SECS. and many other properties likeClientProperties
This can be used to
- register schema metadata
- add new versions of a schema
- fetch different versions of schema
- fetch latest version of a schema
- check whether the given schema text is compatible with a latest version of the schema
- register serializer/deserializer for a schema
- fetch serializer/deserializer for a schema
| Modifier and Type | Class and Description |
|---|---|
static class |
SchemaRegistryClient.Configuration |
| Constructor and Description |
|---|
SchemaRegistryClient(java.io.File confFile)
Creates
SchemaRegistryClient instance with the given yaml config. |
SchemaRegistryClient(java.util.Map<java.lang.String,?> conf) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Long |
addSchemaMetadata(com.hortonworks.registries.schemaregistry.SchemaMetadata schemaMetadata) |
com.hortonworks.registries.schemaregistry.SchemaIdVersion |
addSchemaVersion(com.hortonworks.registries.schemaregistry.SchemaMetadata schemaMetadata,
com.hortonworks.registries.schemaregistry.SchemaVersion schemaVersion,
boolean disableCanonicalCheck) |
com.hortonworks.registries.schemaregistry.SchemaIdVersion |
addSchemaVersion(java.lang.String schemaBranchName,
com.hortonworks.registries.schemaregistry.SchemaMetadata schemaMetadata,
com.hortonworks.registries.schemaregistry.SchemaVersion schemaVersion,
boolean disableCanonicalCheck) |
com.hortonworks.registries.schemaregistry.SchemaIdVersion |
addSchemaVersion(java.lang.String schemaName,
com.hortonworks.registries.schemaregistry.SchemaVersion schemaVersion,
boolean disableCanonicalCheck) |
com.hortonworks.registries.schemaregistry.SchemaIdVersion |
addSchemaVersion(java.lang.String schemaBranchName,
java.lang.String schemaName,
com.hortonworks.registries.schemaregistry.SchemaVersion schemaVersion,
boolean disableCanonicalCheck) |
java.lang.Long |
addSerDes(com.hortonworks.registries.schemaregistry.SerDesPair serDesPair) |
void |
archiveSchemaVersion(java.lang.Long schemaVersionId) |
com.hortonworks.registries.schemaregistry.CompatibilityResult |
checkCompatibility(java.lang.String schemaName,
java.lang.String toSchemaText) |
com.hortonworks.registries.schemaregistry.CompatibilityResult |
checkCompatibility(java.lang.String schemaBranchName,
java.lang.String schemaName,
java.lang.String toSchemaText) |
com.hortonworks.registries.common.SchemaRegistryVersion |
clientVersion() |
void |
close()
Closes the client and all open connections.
|
protected com.hortonworks.registries.shaded.org.glassfish.jersey.client.ClientConfig |
createClientConfig(java.util.Map<java.lang.String,?> conf) |
<T> T |
createDeserializerInstance(com.hortonworks.registries.schemaregistry.SerDesInfo serDesInfo) |
com.hortonworks.registries.schemaregistry.SchemaBranch |
createSchemaBranch(java.lang.Long schemaVersionId,
com.hortonworks.registries.schemaregistry.SchemaBranch schemaBranch) |
<T> T |
createSerializerInstance(com.hortonworks.registries.schemaregistry.SerDesInfo serDesInfo) |
protected javax.net.ssl.SSLContext |
createSSLContext(java.util.Map<java.lang.String,java.lang.String> sslConfigurations) |
void |
deleteSchema(java.lang.String schemaName) |
void |
deleteSchemaBranch(java.lang.Long schemaBranchId) |
void |
deleteSchemaVersion(java.lang.Long schemaVersionId) |
void |
deleteSchemaVersion(com.hortonworks.registries.schemaregistry.SchemaVersionKey schemaVersionKey) |
void |
disableSchemaVersion(java.lang.Long schemaVersionId) |
java.io.InputStream |
downloadFile(java.lang.String fileId) |
void |
enableSchemaVersion(java.lang.Long schemaVersionId) |
java.util.List<com.hortonworks.registries.schemaregistry.AggregatedSchemaMetadataInfo> |
findAggregatedSchemas(java.lang.String schemaName,
java.lang.String schemaDescription,
java.lang.String orderByFields) |
java.util.List<com.hortonworks.registries.schemaregistry.SchemaMetadataInfo> |
findAllSchemas() |
java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaVersionKey> |
findSchemasByFields(com.hortonworks.registries.schemaregistry.SchemaFieldQuery schemaFieldQuery) |
java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaVersionInfo> |
getAllVersions(java.lang.String schemaName) |
java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaVersionInfo> |
getAllVersions(java.lang.String schemaBranchName,
java.lang.String schemaName) |
java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaVersionInfo> |
getAllVersions(java.lang.String schemaBranchName,
java.lang.String schemaName,
java.util.List<java.lang.Byte> stateIds) |
SchemaRegistryClient.Configuration |
getConfiguration() |
<T> T |
getDefaultDeserializer(java.lang.String type) |
<T> T |
getDefaultSerializer(java.lang.String type) |
com.hortonworks.registries.schemaregistry.SchemaVersionInfo |
getLatestSchemaVersionInfo(java.lang.String schemaName) |
com.hortonworks.registries.schemaregistry.SchemaVersionInfo |
getLatestSchemaVersionInfo(java.lang.String schemaBranchName,
java.lang.String schemaName) |
java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaBranch> |
getSchemaBranches(java.lang.String schemaName) |
com.hortonworks.registries.schemaregistry.SchemaMetadataInfo |
getSchemaMetadataInfo(java.lang.Long schemaMetadataId) |
com.hortonworks.registries.schemaregistry.SchemaMetadataInfo |
getSchemaMetadataInfo(java.lang.String schemaName) |
com.hortonworks.registries.schemaregistry.SchemaVersionInfo |
getSchemaVersionInfo(com.hortonworks.registries.schemaregistry.SchemaIdVersion schemaIdVersion) |
com.hortonworks.registries.schemaregistry.SchemaVersionInfo |
getSchemaVersionInfo(com.hortonworks.registries.schemaregistry.SchemaVersionKey schemaVersionKey) |
com.hortonworks.registries.schemaregistry.state.SchemaVersionLifecycleStateMachineInfo |
getSchemaVersionLifecycleStateMachineInfo() |
java.util.Collection<com.hortonworks.registries.schemaregistry.SerDesInfo> |
getSerDes(java.lang.String schemaName) |
java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaProviderInfo> |
getSupportedSchemaProviders() |
protected void |
initializeSecurityContext()
Login with kerberos or oauth2
|
boolean |
isCompatibleWithAllVersions(java.lang.String schemaName,
java.lang.String toSchemaText) |
boolean |
isCompatibleWithAllVersions(java.lang.String schemaBranchName,
java.lang.String schemaName,
java.lang.String toSchemaText) |
void |
mapSchemaWithSerDes(java.lang.String schemaName,
java.lang.Long serDesId) |
com.hortonworks.registries.schemaregistry.SchemaVersionMergeResult |
mergeSchemaVersion(java.lang.Long schemaVersionId,
boolean disableCanonicalCheck) |
static com.hortonworks.registries.common.catalog.CatalogResponse |
readCatalogResponse(java.lang.String msg) |
java.lang.Long |
registerSchemaMetadata(com.hortonworks.registries.schemaregistry.SchemaMetadata schemaMetadata) |
void |
startSchemaVersionReview(java.lang.Long schemaVersionId) |
void |
transitionState(java.lang.Long schemaVersionId,
java.lang.Byte targetStateId,
byte[] transitionDetails) |
com.hortonworks.registries.schemaregistry.SchemaMetadataInfo |
updateSchemaMetadata(java.lang.String schemaName,
com.hortonworks.registries.schemaregistry.SchemaMetadata schemaMetadata) |
java.lang.String |
uploadFile(java.io.InputStream inputStream) |
com.hortonworks.registries.schemaregistry.SchemaIdVersion |
uploadSchemaVersion(java.lang.String schemaName,
java.lang.String description,
java.io.InputStream schemaVersionTextFile) |
com.hortonworks.registries.schemaregistry.SchemaIdVersion |
uploadSchemaVersion(java.lang.String schemaBranchName,
java.lang.String schemaName,
java.lang.String description,
java.io.InputStream schemaVersionInputStream) |
public SchemaRegistryClient(java.io.File confFile)
throws java.io.IOException
SchemaRegistryClient instance with the given yaml config.confFile - config file which contains the configuration entries.java.io.IOException - when any IOException occurs while reading the given confFilepublic SchemaRegistryClient(java.util.Map<java.lang.String,?> conf)
protected void initializeSecurityContext()
protected javax.net.ssl.SSLContext createSSLContext(java.util.Map<java.lang.String,java.lang.String> sslConfigurations)
protected com.hortonworks.registries.shaded.org.glassfish.jersey.client.ClientConfig createClientConfig(java.util.Map<java.lang.String,?> conf)
public SchemaRegistryClient.Configuration getConfiguration()
public java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaProviderInfo> getSupportedSchemaProviders()
getSupportedSchemaProviders in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic java.lang.Long registerSchemaMetadata(com.hortonworks.registries.schemaregistry.SchemaMetadata schemaMetadata)
registerSchemaMetadata in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic java.lang.Long addSchemaMetadata(com.hortonworks.registries.schemaregistry.SchemaMetadata schemaMetadata)
addSchemaMetadata in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic com.hortonworks.registries.schemaregistry.SchemaMetadataInfo updateSchemaMetadata(java.lang.String schemaName,
com.hortonworks.registries.schemaregistry.SchemaMetadata schemaMetadata)
updateSchemaMetadata in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic com.hortonworks.registries.schemaregistry.SchemaMetadataInfo getSchemaMetadataInfo(java.lang.String schemaName)
getSchemaMetadataInfo in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic com.hortonworks.registries.schemaregistry.SchemaMetadataInfo getSchemaMetadataInfo(java.lang.Long schemaMetadataId)
getSchemaMetadataInfo in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic void deleteSchema(java.lang.String schemaName)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException
deleteSchema in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptionpublic com.hortonworks.registries.schemaregistry.SchemaIdVersion addSchemaVersion(com.hortonworks.registries.schemaregistry.SchemaMetadata schemaMetadata,
com.hortonworks.registries.schemaregistry.SchemaVersion schemaVersion,
boolean disableCanonicalCheck)
throws com.hortonworks.registries.schemaregistry.errors.InvalidSchemaException,
com.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaException,
com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException
addSchemaVersion in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.InvalidSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptionpublic com.hortonworks.registries.schemaregistry.SchemaIdVersion addSchemaVersion(java.lang.String schemaBranchName,
com.hortonworks.registries.schemaregistry.SchemaMetadata schemaMetadata,
com.hortonworks.registries.schemaregistry.SchemaVersion schemaVersion,
boolean disableCanonicalCheck)
throws com.hortonworks.registries.schemaregistry.errors.InvalidSchemaException,
com.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaException,
com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException
addSchemaVersion in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.InvalidSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptionpublic com.hortonworks.registries.schemaregistry.SchemaIdVersion uploadSchemaVersion(java.lang.String schemaName,
java.lang.String description,
java.io.InputStream schemaVersionTextFile)
throws com.hortonworks.registries.schemaregistry.errors.InvalidSchemaException,
com.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaException,
com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException
uploadSchemaVersion in interface com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClientcom.hortonworks.registries.schemaregistry.errors.InvalidSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptionpublic com.hortonworks.registries.schemaregistry.SchemaIdVersion uploadSchemaVersion(java.lang.String schemaBranchName,
java.lang.String schemaName,
java.lang.String description,
java.io.InputStream schemaVersionInputStream)
throws com.hortonworks.registries.schemaregistry.errors.InvalidSchemaException,
com.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaException,
com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException
uploadSchemaVersion in interface com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClientcom.hortonworks.registries.schemaregistry.errors.InvalidSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptionpublic com.hortonworks.registries.schemaregistry.SchemaIdVersion addSchemaVersion(java.lang.String schemaName,
com.hortonworks.registries.schemaregistry.SchemaVersion schemaVersion,
boolean disableCanonicalCheck)
throws com.hortonworks.registries.schemaregistry.errors.InvalidSchemaException,
com.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaException,
com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException
addSchemaVersion in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.InvalidSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptionpublic com.hortonworks.registries.schemaregistry.SchemaIdVersion addSchemaVersion(java.lang.String schemaBranchName,
java.lang.String schemaName,
com.hortonworks.registries.schemaregistry.SchemaVersion schemaVersion,
boolean disableCanonicalCheck)
throws com.hortonworks.registries.schemaregistry.errors.InvalidSchemaException,
com.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaException,
com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException
addSchemaVersion in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.InvalidSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptionpublic void deleteSchemaVersion(com.hortonworks.registries.schemaregistry.SchemaVersionKey schemaVersionKey)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.state.SchemaLifecycleException
deleteSchemaVersion in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.state.SchemaLifecycleExceptionpublic static com.hortonworks.registries.common.catalog.CatalogResponse readCatalogResponse(java.lang.String msg)
public com.hortonworks.registries.schemaregistry.SchemaVersionInfo getSchemaVersionInfo(com.hortonworks.registries.schemaregistry.SchemaIdVersion schemaIdVersion)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException
getSchemaVersionInfo in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptionpublic com.hortonworks.registries.schemaregistry.SchemaVersionInfo getLatestSchemaVersionInfo(java.lang.String schemaName)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException
getLatestSchemaVersionInfo in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptionpublic com.hortonworks.registries.schemaregistry.SchemaVersionInfo getSchemaVersionInfo(com.hortonworks.registries.schemaregistry.SchemaVersionKey schemaVersionKey)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException
getSchemaVersionInfo in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptionpublic com.hortonworks.registries.schemaregistry.SchemaVersionInfo getLatestSchemaVersionInfo(java.lang.String schemaBranchName,
java.lang.String schemaName)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException
getLatestSchemaVersionInfo in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptionpublic java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaVersionInfo> getAllVersions(java.lang.String schemaName)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException
getAllVersions in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptionpublic void enableSchemaVersion(java.lang.Long schemaVersionId)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.state.SchemaLifecycleException,
com.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaException
enableSchemaVersion in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.state.SchemaLifecycleExceptioncom.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaExceptionpublic void disableSchemaVersion(java.lang.Long schemaVersionId)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.state.SchemaLifecycleException
disableSchemaVersion in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.state.SchemaLifecycleExceptionpublic void deleteSchemaVersion(java.lang.Long schemaVersionId)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.state.SchemaLifecycleException
deleteSchemaVersion in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.state.SchemaLifecycleExceptionpublic void archiveSchemaVersion(java.lang.Long schemaVersionId)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.state.SchemaLifecycleException
archiveSchemaVersion in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.state.SchemaLifecycleExceptionpublic void startSchemaVersionReview(java.lang.Long schemaVersionId)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.state.SchemaLifecycleException
startSchemaVersionReview in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.state.SchemaLifecycleExceptionpublic com.hortonworks.registries.schemaregistry.SchemaVersionMergeResult mergeSchemaVersion(java.lang.Long schemaVersionId,
boolean disableCanonicalCheck)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaException
mergeSchemaVersion in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaExceptionpublic void transitionState(java.lang.Long schemaVersionId,
java.lang.Byte targetStateId,
byte[] transitionDetails)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.state.SchemaLifecycleException
transitionState in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.state.SchemaLifecycleExceptionpublic com.hortonworks.registries.schemaregistry.state.SchemaVersionLifecycleStateMachineInfo getSchemaVersionLifecycleStateMachineInfo()
getSchemaVersionLifecycleStateMachineInfo in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic com.hortonworks.registries.schemaregistry.SchemaBranch createSchemaBranch(java.lang.Long schemaVersionId,
com.hortonworks.registries.schemaregistry.SchemaBranch schemaBranch)
throws com.hortonworks.registries.schemaregistry.errors.SchemaBranchAlreadyExistsException,
com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException
createSchemaBranch in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaBranchAlreadyExistsExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptionpublic java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaBranch> getSchemaBranches(java.lang.String schemaName)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException
getSchemaBranches in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptionpublic void deleteSchemaBranch(java.lang.Long schemaBranchId)
throws com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException,
com.hortonworks.registries.schemaregistry.errors.InvalidSchemaBranchDeletionException
deleteSchemaBranch in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.InvalidSchemaBranchDeletionExceptionpublic java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaVersionInfo> getAllVersions(java.lang.String schemaBranchName,
java.lang.String schemaName,
java.util.List<java.lang.Byte> stateIds)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException
getAllVersions in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptionpublic java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaVersionInfo> getAllVersions(java.lang.String schemaBranchName,
java.lang.String schemaName)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException
getAllVersions in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptionpublic java.util.List<com.hortonworks.registries.schemaregistry.AggregatedSchemaMetadataInfo> findAggregatedSchemas(java.lang.String schemaName,
java.lang.String schemaDescription,
java.lang.String orderByFields)
findAggregatedSchemas in interface com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClientpublic java.util.List<com.hortonworks.registries.schemaregistry.SchemaMetadataInfo> findAllSchemas()
findAllSchemas in interface com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClientpublic com.hortonworks.registries.schemaregistry.CompatibilityResult checkCompatibility(java.lang.String schemaName,
java.lang.String toSchemaText)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException
checkCompatibility in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptionpublic com.hortonworks.registries.schemaregistry.CompatibilityResult checkCompatibility(java.lang.String schemaBranchName,
java.lang.String schemaName,
java.lang.String toSchemaText)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException
checkCompatibility in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicecom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptionpublic boolean isCompatibleWithAllVersions(java.lang.String schemaName,
java.lang.String toSchemaText)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException
isCompatibleWithAllVersions in interface com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClientcom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptionpublic boolean isCompatibleWithAllVersions(java.lang.String schemaBranchName,
java.lang.String schemaName,
java.lang.String toSchemaText)
throws com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException,
com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException
isCompatibleWithAllVersions in interface com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClientcom.hortonworks.registries.schemaregistry.errors.SchemaNotFoundExceptioncom.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundExceptionpublic java.util.Collection<com.hortonworks.registries.schemaregistry.SchemaVersionKey> findSchemasByFields(com.hortonworks.registries.schemaregistry.SchemaFieldQuery schemaFieldQuery)
findSchemasByFields in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic java.lang.String uploadFile(java.io.InputStream inputStream)
uploadFile in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic java.io.InputStream downloadFile(java.lang.String fileId)
downloadFile in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic java.lang.Long addSerDes(com.hortonworks.registries.schemaregistry.SerDesPair serDesPair)
addSerDes in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic void mapSchemaWithSerDes(java.lang.String schemaName,
java.lang.Long serDesId)
mapSchemaWithSerDes in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic <T> T getDefaultSerializer(java.lang.String type)
throws com.hortonworks.registries.schemaregistry.serde.SerDesException
getDefaultSerializer in interface com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClientcom.hortonworks.registries.schemaregistry.serde.SerDesExceptionpublic <T> T getDefaultDeserializer(java.lang.String type)
throws com.hortonworks.registries.schemaregistry.serde.SerDesException
getDefaultDeserializer in interface com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClientcom.hortonworks.registries.schemaregistry.serde.SerDesExceptionpublic java.util.Collection<com.hortonworks.registries.schemaregistry.SerDesInfo> getSerDes(java.lang.String schemaName)
getSerDes in interface com.hortonworks.registries.schemaregistry.ISchemaRegistryServicepublic <T> T createSerializerInstance(com.hortonworks.registries.schemaregistry.SerDesInfo serDesInfo)
createSerializerInstance in interface com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClientpublic <T> T createDeserializerInstance(com.hortonworks.registries.schemaregistry.SerDesInfo serDesInfo)
createDeserializerInstance in interface com.hortonworks.registries.schemaregistry.client.ISchemaRegistryClientpublic void close()
Closes the client and all open connections.
If Kerberos was enabled this will also close the Kerberos ticket management thread. We will wait up to 1 second for the thread to close. In case the thread doesn't shut down in time, you will see a warning in the logs.close in interface java.lang.AutoCloseablepublic com.hortonworks.registries.common.SchemaRegistryVersion clientVersion()