use of org.apache.pulsar.common.naming.NamespaceName in project incubator-pulsar by apache.
the class NamespacesImpl method getMaxConsumersPerTopic.
@Override
public int getMaxConsumersPerTopic(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "maxConsumersPerTopic");
return request(path).get(Integer.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 setBacklogQuota.
@Override
public void setBacklogQuota(String namespace, BacklogQuota backlogQuota) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "backlogQuota");
request(path).post(Entity.entity(backlogQuota, 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 deleteNamespace.
@Override
public void deleteNamespace(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns);
request(path).delete(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 setRetention.
@Override
public void setRetention(String namespace, RetentionPolicies retention) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "retention");
request(path).post(Entity.entity(retention, 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 setSubscriptionAuthMode.
@Override
public void setSubscriptionAuthMode(String namespace, SubscriptionAuthMode subscriptionAuthMode) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "subscriptionAuthMode");
request(path).post(Entity.entity(subscriptionAuthMode, MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
Aggregations