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

net.sf.javaprinciples.resource.ResourceCache Maven / Gradle / Ivy

There is a newer version: 3.0.3
Show newest version
package net.sf.javaprinciples.resource;

/**
 * @author wslade
 */
@SuppressWarnings("unchecked")
public interface ResourceCache
{
    /**
     * @param identifier A non null URN
     * @return true when the resource matching the identifier is present
     */
    public boolean containsResource(ResourceIdentifier identifier);

    /**
     * @param identifier A non null URN
     * @return A matching resource when present. Null otherwise
     */
    public Resource getResource(ResourceIdentifier identifier);

    /**
     * @param identifier A non null URN
     * @param resource A non null resource to save for later
     */
    public void putResource(ResourceIdentifier identifier, Resource resource);

    /**
     * Clear the entire resource cache.
     */
    public void clear();

    /**
     * Clear a specific resource from the cache based on supplied identifier.
     * @param identifier The Identifier of the resource to remove from the cache.
     */
    public void clear(ResourceIdentifier identifier);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy