Package io.serialized.client.aggregate
Class AggregateClient<T>
java.lang.Object
io.serialized.client.aggregate.AggregateClient<T>
public class AggregateClient<T> extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAggregateClient.Builder<T> -
Method Summary
Modifier and Type Method Description static <T> AggregateClient.Builder<T>aggregateClient(String aggregateType, Class<T> stateClass, SerializedClientConfig config)AggregateDelete<T>deleteById(UUID aggregateId)AggregateDelete<T>deleteById(UUID aggregateId, UUID tenantId)AggregateDelete<T>deleteByType()AggregateDelete<T>deleteByType(UUID tenantId)booleanexists(UUID aggregateId)Check if an aggregate exists.booleanexists(UUID aggregateId, UUID tenantId)Check if an aggregate exists for the given tenant.voidsave(AggregateRequest request)Save or append events to an aggregate according to the given requestvoidupdate(String aggregateId, AggregateUpdate<T> update)Update the aggregate.voidupdate(UUID aggregateId, AggregateUpdate<T> update)Update the aggregate.voidupdate(UUID aggregateId, UUID tenantId, AggregateUpdate<T> update)Update the aggregate.
-
Method Details
-
aggregateClient
public static <T> AggregateClient.Builder<T> aggregateClient(String aggregateType, Class<T> stateClass, SerializedClientConfig config) -
save
Save or append events to an aggregate according to the given request- Parameters:
request- the request to perform
-
update
Update the aggregate.The update will be performed using optimistic concurrency check depending on the
useOptimisticConcurrencyOnUpdateconfiguration flag.- Parameters:
aggregateId- The ID of the aggregate.update- Function that executes business logic and returns the resulting domain events.
-
update
Update the aggregate.The update will be performed using optimistic concurrency check depending on the
useOptimisticConcurrencyOnUpdateconfiguration flag.- Parameters:
aggregateId- The ID of the aggregate.update- Function that executes business logic and returns the resulting domain events.
-
update
Update the aggregate.The update will be performed using optimistic concurrency check depending on the
useOptimisticConcurrencyOnUpdateconfiguration flag.- Parameters:
aggregateId- The ID of the aggregate.tenantId- The ID of the tenant.update- Function that executes business logic and returns the resulting domain events.
-
deleteByType
-
deleteByType
-
deleteById
-
deleteById
-
exists
Check if an aggregate exists.- Parameters:
aggregateId- ID of aggregate to check.- Returns:
- True if aggregate with ID exists, false if not.
-
exists
Check if an aggregate exists for the given tenant.- Parameters:
aggregateId- ID of aggregate to check.tenantId- ID of tenant.- Returns:
- True if aggregate with ID exists, false if not.
-