@Override public void clearNamespaceBundleBacklogForSubscription(String namespace, String bundle, String subscription) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path(bundle) .path("clearBacklog").path(subscription)).post(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class); } catch (Exception e) { throw getApiException(e); } }
@Override public void unsubscribeNamespace(String namespace, String subscription) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("unsubscribe") .path(subscription)).post(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class); } catch (Exception e) { throw getApiException(e); } }
@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); } }
@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); } }
@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); } }
@Override public void clearNamespaceBacklog(String namespace) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()) .path("clearBacklog")).post(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class); } catch (Exception e) { throw getApiException(e); } }
@Override public void setNamespaceMessageTTL(String namespace, int ttlInSeconds) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("messageTTL")) .post(Entity.entity(ttlInSeconds, MediaType.APPLICATION_JSON), ErrorData.class); } catch (Exception e) { throw getApiException(e); } }
@Override public List<String> getNamespaceReplicationClusters(String namespace) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); return request( namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("replication")) .get(new GenericType<List<String>>() { }); } catch (Exception e) { throw getApiException(e); } }
@Override public void setBacklogQuota(String namespace, BacklogQuota backlogQuota) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()) .path("backlogQuota")).post(Entity.entity(backlogQuota, MediaType.APPLICATION_JSON), ErrorData.class); } catch (Exception e) { throw getApiException(e); } }
@Override public void setPersistence(String namespace, PersistencePolicies persistence) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("persistence")) .post(Entity.entity(persistence, MediaType.APPLICATION_JSON), ErrorData.class); } catch (Exception e) { throw getApiException(e); } }
@Override public PersistencePolicies getPersistence(String namespace) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); return request( namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("persistence")) .get(PersistencePolicies.class); } catch (Exception e) { throw getApiException(e); } }
@Override public RetentionPolicies getRetention(String namespace) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); return request( namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("retention")) .get(RetentionPolicies.class); } catch (Exception e) { throw getApiException(e); } }
@Override public Map<String, Set<AuthAction>> getPermissions(String namespace) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); return request( namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("permissions")) .get(new GenericType<Map<String, Set<AuthAction>>>() { }); } catch (Exception e) { throw getApiException(e); } }
@Override public int getNamespaceMessageTTL(String namespace) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); return request( namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()).path("messageTTL")) .get(new GenericType<Integer>() { }); } catch (Exception e) { throw getApiException(e); } }
@Override public Map<BacklogQuotaType, BacklogQuota> getBacklogQuotaMap(String namespace) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); return request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName()) .path("backlogQuotaMap")).get(new GenericType<Map<BacklogQuotaType, BacklogQuota>>() { }); } catch (Exception e) { throw getApiException(e); } }
@Override public void unloadNamespaceBundle(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("unload")).put(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class); } catch (Exception e) { throw getApiException(e); } }
@Override public void splitNamespaceBundle(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("split")).put(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class); } catch (Exception e) { throw getApiException(e); } }
@Override public void createNamespace(String namespace, BundlesData bundlesData) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName())) .put(Entity.entity(bundlesData, MediaType.APPLICATION_JSON), ErrorData.class); } catch (Exception e) { throw getApiException(e); } }
@Override public void createNamespace(String namespace) throws PulsarAdminException { try { NamespaceName ns = new NamespaceName(namespace); request(namespaces.path(ns.getProperty()).path(ns.getCluster()).path(ns.getLocalName())) .put(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class); } catch (Exception e) { throw getApiException(e); } }
@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); } }