private void dataStoreChangeInternal(final TransactionEvent event) { final Object source = event.getSource(); if (!(source instanceof InsertElementType || source instanceof UpdateElementType || source instanceof DeleteElementType)) { return; } final EObject originatingTransactionRequest = (EObject) source; checkNotNull(originatingTransactionRequest, "No original transaction request exists"); final TransactionEventType type = event.getType(); if (TransactionEventType.POST_INSERT.equals(type)) { // no need to compute the bounds, they're the same than for PRE_INSERT return; } final QName featureTypeName = event.getLayerName(); final Set<String> affectedTileLayers = gwc.getTileLayersByFeatureType( featureTypeName.getNamespaceURI(), featureTypeName.getLocalPart()); if (affectedTileLayers.isEmpty()) { // event didn't touch a cached layer return; } final SimpleFeatureCollection affectedFeatures = event.getAffectedFeatures(); final ReferencedEnvelope affectedBounds = affectedFeatures.getBounds(); final TransactionType transaction = event.getRequest(); for (String tileLayerName : affectedTileLayers) { addLayerDirtyRegion(transaction, tileLayerName, affectedBounds); } }
private void dataStoreChangeInternal(final TransactionEvent event) { final Object source = event.getSource(); if (!(source instanceof InsertElementType || source instanceof UpdateElementType || source instanceof DeleteElementType)) { return; } final EObject originatingTransactionRequest = (EObject) source; checkNotNull(originatingTransactionRequest, "No original transaction request exists"); final TransactionEventType type = event.getType(); if (TransactionEventType.POST_INSERT.equals(type)) { // no need to compute the bounds, they're the same than for PRE_INSERT return; } final QName featureTypeName = event.getLayerName(); final Set<String> affectedTileLayers = gwc.getTileLayersByFeatureType( featureTypeName.getNamespaceURI(), featureTypeName.getLocalPart()); if (affectedTileLayers.isEmpty()) { // event didn't touch a cached layer return; } final SimpleFeatureCollection affectedFeatures = event.getAffectedFeatures(); final ReferencedEnvelope affectedBounds = affectedFeatures.getBounds(); final TransactionType transaction = event.getRequest(); TransactionRequest request = TransactionRequest.adapt(transaction); for (String tileLayerName : affectedTileLayers) { addLayerDirtyRegion(request, tileLayerName, affectedBounds); } }