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
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumPossible propagation values. - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConnectionDefinitionThe default transaction definition.static final ConnectionDefinition.PropagationUse the default propagation value.static final ConnectionDefinitionA read only definition.static final ConnectionDefinitionA requires new definition. - 
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetName()Return the name of this connection.@NonNull ConnectionDefinition.PropagationReturn the propagation behavior.Return the connection timeout.Return whether this is a read-only connection.static @NonNull ConnectionDefinitionCreate a newConnectionDefinitionwith a given name.static @NonNull ConnectionDefinitionof(@NonNull ConnectionDefinition.Propagation propagationBehaviour) Create a newConnectionDefinitionfor the given behaviour.@NonNull ConnectionDefinitionConnection definition with specific name.@NonNull ConnectionDefinitionwithPropagation(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 newConnectionDefinitionfor the given behaviour.- Parameters:
 propagationBehaviour- The behaviour- Returns:
 - The definition
 
 - 
named
Create a newConnectionDefinitionwith a given name.- Parameters:
 name- The name- Returns:
 - The definition
 
 
 -