public interface Dbms extends Document, HasParent<Project>, HasEnabled, HasName, HasChildren, HasAlias, HasMainInterface, HasMutator<DbmsMutator<? extends Dbms>>
Document
that represents a dbms instance in the database. A
Dbms
is located inside a Project
and can have multiple
Schemas
as children.Modifier and Type | Field and Description |
---|---|
static String |
CONNECTION_URL |
static String |
IP_ADDRESS |
static String |
PORT |
static String |
SCHEMAS |
static String |
TYPE_NAME |
static String |
USERNAME |
ENABLED, ENABLED_DEFAULT
DOCUMENT_LIST_TYPE
Modifier and Type | Method and Description |
---|---|
default String |
defaultConnectionUrl(Speedment speedment)
Creates a default connection URL for this
Dbms by looking up the
DbmsType and using its
DbmsType.getConnectionUrlGenerator() to produce a default value. |
default int |
defaultPort(Speedment speedment)
Returns the default port for the current database type.
|
default Optional<String> |
getConnectionUrl()
Returns the explicit connection URL to use for this
Dbms if the
user has specified one, or an empty Optional if one should be
generated automatically by the DbmsType . |
default Optional<String> |
getIpAddress()
Returns the address of the database host if it is specified.
|
default OptionalInt |
getPort()
Returns the port number of the database on the database host.
|
default String |
getTypeName()
Returns the type name of the
DbmsType of this Dbms . |
default Optional<String> |
getUsername()
Returns the database username to use when connecting to the dbms.
|
default Class<Dbms> |
mainInterface()
Returns the
Class of the interface of this node. |
default DbmsMutator<? extends Dbms> |
mutator()
Returns a
DocumentMutator for this Document. |
Stream<? extends Schema> |
schemas()
Creates a stream of schemas located in this document.
|
getParent, getParentOrThrow
isEnabled, of, test
defaultNameFor
getAlias, getJavaName, of
ancestors, children, children, childrenByKey, get, getAsBoolean, getAsDouble, getAsInt, getAsLong, getAsString, getData, put, stream
static final String TYPE_NAME
static final String IP_ADDRESS
static final String PORT
static final String CONNECTION_URL
static final String USERNAME
static final String SCHEMAS
default String getTypeName()
DbmsType
of this Dbms
. This
will be the fully qualified class name of the DbmsType
implementing class.default Optional<String> getIpAddress()
empty
will be returned.empty
default OptionalInt getPort()
empty
is returned.empty
default int defaultPort(Speedment speedment) throws SpeedmentException
Warning, this method does not take a custom port set in the
PORT
property into consideration. For the actual
port to use, call getPort()
.
speedment
- the Speedment
instanceSpeedmentException
- if the DbmsType
couldn't be founddefault Optional<String> getConnectionUrl()
Dbms
if the
user has specified one, or an empty Optional
if one should be
generated automatically by the DbmsType
.Dbms
default String defaultConnectionUrl(Speedment speedment) throws SpeedmentException
Dbms
by looking up the
DbmsType
and using its
DbmsType.getConnectionUrlGenerator()
to produce a default value.
Warning, this method does not take a custom connection URL set in the
CONNECTION_URL
property into consideration. For the actual
connection URL to use, call
DocumentDbUtil.findConnectionUrl(Speedment, Dbms)
.
speedment
- the Speedment
instanceSpeedmentException
- if the DbmsType
couldn't be founddefault Optional<String> getUsername()
empty
is returned.empty
Stream<? extends Schema> schemas()
default Class<Dbms> mainInterface()
HasMainInterface
Class
of the interface of this node.
This should not be overridden by implementing classes!
mainInterface
in interface HasMainInterface
default DbmsMutator<? extends Dbms> mutator()
HasMutator
DocumentMutator
for this Document. A DocumentMutator
allows a Document to be updated in a type safe way.mutator
in interface HasMutator<DbmsMutator<? extends Dbms>>
Copyright © 2016 Speedment, Inc.. All rights reserved.