Class StaticTenantConnectPredicate
java.lang.Object
io.axoniq.framework.messaging.multitenancy.configuration.StaticTenantConnectPredicate
- All Implemented Interfaces:
TenantConnectPredicate,Predicate<TenantDescriptor>
A
TenantConnectPredicate that accepts a fixed set of tenant identifiers.
Applications using the Configuration API load their configuration properties themselves and pass the property's
comma-separated value to from(String) when registering an instance as the
TenantConnectPredicate component.
- Since:
- 5.4.0
- Author:
- Jan Galinski
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe property containing a comma-separated list of tenant identifiers. -
Constructor Summary
ConstructorsConstructorDescriptionStaticTenantConnectPredicate(Set<String> tenants) Creates a predicate accepting the given tenant identifiers. -
Method Summary
Modifier and TypeMethodDescriptionstatic StaticTenantConnectPredicateCreates a predicate from a comma-separated list of tenant identifiers.booleantest(TenantDescriptor tenantDescriptor) Tests whether the tenant identifier is in this predicate's fixed set.
-
Field Details
-
TENANTS_PROPERTY
The property containing a comma-separated list of tenant identifiers.- See Also:
-
-
Constructor Details
-
StaticTenantConnectPredicate
Creates a predicate accepting the given tenant identifiers.- Parameters:
tenants- the tenant identifiers to accept
-
-
Method Details
-
from
Creates a predicate from a comma-separated list of tenant identifiers.Whitespace around an identifier and empty entries are ignored.
- Parameters:
tenantsCsv- the comma-separated tenant identifiers- Returns:
- a predicate accepting the tenant identifiers in
tenantsCsv
-
test
Tests whether the tenant identifier is in this predicate's fixed set.- Specified by:
testin interfacePredicate<TenantDescriptor>- Parameters:
tenantDescriptor- the tenant to test- Returns:
truewhen the tenant identifier is configured
-