Module is.codion.framework.db.core
Package is.codion.framework.db
Class AbstractEntityConnection.AbstractBuilder<T extends EntityConnection,B extends EntityConnection.Builder<T,B>>
java.lang.Object
is.codion.framework.db.AbstractEntityConnection.AbstractBuilder<T,B>
- Type Parameters:
T- theEntityConnectiontype built by this builderB- the builder type
- All Implemented Interfaces:
EntityConnection.Builder<T,B>
- Direct Known Subclasses:
DefaultHttpEntityConnectionBuilder,DefaultLocalEntityConnectionBuilder,DefaultRemoteEntityConnectionBuilder
- Enclosing class:
AbstractEntityConnection
public abstract static class AbstractEntityConnection.AbstractBuilder<T extends EntityConnection,B extends EntityConnection.Builder<T,B>>
extends Object
implements EntityConnection.Builder<T,B>
An abstract
EntityConnection.Builder.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Tbuild()Builds the connection and establishes the underlying one, so that one which can not be established is reported here rather than on first use, which login flows rely on.final Bfinal BclientType(String clientType) If no client type is specified,DomainType.name()is used.final BclientVersion(@Nullable Version clientVersion) protected abstract TSets the domain by instance.final Bdomain(DomainType domain) final booleanfinal B
-
Constructor Details
-
AbstractBuilder
- Parameters:
connectionType- a string describing the connection type
-
-
Method Details
-
supports
- Specified by:
supportsin interfaceEntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T, B>> - Parameters:
connectionType- the connection type- Returns:
- true if this builder supports the given connection type, e.g. "local", "remote" or "http"
-
user
- Specified by:
userin interfaceEntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T, B>> - Parameters:
user- the user- Returns:
- this builder instance
-
domain
- Specified by:
domainin interfaceEntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T, B>> - Parameters:
domain- the domain type to base this connection on- Returns:
- this builder instance
-
domain
Description copied from interface:EntityConnection.BuilderSets the domain by instance. Connections which run the domain in-process (a local connection for example) use the given instance directly, instead of resolving one viaServiceLoaderfrom itsDomain.type(); other connections use only itsDomain.type().- Specified by:
domainin interfaceEntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T, B>> - Parameters:
domain- the domain instance to base this connection on- Returns:
- this builder instance
- See Also:
-
clientId
- Specified by:
clientIdin interfaceEntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T, B>> - Parameters:
clientId- the UUID identifying this client connection- Returns:
- this builder instance
-
clientType
Description copied from interface:EntityConnection.BuilderIf no client type is specified,DomainType.name()is used.- Specified by:
clientTypein interfaceEntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T, B>> - Parameters:
clientType- a String identifying the client type for this connection- Returns:
- this builder instance
- See Also:
-
clientVersion
- Specified by:
clientVersionin interfaceEntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T, B>> - Parameters:
clientVersion- the client version- Returns:
- this builder instance
-
build
Builds the connection and establishes the underlying one, so that one which can not be established is reported here rather than on first use, which login flows rely on.- Specified by:
buildin interfaceEntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T, B>> - Returns:
- a new connected
EntityConnectioninstance
-
createConnection
- Returns:
- a new, as yet unconnected,
AbstractEntityConnectionbased on this builder
-