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 aStitchClientConfiguration
object.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs a new builder.
-
Method Summary
Modifier and Type Method Description StitchClientConfiguration
build()
Builds theStitchAppClientConfiguration
.String
getBaseUrl()
Gets the base URL of the Stitch server that the client will communicate with.CodecRegistry
getCodecRegistry()
Gets the codec registry used to encode/decode JSON.String
getDataDirectory()
Gets the local directory in which Stitch can store any data (e.g.Long
getDefaultRequestTimeout()
Gets the number of milliseconds that a `Transport` should spend by default on an HTTP round trip before failing with an error.NetworkMonitor
getNetworkMonitor()
Gets theNetworkMonitor
that the client will used to check internet status.Storage
getStorage()
Gets the underlying storage to persist client specific data to.Transport
getTransport()
Gets theTransport
that the client will use to make round trips to the Stitch server.StitchClientConfiguration.Builder
withBaseUrl(String baseUrl)
Sets the base URL of the Stitch server that the client will communicate with.StitchClientConfiguration.Builder
withCodecRegistry(CodecRegistry codecRegistry)
Merges the provided codec registry with the default codec registry.StitchClientConfiguration.Builder
withDataDirectory(String dataDirectory)
Sets the local directory in which Stitch can store any data (e.g.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.StitchClientConfiguration.Builder
withNetworkMonitor(NetworkMonitor networkMonitor)
Sets theNetworkMonitor
that the client will used to check internet status.StitchClientConfiguration.Builder
withStorage(Storage storage)
Sets the underlying storage to persist client specific data to.StitchClientConfiguration.Builder
withTransport(Transport transport)
Sets theTransport
that 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 theTransport
that the client will use to make round trips to the Stitch server.- Parameters:
transport
- theTransport
that 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 theNetworkMonitor
that the client will used to check internet status.- Parameters:
networkMonitor
- theNetworkMonitor
that 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 theTransport
that the client will use to make round trips to the Stitch server.- Returns:
- the
Transport
that 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 theNetworkMonitor
that the client will used to check internet status.- Returns:
- the
NetworkMonitor
that the client will used to check internet status.
-
build
public StitchClientConfiguration build()
Builds theStitchAppClientConfiguration
.- Returns:
- the built
StitchAppClientConfiguration
.
-
-