}
public void execute(EObject element, TransactionType request, Map featureStores,
TransactionResponseType response, TransactionListener listener)
throws WFSTransactionException {
DeleteElementType delete = (DeleteElementType) element;
QName elementName = delete.getTypeName();
String handle = delete.getHandle();
long deleted = response.getTransactionSummary().getTotalDeleted().longValue();
SimpleFeatureStore store = DataUtilities.simple((FeatureStore) featureStores.get(elementName));
if (store == null) {
throw new WFSException("Could not locate FeatureStore for '" + elementName + "'");
}
String typeName = store.getSchema().getTypeName();
LOGGER.finer("Transaction Delete:" + element);
try {
Filter filter = (Filter) delete.getFilter();
// make sure all geometric elements in the filter have a crs, and that the filter
// is reprojected to store's native crs as well
CoordinateReferenceSystem declaredCRS = WFSReprojectionUtil.getDeclaredCrs(
store.getSchema(), request.getVersion());
filter = WFSReprojectionUtil.normalizeFilterCRS(filter, store.getSchema(), declaredCRS);
// notify listeners
TransactionEvent event = new TransactionEvent(TransactionEventType.PRE_DELETE,
elementName, store.getFeatures(filter));
event.setSource( delete );
listener.dataStoreChange( event );
// compute damaged area
Envelope damaged = store.getBounds(new Query(
delete.getTypeName().getLocalPart(), filter));
if (damaged == null) {
damaged = store.getFeatures(filter).getBounds();
}