use of com.yahoo.pulsar.client.admin.PulsarAdminException in project pulsar by yahoo.
the class NamespacesImpl method revokePermissionsOnNamespace.
@Override
public void revokePermissionsOnNamespace(String namespace, String role) throws PulsarAdminException {
try {
NamespaceName ns = new NamespaceName(namespace);
request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("permissions").path(role)).delete(ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of com.yahoo.pulsar.client.admin.PulsarAdminException in project pulsar by yahoo.
the class NamespacesImpl method deleteNamespace.
@Override
public void deleteNamespace(String namespace) throws PulsarAdminException {
try {
NamespaceName ns = new NamespaceName(namespace);
request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName())).delete(ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of com.yahoo.pulsar.client.admin.PulsarAdminException in project pulsar by yahoo.
the class NamespacesImpl method clearNamespaceBundleBacklog.
@Override
public void clearNamespaceBundleBacklog(String namespace, String bundle) throws PulsarAdminException {
try {
NamespaceName ns = new NamespaceName(namespace);
request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path(bundle).path("clearBacklog")).post(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of com.yahoo.pulsar.client.admin.PulsarAdminException in project pulsar by yahoo.
the class NamespacesImpl method setNamespaceReplicationClusters.
@Override
public void setNamespaceReplicationClusters(String namespace, List<String> clusterIds) throws PulsarAdminException {
try {
NamespaceName ns = new NamespaceName(namespace);
request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("replication")).post(Entity.entity(clusterIds, MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of com.yahoo.pulsar.client.admin.PulsarAdminException in project pulsar by yahoo.
the class NamespacesImpl method clearNamespaceBacklogForSubscription.
@Override
public void clearNamespaceBacklogForSubscription(String namespace, String subscription) throws PulsarAdminException {
try {
NamespaceName ns = new NamespaceName(namespace);
request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("clearBacklog").path(subscription)).post(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
Aggregations