Package com.mongodb.stitch.core
Class StitchClientConfiguration.Builder
- java.lang.Object
-
- com.mongodb.stitch.core.StitchClientConfiguration.Builder
-
- Direct Known Subclasses:
StitchAppClientConfiguration.Builder
- Enclosing class:
- StitchClientConfiguration
public static class StitchClientConfiguration.Builder extends Object
A builder that can build aStitchClientConfigurationobject.
-
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new builder.
-
Method Summary
Modifier and Type Method Description StitchClientConfigurationbuild()Builds theStitchAppClientConfiguration.StringgetBaseUrl()Gets the base URL of the Stitch server that the client will communicate with.CodecRegistrygetCodecRegistry()Gets the codec registry used to encode/decode JSON.StringgetDataDirectory()Gets the local directory in which Stitch can store any data (e.g.LonggetDefaultRequestTimeout()Gets the number of milliseconds that a `Transport` should spend by default on an HTTP round trip before failing with an error.NetworkMonitorgetNetworkMonitor()Gets theNetworkMonitorthat the client will used to check internet status.StoragegetStorage()Gets the underlying storage to persist client specific data to.TransportgetTransport()Gets theTransportthat the client will use to make round trips to the Stitch server.StitchClientConfiguration.BuilderwithBaseUrl(String baseUrl)Sets the base URL of the Stitch server that the client will communicate with.StitchClientConfiguration.BuilderwithCodecRegistry(CodecRegistry codecRegistry)Merges the provided codec registry with the default codec registry.StitchClientConfiguration.BuilderwithDataDirectory(String dataDirectory)Sets the local directory in which Stitch can store any data (e.g.StitchClientConfiguration.BuilderwithDefaultRequestTimeout(Long defaultRequestTimeout)Sets the number of milliseconds that a `Transport` should spend by default on an HTTP round trip before failing with an error.StitchClientConfiguration.BuilderwithNetworkMonitor(NetworkMonitor networkMonitor)Sets theNetworkMonitorthat the client will used to check internet status.StitchClientConfiguration.BuilderwithStorage(Storage storage)Sets the underlying storage to persist client specific data to.StitchClientConfiguration.BuilderwithTransport(Transport transport)Sets theTransportthat the client will use to make round trips to the Stitch server.
-
-
-
Method Detail
-
withBaseUrl
public StitchClientConfiguration.Builder withBaseUrl(String baseUrl)
Sets the base URL of the Stitch server that the client will communicate with.- Parameters:
baseUrl- the base URL of the Stitch server that the client will communicate with.- Returns:
- the builder.
-
withStorage
public StitchClientConfiguration.Builder withStorage(Storage storage)
Sets the underlying storage to persist client specific data to.- Parameters:
storage- the underlying storage to persist client specific data to.- Returns:
- the builder.
-
withDataDirectory
public StitchClientConfiguration.Builder withDataDirectory(String dataDirectory)
Sets the local directory in which Stitch can store any data (e.g. embedded MongoDB data directory).- Parameters:
dataDirectory- the local directory in which Stitch can store any data.- Returns:
- the builder.
-
withTransport
public StitchClientConfiguration.Builder withTransport(Transport transport)
Sets theTransportthat the client will use to make round trips to the Stitch server.- Parameters:
transport- theTransportthat the client will use to make round trips to the Stitch server.- Returns:
- the builder.
-
withDefaultRequestTimeout
public StitchClientConfiguration.Builder withDefaultRequestTimeout(Long defaultRequestTimeout)
Sets the number of milliseconds that a `Transport` should spend by default on an HTTP round trip before failing with an error. Important: If a request timeout was specified for a specific operation, for example in a function call, that timeout will override this one.- Parameters:
defaultRequestTimeout- the number of milliseconds that a `Transport` should spend by default on an HTTP round trip before failing with an error.- Returns:
- the builder.
-
withCodecRegistry
public StitchClientConfiguration.Builder withCodecRegistry(CodecRegistry codecRegistry)
Merges the provided codec registry with the default codec registry.- Parameters:
codecRegistry- the codec registry to merge with the default registry.- Returns:
- the builder.
-
withNetworkMonitor
public StitchClientConfiguration.Builder withNetworkMonitor(NetworkMonitor networkMonitor)
Sets theNetworkMonitorthat the client will used to check internet status.- Parameters:
networkMonitor- theNetworkMonitorthat the client will use check internet status.- Returns:
- the builder.
-
getBaseUrl
public String getBaseUrl()
Gets the base URL of the Stitch server that the client will communicate with.- Returns:
- the base URL of the Stitch server that the client will communicate with.
-
getDataDirectory
public String getDataDirectory()
Gets the local directory in which Stitch can store any data (e.g. embedded MongoDB data directory).- Returns:
- the local directory in which Stitch can store any data.
-
getStorage
public Storage getStorage()
Gets the underlying storage to persist client specific data to.- Returns:
- the underlying storage to persist client specific data to.
-
getTransport
public Transport getTransport()
Gets theTransportthat the client will use to make round trips to the Stitch server.- Returns:
- the
Transportthat the client will use to make round trips to the Stitch server.
-
getDefaultRequestTimeout
public Long getDefaultRequestTimeout()
Gets the number of milliseconds that a `Transport` should spend by default on an HTTP round trip before failing with an error. Important: If a request timeout was specified for a specific operation, for example in a function call, that timeout will override this one.- Returns:
- the number of milliseconds that a `Transport` should spend by default on an HTTP round trip before failing with an error.
-
getCodecRegistry
public CodecRegistry getCodecRegistry()
Gets the codec registry used to encode/decode JSON.- Returns:
- the codec registry used to encode/decode JSON.
-
getNetworkMonitor
public NetworkMonitor getNetworkMonitor()
Gets theNetworkMonitorthat the client will used to check internet status.- Returns:
- the
NetworkMonitorthat the client will used to check internet status.
-
build
public StitchClientConfiguration build()
Builds theStitchAppClientConfiguration.- Returns:
- the built
StitchAppClientConfiguration.
-
-