io.streamnative.pulsar.handlers.kop.schemaregistry.model.SchemaStorage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulsar-kafka-schema-registry Show documentation
Show all versions of pulsar-kafka-schema-registry Show documentation
Kafka Compatible Schema Registry
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.streamnative.pulsar.handlers.kop.schemaregistry.model;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public interface SchemaStorage {
/**
* Get current tenant.
* @return
*/
String getTenant();
/**
* Find a schema by unique id.
*
* @param id the id
* @return the Schema or null
*/
CompletableFuture> findSchemaById(int id);
/**
* Find Schemas that have the same definition.
* @param schemaDefinition the expected schema
* @return the list of schemas
*/
CompletableFuture> findSchemaByDefinition(String schemaDefinition);
/**
* Get all existing subjects.
* @return
*/
CompletableFuture> getAllSubjects();
/**
* Get all versions for a given subject.
* @param subject the Subject
* @return the list of versions
*/
CompletableFuture> getAllVersionsForSubject(String subject);
/**
* Get all schemas for a given subject.
* @param subject the subject
* @param lookupFilter lookup filter
* @return the list of Schema
*/
CompletableFuture> getSchemasForSubject(String subject, LookupFilter lookupFilter);
/**
* Delete all the versions of a subject.
* @param subject the Subject
* @return the versions
*/
CompletableFuture> deleteSubject(String subject);
/**
* Lookup a schema by subject and version.
* @param subject the Subject
* @param version the Version
* @return the Schema
*/
CompletableFuture findSchemaBySubjectAndVersion(String subject, int version);
/**
* Create a new schema.
* @param subject the Subject
* @param schemaType the type
* @param schemaDefinition the schema
* @return the new Schema
*/
CompletableFuture createSchemaVersion(String subject, String schemaType, String schemaDefinition);
/**
* Get current compatibility mode for the given subject.
* @param subject
* @return the mode
*/
CompletableFuture getCompatibilityMode(String subject);
/**
* Set current compatibility mode for the given subject.
* @param subject
* @param mode the new mode
*/
CompletableFuture setCompatibilityMode(String subject, CompatibilityChecker.Mode mode);
}