public interface WritableAggregate extends Aggregate
Aggregatewith writing capabilities.
WritableAggregateinherits the reading capabilities from its parent and adds the capabilities to add or remove resources.
Defined in the
addAdds a new
Aggregate. The given
Resourcewill be copied, and the effectively added resource returned. The effectively added resource may differ from the given resource in many aspects. The possible changes may include the followings but not only:Warning: copying information between stores may produce differences in many aspects. The range of changes depends both on the original
Resourcestructure and the target
Resourcestructure. If the differences are too large, then this
Aggregatemay throw an exception.
resource- the resource to copy in this
- the effectively added resource. May be
resourceitself if it has been added verbatim.
DataStoreException- if the given resource can not be stored in this
Aggregate. The given resource should be one of the instances returned by
Aggregate.components(). This operation is destructive in two aspects:
resource- child resource to remove from this
DataStoreException- if the given resource could not be removed.