use of org.apache.pulsar.client.admin.PulsarAdminException in project incubator-pulsar by apache.
the class NamespacesImpl method unloadNamespaceBundle.
@Override
public void unloadNamespaceBundle(String namespace, String bundle) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, bundle, "unload");
request(path).put(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of org.apache.pulsar.client.admin.PulsarAdminException in project incubator-pulsar by apache.
the class NamespacesImpl method getPersistence.
@Override
public PersistencePolicies getPersistence(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "persistence");
return request(path).get(PersistencePolicies.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of org.apache.pulsar.client.admin.PulsarAdminException in project incubator-pulsar by apache.
the class NamespacesImpl method setNamespaceMessageTTL.
@Override
public void setNamespaceMessageTTL(String namespace, int ttlInSeconds) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "messageTTL");
request(path).post(Entity.entity(ttlInSeconds, MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of org.apache.pulsar.client.admin.PulsarAdminException in project incubator-pulsar by apache.
the class NamespacesImpl method unsubscribeNamespace.
@Override
public void unsubscribeNamespace(String namespace, String subscription) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "unsubscribe", subscription);
request(path).post(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of org.apache.pulsar.client.admin.PulsarAdminException in project incubator-pulsar by apache.
the class NamespacesImpl method setMaxConsumersPerTopic.
@Override
public void setMaxConsumersPerTopic(String namespace, int maxConsumersPerTopic) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "maxConsumersPerTopic");
request(path).post(Entity.entity(maxConsumersPerTopic, MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
Aggregations