Interface WritableAggregate
-
Nested Class Summary
Nested classes/interfaces inherited from interface Resource
Resource.FileSetModifier and TypeInterfaceDescriptionstatic classPaths to the files potentially used by the enclosing resource. -
Method Summary
Methods inherited from interface Aggregate
componentsModifier and TypeMethodDescriptionCollection<? extends Resource> Returns the children resources of this aggregate.Methods inherited from interface Resource
addListener, getFileSet, getIdentifier, getMetadata, removeListenerModifier and TypeMethodDescriptiondefault <T extends StoreEvent>
voidaddListener(Class<T> eventType, StoreListener<? super T> listener) Registers a listener to notify when the specified kind of event occurs in this resource or in children.default Optional<Resource.FileSet> Gets the paths to the files potentially used by this resource.default Optional<GenericName> Returns the resource persistent identifier.Returns information about this resource.default <T extends StoreEvent>
voidremoveListener(Class<T> eventType, StoreListener<? super T> listener) Unregisters a listener previously added to this resource for the given type of events.
-
Method Details
-
add
Adds a newResourcein thisAggregate. The givenResourcemay 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:- types and properties names
CoordinateReferenceSystemMetadata
Data transformation
Copying information between stores may produce differences in many aspects. The range of changes depends both on the originalResourcestructure and the targetResourcestructure. If the differences are too large, then thisAggregatemay throw an exception.- Parameters:
resource- the resource to copy in thisAggregate.- Returns:
- the effectively added resource. May be
resourceitself if it has been added verbatim. - Throws:
DataStoreException- if the given resource cannot be stored in thisAggregate.
-
remove
Removes aResourcefrom thisAggregate. The given resource should be one of the instances returned byAggregate.components(). This operation is destructive in two aspects:- The
Resourceand it's data will be deleted from theDataStore. - The given resource may become invalid and should not be used anymore after this method call.
- Parameters:
resource- child resource to remove from thisAggregate.- Throws:
DataStoreException- if the given resource could not be removed.
- The
-