Class NoSQLPublisherConfig.Builder

  • Enclosing class:
    NoSQLPublisherConfig

    public static class NoSQLPublisherConfig.Builder
    extends java.lang.Object
    Builder to help construct a NoSQLPublisherConfig instance
    • Constructor Detail

      • Builder

        public Builder​(KVStoreConfig kvStoreConfig,
                       java.lang.String rootPath)
                throws java.lang.IllegalArgumentException
        Creates a publisher configuration with following default parameter values:
        • Shard timeout in milliseconds: 600000L
        • Maximum number of subscriptions: 32
        • Null login credentials
        • Null reauthenticate handler
        Parameters:
        kvStoreConfig - kvstore configuration
        rootPath - path to the publisher root directory
        Throws:
        java.lang.IllegalArgumentException - if missing or invalid parameters
    • Method Detail

      • build

        public NoSQLPublisherConfig build()
        Builds a NoSQLSubscriptionConfig instance from builder
        Returns:
        a NoSQLSubscriptionConfig instance
      • setReauthHandler

        public NoSQLPublisherConfig.Builder setReauthHandler​(ReauthenticateHandler reauthHandler)
        Sets reauthentication handler. If null, the default login handler will be used.
        Parameters:
        reauthHandler - reauthentication handler
        Returns:
        this instance
      • setMaxConcurrentSubs

        public NoSQLPublisherConfig.Builder setMaxConcurrentSubs​(int maxConcurrentSubs)
                                                          throws java.lang.IllegalArgumentException
        Sets maximum concurrently running subscriptions in publisher
        Parameters:
        maxConcurrentSubs - maximum concurrently running subscriptions
        Returns:
        this instance
        Throws:
        java.lang.IllegalArgumentException - if maximum concurrently running subscriptions is smaller than 1.
      • setShardTimeoutMs

        public NoSQLPublisherConfig.Builder setShardTimeoutMs​(long shardTimeoutMs)
                                                       throws java.lang.IllegalArgumentException
        Sets shard timeout in milliseconds. No shard timeout if set to 0.
        Parameters:
        shardTimeoutMs - shard timeout in milliseconds
        Returns:
        this instance
        Throws:
        java.lang.IllegalArgumentException - if shard timeout is smaller than 0.
      • setAllowPreexistDir

        public NoSQLPublisherConfig.Builder setAllowPreexistDir​(boolean allow)
        Sets if pre-exist directory is allowed
        Parameters:
        allow - true if pre-exist directory is allowed
        Returns:
        this instance
      • setPublisherId

        public NoSQLPublisherConfig.Builder setPublisherId​(java.lang.String publisherId)
        Sets the publisher id
        Parameters:
        publisherId - publisher id
        Returns:
        this instance