Class Configuration


  • public class Configuration
    extends java.lang.Object
    • Constructor Detail

      • Configuration

        public Configuration()
    • Method Detail

      • getEndpoint

        public java.lang.String getEndpoint()
      • withEndpoint

        public Configuration withEndpoint​(java.lang.String endpoint)
        Set the base api url. Defaults to https://seller.stuffusell.co.uk
        Parameters:
        endpoint - the base api url
        Returns:
        this instance
      • getAccessToken

        public java.lang.String getAccessToken()
        Get the api key id
        Returns:
        the api key
      • withAccessToken

        public Configuration withAccessToken​(java.lang.String accessToken)
        Set the access token used for authentication. Required.
        Parameters:
        accessToken - the api key
        Returns:
        this instance
      • getMaxConnectionsPerRoute

        public int getMaxConnectionsPerRoute()
        Get the max connections per route
        Returns:
        the max connections per route
      • withMaxConnectionsPerRoute

        public Configuration withMaxConnectionsPerRoute​(int maxConnectionsPerRoute)
        Set the effective maximum number of concurrent connections in the pool. Connections try to make use of the keep-alive directive. Defaults to 20
        Parameters:
        maxConnectionsPerRoute - the max connections per router
        Returns:
        this instance
      • getUserAgent

        public java.lang.String getUserAgent()
        Get the user agent string being to send in the request headers
        Returns:
        the user agent string
      • withUserAgent

        public Configuration withUserAgent​(java.lang.String userAgent)
        Set the user agent string sent in the request
        Parameters:
        userAgent - the user agent string
        Returns:
        this instance
      • isBlockTillRateLimitReset

        public boolean isBlockTillRateLimitReset()
        Will the client block until the rate limit reset window is reached if the rate limit is set
        Returns:
        true if it will block
      • withBlockTillRateLimitReset

        public Configuration withBlockTillRateLimitReset​(boolean blockTillRateLimitReset)
        Set whether the client should block if the rate limit has been reached until the reset timestamp has elapsed. Defaults to false
        Parameters:
        blockTillRateLimitReset - true to block, false otherwise
        Returns:
        this instance
      • getRequestsPerSecond

        public int getRequestsPerSecond()
        Get the configured requests per second for the account. Defaults to 5.
        Returns:
        requests per second
      • withRequestsPerSecond

        public Configuration withRequestsPerSecond​(int requestsPerSecond)
        Set the configured requests per second for the account. Defaults to 5.
        Parameters:
        requestsPerSecond - requests per second
        Returns:
        this instance
      • getRequestBurstSize

        public int getRequestBurstSize()
        Get the configured burst size for requests. Defaults to 20.
        Returns:
        requests per second
      • withRequestBurstSize

        public Configuration withRequestBurstSize​(int requestBurstSize)
        Set the configured burst size for requests. Defaults to 20.
        Parameters:
        requestBurstSize - requests per second
        Returns:
        this instance