use of org.apache.pulsar.common.naming.NamespaceName in project incubator-pulsar by apache.
the class NamespacesImpl method setPersistence.
@Override
public void setPersistence(String namespace, PersistencePolicies persistence) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "persistence");
request(path).post(Entity.entity(persistence, 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 setDispatchRate.
@Override
public void setDispatchRate(String namespace, DispatchRate dispatchRate) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "dispatchRate");
request(path).post(Entity.entity(dispatchRate, 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 unload.
@Override
public void unload(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "unload");
request(path).put(Entity.entity("", 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 getPolicies.
@Override
public Policies getPolicies(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns);
return request(path).get(Policies.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 clearNamespaceBundleBacklog.
@Override
public void clearNamespaceBundleBacklog(String namespace, String bundle) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, bundle, "clearBacklog");
request(path).post(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
Aggregations