All Downloads are FREE. Search and download functionalities are using the official Maven repository.

at.newmedialab.ldclient.api.LDCacheProvider Maven / Gradle / Ivy

/*
 * Copyright (c) 2011 Salzburg Research.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package at.newmedialab.ldclient.api;

import at.newmedialab.ldclient.model.CacheEntry;
import at.newmedialab.ldclient.model.Endpoint;
import org.openrdf.repository.Repository;

import java.util.Collection;
import java.util.Map;

/**
 * An interface specifying a factory that provides different caching mechanisms, e.g. in-memory or file storage.
 * A cache provider typically offers two kinds of caching services, one for the retrieved triples (a sesame repository)
 * and one for the caching metadata (a map from URIs to CacheEntry).
 * 

* Author: Sebastian Schaffert */ public interface LDCacheProvider { /** * Return the sesame repository used for storing the triples that are retrieved from the Linked Data Cloud. * Triples will always be added to the context http://www.newmedialab.at/ldclient/cache to be able to distinguish * them from other triples. * * @return an initialised Sesame repository that can be used for caching triples */ public Repository getTripleRepository(); /** * Return a map that can be used to store caching metadata about resources. The LDCacheProvider should take care * of persisting the metadata if desired. * * @return a map for storing caching metadata */ public Map getMetadataRepository(); /** * Register a new Linked Data endpoint with this cache provider. * * @param endpoint */ public void registerEndpoint(Endpoint endpoint); /** * List all endpoints currently registered with the Linked Data cache provider. * @return a collection of endpoints */ public Collection listEndpoints(); /** * Unregister the Linked Data endpoint given as argument. * * @param endpoint the endpoint to unregister */ public void unregisterEndpoint(Endpoint endpoint); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy