view geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutor.java @ 1127:ebeb56428409

Added license headers and license file. geo-backend/trunk@1261 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:52:22 +0000
parents 02cd2935b5fa
children
line wrap: on
line source
/*
 * Copyright (c) 2010 by Intevation GmbH
 *
 * This program is free software under the LGPL (>=v2.1)
 * Read the file LGPL.txt coming with the software for details
 * or visit http://www.gnu.org/licenses/ if it does not exist.
 */

package de.intevation.gnv.geobackend.base.query;

import java.util.Collection;

import de.intevation.gnv.geobackend.base.Result;
import de.intevation.gnv.geobackend.base.query.exception.QueryException;

/**
 * This Interface provides the Method to execute Queries
 * against a Datastore eg. Databases
 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
 *
 */
public interface QueryExecutor {


    /**
     * This Method executes the Query an returns the Result
     * in an Collection.
     * @param queryID the ID of the Query which should be used.
     * @param filter the Filterarguments to limit the Data
     * @return the fetched Values
     * @throws QueryException
     */
    Collection<Result> executeQuery(String queryID,
                                    String[] filter)
                                    throws QueryException;

    /**
     * Returns the cached results to a given Query.
     * @param query the Query that should identify the Result
     * @return the Cached results or null if no results are cached.
     */
    Collection<Result> cachedResults(String query);

    /**
     * Writes the Result into the Cache
     * @param query the Query that will be used as Identifier.
     * @param results The Results that should be cached.
     */
    void cacheResults(String query, Collection<Result> results);

    /**
     * Clears the Cache using the Names of the Database-Tables
     * @param tableNames the Tablenames that should be used to Clear the Cache.
     */
    void clearCache(String[] tableNames);
}

http://dive4elements.wald.intevation.org