Class MGConnectionConfiguration.Builder

  • Enclosing class:
    MGConnectionConfiguration

    public static class MGConnectionConfiguration.Builder
    extends java.lang.Object
    Builder to build MGConnectionConfiguration.
    • Constructor Detail

      • Builder

        public Builder()
        Constructor
    • Method Detail

      • setConnectionParameters

        public MGConnectionConfiguration.Builder setConnectionParameters​(java.lang.String url,
                                                                         int timeout,
                                                                         int readTimeout)
                                                                  throws MGConfigurationException
        Method to set Connection parameters of the MG Client Library. This method call is mandatory before calling build().
        Parameters:
        url - The connection URL where the MG Client Library will connect to.
        timeout - If the library is unable to connect to the server within this value, timeout will occur.
        readTimeout - If the library is able to connect to the server but reading the response did not finish within this value, timeout will occur.
        Returns:
        Builder
        Throws:
        MGConfigurationException
      • setRetryParameters

        public MGConnectionConfiguration.Builder setRetryParameters​(int count,
                                                                    int interval)
        Method to set Connection retry parameters of the MG Client Library
        Parameters:
        count - The number of retries the library will perform if the request can be retried.
        interval - The library will initiate another retry after this value for requests that can be retried.
        Returns:
        the builder with new parameters set