CommandDtoFactory
Used to serialize the intention to invoke an action or edit a property as a CommandDto , for example such that it can be persisted and then executed at some later time or even against some external system.
There are some similarities to org.apache.causeway.core.metamodel.services.ixn.InteractionDtoFactory , which is used to instantiate an org.apache.causeway.schema.ixn.v2.InteractionDto that represents the actual execution of the action invocation or property edit.
API
interface CommandDtoFactory {
CommandDto asCommandDto(UUID interactionId, InteractionHead targetHead, ObjectAction objectAction, Can<ManagedObject> argAdapters) (1)
CommandDto asCommandDto(UUID interactionId, InteractionHead targetHead, OneToOneAssociation association, ManagedObject valueAdapterOrNull) (2)
void addActionArgs(InteractionHead head, ObjectAction objectAction, ActionDto actionDto, Can<ManagedObject> argAdapters) (3)
void addPropertyValue(InteractionHead interactionHead, OneToOneAssociation property, PropertyDto propertyDto, ManagedObject valueAdapter) (4)
}
1 | asCommandDto(UUID, InteractionHead, ObjectAction, Can)
Returns a CommandDto that represents the intention to invoke an action on a target object (or target objects, to support the notion of bulk actions). |
2 | asCommandDto(UUID, InteractionHead, OneToOneAssociation, ManagedObject)
Returns a CommandDto that represents the intention to edit (set or clear) a property on a target (or possibly many targets, for symmetry with actions). |
3 | addActionArgs(InteractionHead, ObjectAction, ActionDto, Can)
Adds the arguments of an action to an ActionDto (the element within a CommandDto representing an action invocation). |
4 | addPropertyValue(InteractionHead, OneToOneAssociation, PropertyDto, ManagedObject)
Adds the new value argument of a property to a PropertyDto (the element a CommandDto representing an property edit). |
Members
asCommandDto(UUID, InteractionHead, ObjectAction, Can)
Returns a CommandDto that represents the intention to invoke an action on a target object (or target objects, to support the notion of bulk actions).
asCommandDto(UUID, InteractionHead, OneToOneAssociation, ManagedObject)
Returns a CommandDto that represents the intention to edit (set or clear) a property on a target (or possibly many targets, for symmetry with actions).
addActionArgs(InteractionHead, ObjectAction, ActionDto, Can)
Adds the arguments of an action to an ActionDto (the element within a CommandDto representing an action invocation).
This is used when the command is actually executed to populate the parameters of the equivalent org.apache.causeway.schema.ixn.v2.ActionInvocationDto
addPropertyValue(InteractionHead, OneToOneAssociation, PropertyDto, ManagedObject)
Adds the new value argument of a property to a PropertyDto (the element a CommandDto representing an property edit).
This is used when the command is actually executed to set the the new value of the equivalent org.apache.causeway.schema.ixn.v2.PropertyEditDto .