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, 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 static String |
getTopicNotFoundErrorMessage(String topic) |
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 CompletableFuture<Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> |
getTopicPoliciesAsyncWithRetry(org.apache.pulsar.common.naming.TopicName topicName,
boolean isGlobal) |
protected void |
internalCreatePartitionedTopic(javax.ws.rs.container.AsyncResponse asyncResponse,
int numPartitions,
boolean createLocalTopicOnly) |
protected void |
internalCreatePartitionedTopic(javax.ws.rs.container.AsyncResponse asyncResponse,
int numPartitions,
boolean createLocalTopicOnly,
Map<String,String> properties) |
protected boolean |
isLeaderBroker() |
protected boolean |
isManagedLedgerNotFoundException(Exception e) |
protected boolean |
isNamespaceReplicated(org.apache.pulsar.common.naming.NamespaceName namespaceName) |
protected static boolean |
isRedirectException(Throwable ex)
Check current exception whether is redirect exception.
|
static com.fasterxml.jackson.databind.ObjectMapper |
jsonMapper() |
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 static void |
resumeAsyncResponseExceptionally(javax.ws.rs.container.AsyncResponse asyncResponse,
Throwable exception) |
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.
|
CompletableFuture<Void> |
validatePoliciesReadOnlyAccessAsync() |
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, validateAdminAccessForTenantAsync, validateBrokerName, validateBundleOwnership, validateClusterForTenant, validateClusterOwnership, validateClusterOwnershipAsync, validateGlobalNamespaceOwnership, validateGlobalNamespaceOwnershipAsync, validateNamespaceBundleOwnership, validateNamespaceBundleRange, validateNamespaceOperation, validateNamespaceOperationAsync, validateNamespacePolicyOperation, validateNamespacePolicyOperationAsync, validatePeerClusterConflict, validateSuperUserAccessAsync, validateTenantOperation, validateTenantOperationAsync, validateTopicOperation, validateTopicOperation, validateTopicOperationAsync, validateTopicOperationAsync, validateTopicOwnership, validateTopicOwnershipAsync, validateTopicPolicyOperation, validateTopicPolicyOperationAsyncprotected 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-storepublic CompletableFuture<Void> validatePoliciesReadOnlyAccessAsync()
protected 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 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 CompletableFuture<Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> getTopicPoliciesAsyncWithRetry(org.apache.pulsar.common.naming.TopicName topicName, boolean isGlobal)
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 void internalCreatePartitionedTopic(javax.ws.rs.container.AsyncResponse asyncResponse,
int numPartitions,
boolean createLocalTopicOnly,
Map<String,String> properties)
protected CompletableFuture<Boolean> checkTopicExistsAsync(org.apache.pulsar.common.naming.TopicName topicName)
topicName - given topic nameprotected static void resumeAsyncResponseExceptionally(javax.ws.rs.container.AsyncResponse asyncResponse,
Throwable exception)
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)
protected static boolean isRedirectException(Throwable ex)
ex - The throwable.Copyright © 2017–2022 Apache Software Foundation. All rights reserved.