use of org.apache.pulsar.common.naming.NamespaceName in project incubator-pulsar by apache.
the class NamespacesImpl method setMaxConsumersPerSubscription.
@Override
public void setMaxConsumersPerSubscription(String namespace, int maxConsumersPerSubscription) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "maxConsumersPerSubscription");
request(path).post(Entity.entity(maxConsumersPerSubscription, MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of org.apache.pulsar.common.naming.NamespaceName in project incubator-pulsar by apache.
the class NamespacesImpl method getDispatchRate.
@Override
public DispatchRate getDispatchRate(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "dispatchRate");
return request(path).get(DispatchRate.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of org.apache.pulsar.common.naming.NamespaceName in project incubator-pulsar by apache.
the class NonPersistentTopicsImpl method getListInBundleAsync.
@Override
public CompletableFuture<List<String>> getListInBundleAsync(String namespace, String bundleRange) {
NamespaceName ns = NamespaceName.get(namespace);
final CompletableFuture<List<String>> future = new CompletableFuture<>();
WebTarget path = namespacePath(ns, bundleRange);
asyncGetRequest(path, new InvocationCallback<List<String>>() {
@Override
public void completed(List<String> response) {
future.complete(response);
}
@Override
public void failed(Throwable throwable) {
future.completeExceptionally(getApiException(throwable.getCause()));
}
});
return future;
}
use of org.apache.pulsar.common.naming.NamespaceName in project incubator-pulsar by apache.
the class PersistentTopicsImpl method getList.
@Override
public List<String> getList(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns);
return request(path).get(new GenericType<List<String>>() {
});
} catch (Exception e) {
throw getApiException(e);
}
}
use of org.apache.pulsar.common.naming.NamespaceName in project incubator-pulsar by apache.
the class ResourceQuotasImpl method getNamespaceBundleResourceQuota.
public ResourceQuota getNamespaceBundleResourceQuota(String namespace, String bundle) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, bundle);
return request(path).get(ResourceQuota.class);
} catch (Exception e) {
throw getApiException(e);
}
}
Aggregations