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 SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic enumPossible propagation values.
- 
Field SummaryFieldsModifier 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 SummaryModifier 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_DEFAULTUse the default propagation value.
- 
DEFAULTThe default transaction definition.
- 
READ_ONLYA read only definition.
- 
REQUIRES_NEWA requires new definition.
 
- 
- 
Method Details- 
getPropagationBehaviorReturn the propagation behavior.- Returns:
- The propagation behaviour
 
- 
getTimeoutReturn the connection timeout.- Returns:
- The optional timeout
 
- 
isReadOnlyReturn whether this is a read-only connection.- Returns:
- The optional read only
 
- 
getNameReturn 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
 
- 
withNameConnection 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
 
- 
namedCreate a newConnectionDefinitionwith a given name.- Parameters:
- name- The name
- Returns:
- The definition
 
 
-