Class AdminResource

    • Field Detail

      • namespaceName

        protected org.apache.pulsar.common.naming.NamespaceName namespaceName
      • topicName

        protected org.apache.pulsar.common.naming.TopicName topicName
    • Constructor Detail

      • AdminResource

        public AdminResource()
    • Method Detail

      • bookKeeper

        protected org.apache.bookkeeper.client.BookKeeper bookKeeper()
      • domain

        protected java.lang.String domain()
        Get the domain of the topic (whether it's persistent or non-persistent).
      • validateAdminAccessForTenant

        protected void validateAdminAccessForTenant​(java.lang.String property)
        Description copied from class: PulsarWebResource
        Checks that the http client role has admin access to the specified tenant.
        Overrides:
        validateAdminAccessForTenant in class PulsarWebResource
        Parameters:
        property - the tenant id
      • validateBundleOwnership

        protected void validateBundleOwnership​(java.lang.String property,
                                               java.lang.String cluster,
                                               java.lang.String namespace,
                                               boolean authoritative,
                                               boolean readOnly,
                                               NamespaceBundle bundle)
        Overrides:
        validateBundleOwnership in class PulsarWebResource
      • validatePoliciesReadOnlyAccess

        public void validatePoliciesReadOnlyAccess()
        Checks whether the broker is allowed to do read-write operations based on the existence of a node in configuration metadata-store.
        Overrides:
        validatePoliciesReadOnlyAccess in class PulsarWebResource
        Throws:
        javax.ws.rs.WebApplicationException - if broker has a read only access if broker is not connected to the configuration metadata-store
      • validatePoliciesReadOnlyAccessAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> validatePoliciesReadOnlyAccessAsync()
      • tryCreatePartitionsAsync

        protected java.util.concurrent.CompletableFuture<java.lang.Void> tryCreatePartitionsAsync​(int numPartitions)
      • validateNamespaceName

        protected void validateNamespaceName​(java.lang.String property,
                                             java.lang.String namespace)
      • validateGlobalNamespaceOwnership

        protected void validateGlobalNamespaceOwnership()
      • validateNamespaceName

        @Deprecated
        protected void validateNamespaceName​(java.lang.String property,
                                             java.lang.String cluster,
                                             java.lang.String namespace)
        Deprecated.
      • validateTopicName

        protected void validateTopicName​(java.lang.String property,
                                         java.lang.String namespace,
                                         java.lang.String encodedTopic)
      • validatePersistentTopicName

        protected void validatePersistentTopicName​(java.lang.String property,
                                                   java.lang.String namespace,
                                                   java.lang.String encodedTopic)
      • validatePartitionedTopicName

        protected void validatePartitionedTopicName​(java.lang.String tenant,
                                                    java.lang.String namespace,
                                                    java.lang.String encodedTopic)
      • validatePartitionedTopicMetadata

        protected void validatePartitionedTopicMetadata()
      • validateTopicName

        @Deprecated
        protected void validateTopicName​(java.lang.String property,
                                         java.lang.String cluster,
                                         java.lang.String namespace,
                                         java.lang.String encodedTopic)
        Deprecated.
      • validatePersistentTopicName

        @Deprecated
        protected void validatePersistentTopicName​(java.lang.String property,
                                                   java.lang.String cluster,
                                                   java.lang.String namespace,
                                                   java.lang.String encodedTopic)
        Deprecated.
      • validateAndGetWorkerService

        protected org.apache.pulsar.functions.worker.WorkerService validateAndGetWorkerService()
      • getNamespacePolicies

        protected org.apache.pulsar.common.policies.data.Policies getNamespacePolicies​(org.apache.pulsar.common.naming.NamespaceName namespaceName)
      • getNamespacePoliciesAsync

        protected java.util.concurrent.CompletableFuture<org.apache.pulsar.common.policies.data.Policies> getNamespacePoliciesAsync​(org.apache.pulsar.common.naming.NamespaceName namespaceName)
      • namespaceBacklogQuota

        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)
      • getTopicPoliciesAsyncWithRetry

        protected java.util.concurrent.CompletableFuture<java.util.Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> getTopicPoliciesAsyncWithRetry​(org.apache.pulsar.common.naming.TopicName topicName)
      • getTopicPoliciesAsyncWithRetry

        protected java.util.concurrent.CompletableFuture<java.util.Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> getTopicPoliciesAsyncWithRetry​(org.apache.pulsar.common.naming.TopicName topicName,
                                                                                                                                                                  boolean isGlobal)
      • checkBacklogQuota

        protected boolean checkBacklogQuota​(org.apache.pulsar.common.policies.data.BacklogQuota quota,
                                            org.apache.pulsar.common.policies.data.RetentionPolicies retention)
      • checkTopicLevelPolicyEnable

        protected void checkTopicLevelPolicyEnable()
      • dispatchRate

        protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl dispatchRate()
      • subscriptionDispatchRate

        protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl subscriptionDispatchRate()
      • replicatorDispatchRate

        protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl replicatorDispatchRate()
      • subscribeRate

        protected org.apache.pulsar.common.policies.data.SubscribeRate subscribeRate()
      • jsonMapper

        public static com.fasterxml.jackson.databind.ObjectMapper jsonMapper()
      • clusters

        protected java.util.Set<java.lang.String> clusters()
      • setServletContext

        protected void setServletContext​(javax.servlet.ServletContext servletContext)
      • getPartitionedTopicMetadata

        protected org.apache.pulsar.common.partition.PartitionedTopicMetadata getPartitionedTopicMetadata​(org.apache.pulsar.common.naming.TopicName topicName,
                                                                                                          boolean authoritative,
                                                                                                          boolean checkAllowAutoCreation)
      • getPartitionedTopicMetadataAsync

        protected java.util.concurrent.CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata> getPartitionedTopicMetadataAsync​(org.apache.pulsar.common.naming.TopicName topicName,
                                                                                                                                                       boolean authoritative,
                                                                                                                                                       boolean checkAllowAutoCreation)
      • fetchPartitionedTopicMetadata

        protected org.apache.pulsar.common.partition.PartitionedTopicMetadata fetchPartitionedTopicMetadata​(PulsarService pulsar,
                                                                                                            org.apache.pulsar.common.naming.TopicName topicName)
      • fetchPartitionedTopicMetadataCheckAllowAutoCreation

        protected org.apache.pulsar.common.partition.PartitionedTopicMetadata fetchPartitionedTopicMetadataCheckAllowAutoCreation​(PulsarService pulsar,
                                                                                                                                  org.apache.pulsar.common.naming.TopicName topicName)
      • getNamespacePolicies

        protected org.apache.pulsar.common.policies.data.Policies getNamespacePolicies​(java.lang.String tenant,
                                                                                       java.lang.String cluster,
                                                                                       java.lang.String namespace)
      • isNamespaceReplicated

        protected boolean isNamespaceReplicated​(org.apache.pulsar.common.naming.NamespaceName namespaceName)
      • getNamespaceReplicatedClusters

        protected java.util.Set<java.lang.String> getNamespaceReplicatedClusters​(org.apache.pulsar.common.naming.NamespaceName namespaceName)
      • getPartitionedTopicList

        protected java.util.List<java.lang.String> getPartitionedTopicList​(org.apache.pulsar.common.naming.TopicDomain topicDomain)
      • getTopicPartitionList

        protected java.util.List<java.lang.String> getTopicPartitionList()
      • internalCreatePartitionedTopic

        protected void internalCreatePartitionedTopic​(javax.ws.rs.container.AsyncResponse asyncResponse,
                                                      int numPartitions,
                                                      boolean createLocalTopicOnly)
      • internalCreatePartitionedTopic

        protected void internalCreatePartitionedTopic​(javax.ws.rs.container.AsyncResponse asyncResponse,
                                                      int numPartitions,
                                                      boolean createLocalTopicOnly,
                                                      java.util.Map<java.lang.String,​java.lang.String> properties)
      • checkTopicExistsAsync

        protected java.util.concurrent.CompletableFuture<java.lang.Boolean> checkTopicExistsAsync​(org.apache.pulsar.common.naming.TopicName topicName)
        Check the exists topics contains the given topic. Since there are topic partitions and non-partitioned topics in Pulsar, must ensure both partitions and non-partitioned topics are not duplicated. So, if compare with a partition name, we should compare to the partitioned name of this partition.
        Parameters:
        topicName - given topic name
      • resumeAsyncResponseExceptionally

        protected static void resumeAsyncResponseExceptionally​(javax.ws.rs.container.AsyncResponse asyncResponse,
                                                               java.lang.Throwable exception)
      • getSchemaCompatibilityStrategyAsync

        protected java.util.concurrent.CompletableFuture<org.apache.pulsar.common.policies.data.SchemaCompatibilityStrategy> getSchemaCompatibilityStrategyAsync()
      • getSchemaCompatibilityStrategyAsyncWithoutAuth

        protected java.util.concurrent.CompletableFuture<org.apache.pulsar.common.policies.data.SchemaCompatibilityStrategy> getSchemaCompatibilityStrategyAsyncWithoutAuth()
      • checkNotNull

        @CanIgnoreReturnValue
        public static <T> T checkNotNull​(T reference)
      • checkNotNull

        protected void checkNotNull​(java.lang.Object o,
                                    java.lang.String errorMessage)
      • isManagedLedgerNotFoundException

        protected boolean isManagedLedgerNotFoundException​(java.lang.Exception e)
      • checkArgument

        protected void checkArgument​(boolean b,
                                     java.lang.String errorMessage)
      • validatePersistencePolicies

        protected void validatePersistencePolicies​(org.apache.pulsar.common.policies.data.PersistencePolicies persistence)
      • isRedirectException

        protected static boolean isRedirectException​(java.lang.Throwable ex)
        Check current exception whether is redirect exception.
        Parameters:
        ex - The throwable.
        Returns:
        Whether is redirect exception
      • getTopicNotFoundErrorMessage

        protected static java.lang.String getTopicNotFoundErrorMessage​(java.lang.String topic)
      • getSubNotFoundErrorMessage

        protected static java.lang.String getSubNotFoundErrorMessage​(java.lang.String topic,
                                                                     java.lang.String subscription)