Package io.micronaut.data.connection
Interface ConnectionDefinition
- All Known Implementing Classes:
DefaultConnectionDefinition
public interface ConnectionDefinition
The connection definition.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Possible propagation values. -
Field Summary
Modifier and TypeFieldDescriptionstatic final ConnectionDefinition
The default transaction definition.static final ConnectionDefinition.Propagation
Use the default propagation value.static final ConnectionDefinition
A read only definition.static final ConnectionDefinition
A requires new definition. -
Method Summary
Modifier and TypeMethodDescription@Nullable String
getName()
Return the name of this connection.@NonNull ConnectionDefinition.Propagation
Return the propagation behavior.Return the connection timeout.Return whether this is a read-only connection.static @NonNull ConnectionDefinition
Create a newConnectionDefinition
with a given name.static @NonNull ConnectionDefinition
of
(@NonNull ConnectionDefinition.Propagation propagationBehaviour) Create a newConnectionDefinition
for the given behaviour.@NonNull ConnectionDefinition
Connection definition with specific name.@NonNull ConnectionDefinition
withPropagation
(ConnectionDefinition.Propagation propagation) Connection definition with specific propagation.
-
Field Details
-
PROPAGATION_DEFAULT
Use the default propagation value. -
DEFAULT
The default transaction definition. -
READ_ONLY
A read only definition. -
REQUIRES_NEW
A requires new definition.
-
-
Method Details
-
getPropagationBehavior
Return the propagation behavior.- Returns:
- The propagation behaviour
-
getTimeout
Return the connection timeout.- Returns:
- The optional timeout
-
isReadOnly
Return whether this is a read-only connection.- Returns:
- The optional read only
-
getName
Return the name of this connection.- Returns:
- The optional name
-
withPropagation
@NonNull @NonNull ConnectionDefinition withPropagation(ConnectionDefinition.Propagation propagation) Connection definition with specific propagation.- Parameters:
propagation
- The new propagation- Returns:
- A new connection definition with specified propagation
-
withName
Connection definition with specific name.- Parameters:
name
- The new name- Returns:
- A new connection definition with specified name
-
of
@NonNull static @NonNull ConnectionDefinition of(@NonNull @NonNull ConnectionDefinition.Propagation propagationBehaviour) Create a newConnectionDefinition
for the given behaviour.- Parameters:
propagationBehaviour
- The behaviour- Returns:
- The definition
-
named
Create a newConnectionDefinition
with a given name.- Parameters:
name
- The name- Returns:
- The definition
-