com.hazelcast.client.config

## Class XmlClientFailoverConfigBuilder

- java.lang.Object
- - com.hazelcast.config.AbstractXmlConfigHelper
  - - com.hazelcast.config.AbstractXmlConfigBuilder
    - - com.hazelcast.client.config.XmlClientFailoverConfigBuilder

-     public class XmlClientFailoverConfigBuilder
      extends AbstractXmlConfigBuilder

  Loads the `ClientFailoverConfig` using XML.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.hazelcast.config.AbstractXmlConfigBuilder

      `AbstractXmlConfigBuilder.ConfigType`

  - ### Field Summary

    - ### Fields inherited from class com.hazelcast.config.AbstractXmlConfigHelper

      `domLevel3`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlClientFailoverConfigBuilder()` Loads the client failover config using the following resolution mechanism: first it checks if a system property 'hazelcast.client.failover.config' is set.
    `XmlClientFailoverConfigBuilder(File file)`
    `XmlClientFailoverConfigBuilder(InputStream in)`
    `XmlClientFailoverConfigBuilder(String resource)`
    `XmlClientFailoverConfigBuilder(URL url)`
    `XmlClientFailoverConfigBuilder(XmlClientFailoverConfigLocator locator)` Constructs a `XmlClientFailoverConfigBuilder` that loads the configuration with the provided `XmlClientFailoverConfigLocator`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClientFailoverConfig` | `build()`
    `ClientFailoverConfig` | `build(ClientFailoverConfig clientFailoverConfig)`
    `protected AbstractXmlConfigBuilder.ConfigType` | `getConfigType()`
    `protected Document` | `parse(InputStream inputStream)` Reads XML from InputStream and parses.
    `void` | `setProperties(Properties properties)`

    - ### Methods inherited from class com.hazelcast.config.AbstractXmlConfigBuilder

      `getProperties, process, setPropertiesInternal`

    - ### Methods inherited from class com.hazelcast.config.AbstractXmlConfigHelper

      `appendToken, getNamespaceType, getReleaseVersion, loadSchemaFile, schemaValidation, xmlToJavaName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XmlClientFailoverConfigBuilder

          public XmlClientFailoverConfigBuilder(String resource)
                                         throws IOException

      Throws:
        `IOException`

    - #### XmlClientFailoverConfigBuilder

          public XmlClientFailoverConfigBuilder(File file)
                                         throws IOException

      Throws:
        `IOException`

    - #### XmlClientFailoverConfigBuilder

          public XmlClientFailoverConfigBuilder(URL url)
                                         throws IOException

      Throws:
        `IOException`

    - #### XmlClientFailoverConfigBuilder

          public XmlClientFailoverConfigBuilder(InputStream in)

    - #### XmlClientFailoverConfigBuilder

          public XmlClientFailoverConfigBuilder()

      Loads the client failover config using the following resolution mechanism:
      1. first it checks if a system property 'hazelcast.client.failover.config' is set. If it exist and it begins with 'classpath:', then a classpath resource is loaded. Else it will assume it is a file reference. The configuration file or resource will be loaded only if the postfix of its name ends with '.xml'.
      2. it checks if a hazelcast-client-failover.xml is available in the working dir
      3. it checks if a hazelcast-client-failover.xml is available on the classpath
      Throws:
        `HazelcastException` - if no failover configuration is found

    - #### XmlClientFailoverConfigBuilder

          public XmlClientFailoverConfigBuilder(XmlClientFailoverConfigLocator locator)

      Constructs a `XmlClientFailoverConfigBuilder` that loads the configuration with the provided `XmlClientFailoverConfigLocator`.

      If the provided `XmlClientFailoverConfigLocator` is `null`, a new instance is created and the config is located in every possible places. For these places, please see `XmlClientFailoverConfigLocator`.

      If the provided `XmlClientFailoverConfigLocator` is not `null`, it is expected that it already located the configuration XML to load from. No further attempt to locate the configuration XML is made if the configuration XML is not located already.
      Parameters:
        `locator` - the configured locator to use
      Throws:
        `HazelcastException` - if no failover configuration is found

  - ### Method Detail

    - #### parse

          protected Document parse(InputStream inputStream)
                            throws Exception

      Description copied from class: `AbstractXmlConfigBuilder`
      Reads XML from InputStream and parses.
      Specified by:
        `parse` in class `AbstractXmlConfigBuilder`
      Parameters:
        `inputStream` - `InputStream` to read from
      Returns:
        Document after parsing XML
      Throws:
        `Exception` - if the XML configuration cannot be parsed or is invalid

    - #### getConfigType

          protected AbstractXmlConfigBuilder.ConfigType getConfigType()

      Specified by:
        `getConfigType` in class `AbstractXmlConfigBuilder`
      Returns:
        ConfigType of current config class as enum value

    - #### build

          public ClientFailoverConfig build()

    - #### build

          public ClientFailoverConfig build(ClientFailoverConfig clientFailoverConfig)

    - #### setProperties

          public void setProperties(Properties properties)

Copyright © 2020. All rights reserved.