ingo@100: /* ingo@100: * Copyright (c) 2010 by Intevation GmbH ingo@100: * ingo@100: * This program is free software under the LGPL (>=v2.1) ingo@100: * Read the file LGPL.txt coming with the software for details ingo@100: * or visit http://www.gnu.org/licenses/ if it does not exist. ingo@100: */ ingo@100: sascha@69: package de.intevation.artifactdatabase; sascha@69: sascha@69: import de.intevation.artifacts.CallMeta; sascha@69: import de.intevation.artifacts.Service; sascha@299: import de.intevation.artifacts.GlobalContext; sascha@69: import de.intevation.artifacts.ServiceFactory; sascha@69: sascha@69: import org.apache.log4j.Logger; sascha@69: sascha@69: import org.w3c.dom.Document; sascha@69: sascha@89: /** sascha@89: * Trivial implementation of an artifact database service. Useful to sascha@89: * be subclassed. sascha@90: * sascha@89: * @author Sascha L. Teichmann sascha@89: */ sascha@69: public class DefaultService sascha@69: implements Service sascha@69: { sascha@69: private static Logger logger = Logger.getLogger(DefaultService.class); sascha@69: sascha@380: public static class Output implements Service.Output { sascha@380: sascha@380: protected Object data; sascha@380: protected String mimeType; sascha@380: sascha@380: public Output() { sascha@380: } sascha@380: sascha@380: public Output(Object data, String mimeType) { sascha@380: this.data = data; sascha@380: this.mimeType = mimeType; sascha@380: } sascha@380: sascha@380: @Override sascha@380: public Object getData() { sascha@380: return data; sascha@380: } sascha@380: sascha@380: @Override sascha@380: public String getMIMEType() { sascha@380: return mimeType; sascha@380: } sascha@380: } // class Output sascha@380: sascha@299: @Override sascha@380: public Service.Output process( sascha@299: Document data, sascha@299: GlobalContext globalContext, sascha@299: CallMeta callMeta sascha@89: ) { sascha@299: logger.debug("Service.process"); sascha@380: return new Output(new byte[0], "application/octet-stream"); sascha@69: } sascha@69: sascha@299: @Override sascha@299: public void setup(ServiceFactory factory, GlobalContext globalContext) { sascha@299: logger.debug("Service.setup"); sascha@69: } sascha@69: } sascha@69: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :