use of org.apache.pulsar.client.admin.PulsarAdminException in project incubator-pulsar by apache.
the class NamespacesImpl method getMaxProducersPerTopic.
@Override
public int getMaxProducersPerTopic(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "maxProducersPerTopic");
return request(path).get(Integer.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 createNamespace.
@Override
public void createNamespace(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns);
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 grantPermissionOnNamespace.
@Override
public void grantPermissionOnNamespace(String namespace, String role, Set<AuthAction> actions) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "permissions", role);
request(path).post(Entity.entity(actions, 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 setNamespaceReplicationClusters.
@Override
public void setNamespaceReplicationClusters(String namespace, List<String> clusterIds) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "replication");
request(path).post(Entity.entity(clusterIds, 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 getReplicationConfigVersion.
@Override
public String getReplicationConfigVersion(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = NamespaceName.get(namespace);
WebTarget path = namespacePath(ns, "configversion");
return request(path).get(String.class);
} catch (Exception e) {
throw getApiException(e);
}
}
Aggregations