Module is.codion.framework.db
Package is.codion.framework.db
Interface EntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T,B>>
- Type Parameters:
T- the connection typeB- the builder type
- All Known Subinterfaces:
HttpEntityConnection.Builder,LocalEntityConnection.Builder,RemoteEntityConnection.Builder
- All Known Implementing Classes:
AbstractEntityConnection.AbstractBuilder,DefaultHttpEntityConnectionBuilder,DefaultLocalEntityConnectionBuilder,DefaultRemoteEntityConnectionBuilder
- Enclosing interface:
EntityConnection
public static interface EntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T,B>>
Builds a self-managing
EntityConnection.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()clientType(String clientType) If no client type is specified,DomainType.name()is used.clientVersion(@Nullable Version clientVersion) Sets the domain by instance, and thereby its type.domain(DomainType domainType) Sets the domain by type, leaving a connection needing the domain in-process to resolve an instance viaServiceLoader.boolean
-
Method Details
-
supports
- Parameters:
connectionType- the connection type- Returns:
- true if this builder supports the given connection type, e.g. "local", "remote" or "http"
-
user
- Parameters:
user- the user- Returns:
- this builder instance
-
domain
Sets the domain by type, leaving a connection needing the domain in-process to resolve an instance via
ServiceLoader.Discards an instance previously set via
domain(Domain)unless it is of this type.- Parameters:
domainType- the domain type to base this connection on- Returns:
- this builder instance
- See Also:
-
domain
Sets the domain by instance, and thereby its type. Connections which run the domain in-process (a local connection for example) use the given instance directly, instead of resolving one via
ServiceLoaderfrom itsDomain.type().Supplying an instance keeps the
ServiceLoaderout of the picture entirely.- Parameters:
domain- the domain instance to base this connection on- Returns:
- this builder instance
- See Also:
-
clientId
- Parameters:
clientId- the UUID identifying this client connection- Returns:
- this builder instance
-
clientType
If no client type is specified,DomainType.name()is used.- Parameters:
clientType- a String identifying the client type for this connection- Returns:
- this builder instance
- See Also:
-
clientVersion
- Parameters:
clientVersion- the client version- Returns:
- this builder instance
-
build
T build()- Returns:
- a new
EntityConnectioninstance
-