Interface WritableAggregate

All Superinterfaces:
Aggregate, Resource

public interface WritableAggregate extends Aggregate
An Aggregate with writing capabilities. Writable­Aggregate inherits the reading capabilities from its parent and adds the capabilities to add or remove resources.
Since:
1.0
  • Method Details

    • add

      Resource add(Resource resource) throws DataStoreException
      Adds a new Resource in this Aggregate. The given Resource will 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:

      Data transformation

      Copying information between stores may produce differences in many aspects. The range of changes depends both on the original Resource structure and the target Resource structure. If the differences are too large, then this Aggregate may throw an exception.
      Parameters:
      resource - the resource to copy in this Aggregate.
      Returns:
      the effectively added resource. May be resource itself if it has been added verbatim.
      Throws:
      Data­Store­Exception - if the given resource cannot be stored in this Aggregate.
    • remove

      void remove(Resource resource) throws DataStoreException
      Removes a Resource from this Aggregate. The given resource should be one of the instances returned by Aggregate​.components(). This operation is destructive in two aspects:
      • The Resource and it's data will be deleted from the Data­Store.
      • The given resource may become invalid and should not be used anymore after this method call.
      Parameters:
      resource - child resource to remove from this Aggregate.
      Throws:
      Data­Store­Exception - if the given resource could not be removed.