Class FeatureEvent
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- BatchFeatureEvent
The "Source" for FeatureEvents is taken to be a FeatureSource, rather than 
 DataStore. The is due to SimpleFeatureSource having a hold of Transaction information.
 
DataStore implementations will actually keep the list listeners sorted by TypeName, and can report FeatureWriter modifications as required (by filtering the Listener list by typeName and Transaction).
The Transaction.commit() operation will also need to provide notification, this shows up as a CHANGE event; with a bit more detail being available in the subclass BatchFeatureEvent.
- Since:
- GeoTools 2.0
- See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ReferencedEnvelopeIndicates the bounds in which the modification occurred.static final intEvent type constant denoting the removal of a feature.protected FeatureSourceThe FeatureSource broadcasting the event.protected FilterFilter used to indicate what content has changed.protected FeatureEvent.TypeIndicates one of Type.ADDED, Type.REMOVED, Type.CHANGEDFields inherited from class EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionFeatureEvent(Object source, FeatureEvent.Type type, ReferencedEnvelope bounds) Constructs a new FeatureEvent.FeatureEvent(Object source, FeatureEvent.Type type, ReferencedEnvelope bounds, Filter filter) Constructs a new FeatureEvent.FeatureEvent(FeatureEvent origional) Makes a deep copy of the provided event.
- 
Method SummaryModifier and TypeMethodDescriptionProvides access to the area modified (if known).intProvides information on the type of change that has occured.FeatureSource<? extends FeatureType,? extends Feature> Provides access to the SimpleFeatureSource which fired the event.Filter describing the content that was changed.getType()Provides information on the type of change that has occurred.voidsetFeatureSource(FeatureSource featureSource) Methods inherited from class EventObjectgetSource, toString
- 
Field Details- 
FEATURES_REMOVEDpublic static final int FEATURES_REMOVEDEvent type constant denoting the removal of a feature.This EventType is used when FeatureWriter.remove() is called. This action represents a Feature being removed from the DataStore. The FeatureWriter making the modification will need to check that typeNameit is modifing matches theFeatureSource.getSchema().getTypeName()before sending notification to any listeners on the FeatureSource.If the FeatureWriter is opperating against a Transaction it will need ensure that to check the FeatureSource.getTransaction() for a match before sending notification to any listeners on the FeatureSource. FeatureEvent.getBounds() should reflect the the Bounding Box of the removed Features. - See Also:
 
- 
typeIndicates one of Type.ADDED, Type.REMOVED, Type.CHANGED
- 
boundsIndicates the bounds in which the modification occurred.This value is allowed to by nullif this information is not known.
- 
featureSourceThe FeatureSource broadcasting the event.Please note when several FeatureSources are operating on different Transactions this value will not always line up with original FeatureSource represented by Event.getSource(). 
- 
filterFilter used to indicate what content has changed.This is often an Id filter. 
 
- 
- 
Constructor Details- 
FeatureEventMakes a deep copy of the provided event.
- 
FeatureEventConstructs a new FeatureEvent.- Parameters:
- source- The writer or feature store that fired the event
- type- One of FEATURE_CHANGED, FEATURE_REMOVED or FEATURE_ADDED
- bounds- The area modified by this change
 
- 
FeatureEventpublic FeatureEvent(Object source, FeatureEvent.Type type, ReferencedEnvelope bounds, Filter filter) Constructs a new FeatureEvent.- Parameters:
- source- The writer or feature store that fired the event
- type- One of FEATURE_CHANGED, FEATURE_REMOVED or FEATURE_ADDED
- bounds- The area modified by this change
 
 
- 
- 
Method Details- 
getFeatureSourceProvides access to the SimpleFeatureSource which fired the event.- Returns:
- The SimpleFeatureSource which was the event's source.
 
- 
setFeatureSource
- 
getEventTypepublic int getEventType()Provides information on the type of change that has occured. Possible types are: add, remove, change- Returns:
- an int which must be one of FEATURES_ADDED, FEATURES_REMOVED, FEATURES_CHANGED
 
- 
getTypeProvides information on the type of change that has occurred. Possible types are: add, remove, change- Returns:
- Type
 
- 
getBoundsProvides access to the area modified (if known).- Returns:
- A bounding box of the modifications or nullif unknown.
 
- 
getFilterFilter describing the content that was changed.- Returns:
- A filter that can be used to check if any cached content you are keeping needs to be updated, or Filter.INCLUDES if unknown.
 
 
-