Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/DatacageBackendListener.java @ 4357:11cf29eb002c
FacetTypes: New type: exreme_wq_curve_base (for the Stuetz-Q-Poits).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 02 Nov 2012 11:58:11 +0100 |
parents | cbe2febe30cc |
children |
line wrap: on
line source
package de.intevation.flys.artifacts.datacage; import java.util.List; import de.intevation.artifacts.Artifact; import de.intevation.artifacts.ArtifactCollection; import de.intevation.artifacts.GlobalContext; import de.intevation.artifacts.User; import de.intevation.artifactdatabase.BackendListener; import de.intevation.artifactdatabase.Backend; import org.apache.log4j.Logger; import org.w3c.dom.Document; /** Triggers Datacage to update db. */ public class DatacageBackendListener implements BackendListener { private static Logger log = Logger.getLogger(DatacageBackendListener.class); protected GlobalContext context; public DatacageBackendListener() { log.debug("new DatacageBackendListener"); } protected Datacage getDatacage() { Object listener = context.get(Datacage.DATACAGE_KEY); return listener instanceof Datacage ? (Datacage)listener : null; } @Override public void setup(GlobalContext context) { log.debug("setup"); this.context = context; Datacage l = getDatacage(); if (l != null) { l.setup(context); } } @Override public void createdArtifact(Artifact artifact, Backend backend) { log.debug("createdArtifact"); Datacage l = getDatacage(); if (l != null) { l.createdArtifact(artifact, backend, context); } } @Override public void storedArtifact(Artifact artifact, Backend backend) { log.debug("storedArtifact"); Datacage l = getDatacage(); if (l != null) { l.storedArtifact(artifact, backend, context); } } @Override public void createdUser(User user, Backend backend) { log.debug("createdUser"); Datacage l = getDatacage(); if (l != null) { l.createdUser(user, backend, context); } } @Override public void deletedUser(String identifier, Backend backend) { log.debug("deletedUser"); Datacage l = getDatacage(); if (l != null) { l.deletedUser(identifier, backend, context); } } @Override public void createdCollection( ArtifactCollection collection, Backend backend ) { log.debug("createdCollection"); Datacage l = getDatacage(); if (l != null) { l.createdCollection(collection, backend, context); } } @Override public void deletedCollection(String identifier, Backend backend) { log.debug("deletedCollection"); Datacage l = getDatacage(); if (l != null) { l.deletedCollection(identifier, backend, context); } } @Override public void changedCollectionAttribute( String identifier, Document document, Backend backend ) { log.debug("changedCollectionAttribute"); Datacage l = getDatacage(); if (l != null) { l.changedCollectionAttribute( identifier, document, backend, context); } } @Override public void changedCollectionItemAttribute( String collectionId, String artifactId, Document document, Backend backend ) { log.debug("changedCollectionItemAttribute"); Datacage l = getDatacage(); if (l != null) { l.changedCollectionItemAttribute( collectionId, artifactId, document, backend, context); } } @Override public void addedArtifactToCollection( String artifactId, String collectionId, Backend backend ) { log.debug("addedArtifactToCollection"); Datacage l = getDatacage(); if (l != null) { l.addedArtifactToCollection( artifactId, collectionId, backend, context); } } @Override public void removedArtifactFromCollection( String artifactId, String collectionId, Backend backend ) { log.debug("removedArtifactFromCollection"); Datacage l = getDatacage(); if (l != null) { l.removedArtifactFromCollection( artifactId, collectionId, backend, context); } } @Override public void setCollectionName( String collectionId, String name ) { log.debug("setCollectionName"); Datacage l = getDatacage(); if (l != null) { l.setCollectionName(collectionId, name, context); } } @Override public void killedCollections(List<String> identifiers, Backend backend) { log.debug("killedCollections"); Datacage l = getDatacage(); if (l != null) { l.killedCollections(identifiers, context); } } @Override public void killedArtifacts(List<String> identifiers, Backend backend) { log.debug("killedArtifacts"); Datacage l = getDatacage(); if (l != null) { l.killedArtifacts(identifiers, context); } } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :