public abstract class AdminResource extends PulsarWebResource
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.pulsar.common.naming.NamespaceName |
namespaceName |
protected org.apache.pulsar.common.naming.TopicName |
topicName |
httpRequest, NOT_IMPLEMENTED, servletContext, uri| Constructor and Description |
|---|
AdminResource() |
| Modifier and Type | Method and Description |
|---|---|
protected BookKeeper |
bookKeeper() |
protected void |
checkArgument(boolean b,
String errorMessage) |
protected boolean |
checkBacklogQuota(org.apache.pulsar.common.policies.data.BacklogQuota quota,
org.apache.pulsar.common.policies.data.RetentionPolicies retention) |
protected void |
checkNotNull(Object o,
String errorMessage) |
static <T> T |
checkNotNull(T reference) |
protected CompletableFuture<Boolean> |
checkTopicExistsAsync(org.apache.pulsar.common.naming.TopicName topicName)
Check the exists topics contains the given topic.
|
protected void |
checkTopicLevelPolicyEnable() |
protected Set<String> |
clusters() |
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl |
dispatchRate() |
protected String |
domain()
Get the domain of the topic (whether it's persistent or non-persistent).
|
protected static org.apache.pulsar.common.partition.PartitionedTopicMetadata |
fetchPartitionedTopicMetadata(PulsarService pulsar,
org.apache.pulsar.common.naming.TopicName topicName) |
protected static org.apache.pulsar.common.partition.PartitionedTopicMetadata |
fetchPartitionedTopicMetadataCheckAllowAutoCreation(PulsarService pulsar,
org.apache.pulsar.common.naming.TopicName topicName) |
protected org.apache.pulsar.common.policies.data.Policies |
getNamespacePolicies(org.apache.pulsar.common.naming.NamespaceName namespaceName) |
protected org.apache.pulsar.common.policies.data.Policies |
getNamespacePolicies(String tenant,
String cluster,
String namespace) |
protected CompletableFuture<org.apache.pulsar.common.policies.data.Policies> |
getNamespacePoliciesAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName) |
protected Set<String> |
getNamespaceReplicatedClusters(org.apache.pulsar.common.naming.NamespaceName namespaceName) |
protected List<String> |
getPartitionedTopicList(org.apache.pulsar.common.naming.TopicDomain topicDomain) |
protected org.apache.pulsar.common.partition.PartitionedTopicMetadata |
getPartitionedTopicMetadata(org.apache.pulsar.common.naming.TopicName topicName,
boolean authoritative,
boolean checkAllowAutoCreation) |
protected CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata> |
getPartitionedTopicMetadataAsync(org.apache.pulsar.common.naming.TopicName topicName,
boolean authoritative,
boolean checkAllowAutoCreation) |
protected CompletableFuture<org.apache.pulsar.common.policies.data.SchemaCompatibilityStrategy> |
getSchemaCompatibilityStrategyAsync() |
protected List<String> |
getTopicPartitionList(org.apache.pulsar.common.naming.TopicDomain topicDomain) |
protected CompletableFuture<Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> |
getTopicPoliciesAsyncWithRetry(org.apache.pulsar.common.naming.TopicName topicName) |
protected void |
internalCreatePartitionedTopic(javax.ws.rs.container.AsyncResponse asyncResponse,
int numPartitions,
boolean createLocalTopicOnly) |
protected boolean |
isLeaderBroker() |
protected boolean |
isManagedLedgerNotFoundException(Exception e) |
protected boolean |
isNamespaceReplicated(org.apache.pulsar.common.naming.NamespaceName namespaceName) |
static com.fasterxml.jackson.databind.ObjectMapper |
jsonMapper() |
protected void |
mergeNamespaceWithDefaults(org.apache.pulsar.common.policies.data.Policies policies,
String namespace,
String namespacePath) |
protected org.apache.pulsar.common.policies.data.BacklogQuota |
namespaceBacklogQuota(org.apache.pulsar.common.naming.NamespaceName namespace,
org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType) |
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl |
replicatorDispatchRate() |
protected void |
resumeAsyncResponseExceptionally(javax.ws.rs.container.AsyncResponse asyncResponse,
Throwable throwable) |
protected void |
setServletContext(javax.servlet.ServletContext servletContext) |
protected org.apache.pulsar.common.policies.data.SubscribeRate |
subscribeRate() |
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl |
subscriptionDispatchRate() |
protected CompletableFuture<Void> |
tryCreatePartitionsAsync(int numPartitions) |
protected void |
validateAdminAccessForTenant(String property)
Checks that the http client role has admin access to the specified tenant.
|
protected void |
validateBundleOwnership(String property,
String cluster,
String namespace,
boolean authoritative,
boolean readOnly,
NamespaceBundle bundle) |
protected void |
validateClusterExists(String cluster) |
protected void |
validateGlobalNamespaceOwnership() |
protected void |
validateNamespaceName(String property,
String namespace) |
protected void |
validateNamespaceName(String property,
String cluster,
String namespace)
Deprecated.
|
protected void |
validatePartitionedTopicMetadata(String tenant,
String namespace,
String encodedTopic) |
protected void |
validatePartitionedTopicName(String tenant,
String namespace,
String encodedTopic) |
protected void |
validatePersistencePolicies(org.apache.pulsar.common.policies.data.PersistencePolicies persistence) |
protected void |
validatePersistentTopicName(String property,
String namespace,
String encodedTopic) |
protected void |
validatePersistentTopicName(String property,
String cluster,
String namespace,
String encodedTopic)
Deprecated.
|
void |
validatePoliciesReadOnlyAccess()
Checks whether the broker is allowed to do read-write operations based on the existence of a node in
configuration metadata-store.
|
void |
validateSuperUserAccess()
Checks whether the user has Pulsar Super-User access to the system.
|
protected void |
validateTopicName(String property,
String namespace,
String encodedTopic) |
protected void |
validateTopicName(String property,
String cluster,
String namespace,
String encodedTopic)
Deprecated.
|
bookieResources, canUpdateCluster, checkAuthorizationAsync, checkLocalOrGetPeerReplicationCluster, clientAppId, clientAuthData, clusterResources, config, dynamicConfigurationResources, getClusterDataIfDifferentCluster, getLocalPolicies, getPulsarResources, handleCommonRestAsyncException, hasActiveNamespace, hasSuperUserAccess, isBundleOwnedByAnyBroker, isClientAuthenticated, isLeaderBroker, isRequestHttps, namespaceIsolationPolicies, namespaceResources, originalPrincipal, pulsar, resourceGroupResources, setPulsar, splitPath, tenantResources, topicResources, validateAdminAccessForTenant, validateAdminAccessForTenantAsync, validateBrokerName, validateBundleOwnership, validateClusterForTenant, validateClusterOwnership, validateGlobalNamespaceOwnership, validateGlobalNamespaceOwnershipAsync, validateNamespaceBundleOwnership, validateNamespaceBundleRange, validateNamespaceOperation, validateNamespaceOperationAsync, validateNamespacePolicyOperation, validateTenantOperation, validateTopicOperation, validateTopicOperation, validateTopicOperationAsync, validateTopicOperationAsync, validateTopicOwnership, validateTopicOwnershipAsync, validateTopicPolicyOperationprotected org.apache.pulsar.common.naming.NamespaceName namespaceName
protected org.apache.pulsar.common.naming.TopicName topicName
protected BookKeeper bookKeeper()
protected String domain()
public void validateSuperUserAccess()
PulsarWebResourcevalidateSuperUserAccess in class PulsarWebResourceprotected void validateAdminAccessForTenant(String property)
PulsarWebResourcevalidateAdminAccessForTenant in class PulsarWebResourceproperty - the tenant idprotected void validateBundleOwnership(String property, String cluster, String namespace, boolean authoritative, boolean readOnly, NamespaceBundle bundle)
validateBundleOwnership in class PulsarWebResourceprotected boolean isLeaderBroker()
isLeaderBroker in class PulsarWebResourcepublic void validatePoliciesReadOnlyAccess()
validatePoliciesReadOnlyAccess in class PulsarWebResourcejavax.ws.rs.WebApplicationException - if broker has a read only access if broker is not connected to the configuration metadata-storeprotected CompletableFuture<Void> tryCreatePartitionsAsync(int numPartitions)
protected void validateGlobalNamespaceOwnership()
@Deprecated protected void validateNamespaceName(String property, String cluster, String namespace)
protected void validateTopicName(String property, String namespace, String encodedTopic)
protected void validatePersistentTopicName(String property, String namespace, String encodedTopic)
protected void validatePartitionedTopicName(String tenant, String namespace, String encodedTopic)
protected void validatePartitionedTopicMetadata(String tenant, String namespace, String encodedTopic)
@Deprecated protected void validateTopicName(String property, String cluster, String namespace, String encodedTopic)
@Deprecated protected void validatePersistentTopicName(String property, String cluster, String namespace, String encodedTopic)
protected org.apache.pulsar.common.policies.data.Policies getNamespacePolicies(org.apache.pulsar.common.naming.NamespaceName namespaceName)
protected CompletableFuture<org.apache.pulsar.common.policies.data.Policies> getNamespacePoliciesAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName)
protected void mergeNamespaceWithDefaults(org.apache.pulsar.common.policies.data.Policies policies,
String namespace,
String namespacePath)
protected org.apache.pulsar.common.policies.data.BacklogQuota namespaceBacklogQuota(org.apache.pulsar.common.naming.NamespaceName namespace,
org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType)
protected CompletableFuture<Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> getTopicPoliciesAsyncWithRetry(org.apache.pulsar.common.naming.TopicName topicName)
protected boolean checkBacklogQuota(org.apache.pulsar.common.policies.data.BacklogQuota quota,
org.apache.pulsar.common.policies.data.RetentionPolicies retention)
protected void checkTopicLevelPolicyEnable()
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl dispatchRate()
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl subscriptionDispatchRate()
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl replicatorDispatchRate()
protected org.apache.pulsar.common.policies.data.SubscribeRate subscribeRate()
public static com.fasterxml.jackson.databind.ObjectMapper jsonMapper()
protected void setServletContext(javax.servlet.ServletContext servletContext)
protected CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata> getPartitionedTopicMetadataAsync(org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, boolean checkAllowAutoCreation)
protected org.apache.pulsar.common.partition.PartitionedTopicMetadata getPartitionedTopicMetadata(org.apache.pulsar.common.naming.TopicName topicName,
boolean authoritative,
boolean checkAllowAutoCreation)
protected static org.apache.pulsar.common.partition.PartitionedTopicMetadata fetchPartitionedTopicMetadata(PulsarService pulsar, org.apache.pulsar.common.naming.TopicName topicName)
protected static org.apache.pulsar.common.partition.PartitionedTopicMetadata fetchPartitionedTopicMetadataCheckAllowAutoCreation(PulsarService pulsar, org.apache.pulsar.common.naming.TopicName topicName)
protected void validateClusterExists(String cluster)
validateClusterExists in class PulsarWebResourceprotected org.apache.pulsar.common.policies.data.Policies getNamespacePolicies(String tenant, String cluster, String namespace)
protected boolean isNamespaceReplicated(org.apache.pulsar.common.naming.NamespaceName namespaceName)
protected Set<String> getNamespaceReplicatedClusters(org.apache.pulsar.common.naming.NamespaceName namespaceName)
protected List<String> getPartitionedTopicList(org.apache.pulsar.common.naming.TopicDomain topicDomain)
protected List<String> getTopicPartitionList(org.apache.pulsar.common.naming.TopicDomain topicDomain)
protected void internalCreatePartitionedTopic(javax.ws.rs.container.AsyncResponse asyncResponse,
int numPartitions,
boolean createLocalTopicOnly)
protected CompletableFuture<Boolean> checkTopicExistsAsync(org.apache.pulsar.common.naming.TopicName topicName)
topicName - given topic nameprotected void resumeAsyncResponseExceptionally(javax.ws.rs.container.AsyncResponse asyncResponse,
Throwable throwable)
protected CompletableFuture<org.apache.pulsar.common.policies.data.SchemaCompatibilityStrategy> getSchemaCompatibilityStrategyAsync()
@CanIgnoreReturnValue public static <T> T checkNotNull(T reference)
protected boolean isManagedLedgerNotFoundException(Exception e)
protected void checkArgument(boolean b,
String errorMessage)
protected void validatePersistencePolicies(org.apache.pulsar.common.policies.data.PersistencePolicies persistence)
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.