use of org.apache.pulsar.common.protocol.schema.DeleteSchemaResponse in project pulsar by yahoo.
the class SchemasImpl method deleteSchemaAsync.
@Override
public CompletableFuture<Void> deleteSchemaAsync(String topic, boolean force) {
WebTarget path = schemaPath(TopicName.get(topic)).queryParam("force", Boolean.toString(force));
final CompletableFuture<Void> future = new CompletableFuture<>();
try {
request(path).async().delete(new InvocationCallback<DeleteSchemaResponse>() {
@Override
public void completed(DeleteSchemaResponse deleteSchemaResponse) {
future.complete(null);
}
@Override
public void failed(Throwable throwable) {
future.completeExceptionally(getApiException(throwable.getCause()));
}
});
} catch (PulsarAdminException cae) {
future.completeExceptionally(cae);
}
return future;
}
use of org.apache.pulsar.common.protocol.schema.DeleteSchemaResponse in project incubator-pulsar by apache.
the class SchemasImpl method deleteSchemaAsync.
@Override
public CompletableFuture<Void> deleteSchemaAsync(String topic, boolean force) {
WebTarget path = schemaPath(TopicName.get(topic)).queryParam("force", Boolean.toString(force));
final CompletableFuture<Void> future = new CompletableFuture<>();
try {
request(path).async().delete(new InvocationCallback<DeleteSchemaResponse>() {
@Override
public void completed(DeleteSchemaResponse deleteSchemaResponse) {
future.complete(null);
}
@Override
public void failed(Throwable throwable) {
future.completeExceptionally(getApiException(throwable.getCause()));
}
});
} catch (PulsarAdminException cae) {
future.completeExceptionally(cae);
}
return future;
}
use of org.apache.pulsar.common.protocol.schema.DeleteSchemaResponse in project pulsar by apache.
the class SchemasImpl method deleteSchemaAsync.
@Override
public CompletableFuture<Void> deleteSchemaAsync(String topic) {
TopicName tn = TopicName.get(topic);
final CompletableFuture<Void> future = new CompletableFuture<>();
try {
request(schemaPath(tn)).async().delete(new InvocationCallback<DeleteSchemaResponse>() {
@Override
public void completed(DeleteSchemaResponse deleteSchemaResponse) {
future.complete(null);
}
@Override
public void failed(Throwable throwable) {
future.completeExceptionally(getApiException(throwable.getCause()));
}
});
} catch (PulsarAdminException cae) {
future.completeExceptionally(cae);
}
return future;
}
Aggregations