at.spardat.xma.boot.cache.IFileCacheResource Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* s IT Solutions AT Spardat GmbH - initial API and implementation
*******************************************************************************/
/*
* Created on : 04.2003
* Created by : s3595
*/
package at.spardat.xma.boot.cache;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
/**
* interface to storage module resources
*
* @author s3595 Chr. Sch?fer (CGS)
* @version $Id: IFileCacheResource.java 2084 2007-11-27 14:53:31Z s3460 $
*/
public interface IFileCacheResource {
/**
* Returns the remote location this entry caches.
*/
public abstract URL getLocation();
/** get an url to the local resource */
public abstract URL getLocalRes();
/**
* Returns a buffered output stream open for writing to the
* cache file.
*/
/* public abstract OutputStream getOutputStream( ) throws IOException ; */
/**
* Gets an input stream from this resource
* @return InputStream returns an input-stream for this resource, to read from.
*/
public abstract InputStream getInputStream() throws IOException;
/**
* Returns the time in the local system clock that the file was
* most recently checked for an update by this client machine.
*
* info:
* This is not a http-header information. It is only used bye the
* client to remember the date/time when this resource was checked for existing updates.
*
* @return long last update timestamp
*/
public abstract long getLastUpdated();
/**
* Sets the time in the local system clock that the file was
* most recently checked for an update.
*
* @param updatedTime update time to set
*/
// public abstract void setLastUpdated(long updatedTime);
/**
* Last-Modified is the http-header value used to check, if a resource
* is still up to date.
*
* @return long last modified date
*/
public abstract long getLastModified();
/**
* @param lastModified
* @return void
*/
// public abstract void setLastModified(long lastModified );
/**
* Returns the value of the specified key, or null if the key
* does not exist.
*
* @param key key to look for
*/
public abstract String getProperty(String key);
/**
* Returns the value of the specified key, or the default value
* if the key does not exist.
*/
public abstract String getProperty(String key, String defaultValue) ;
/**
* Sets the value for the specified key.
* @return the previous value
*/
public abstract Object setProperty(String key, String value) ;
/**
* Sets the expiration date of this resource.
* @param l expiration date/time
* @return void
*/
public abstract void setExpiration(long l);
/**
* Gets the expiration date of this resource.
* @return the expiration date in milliseconds since 1.1.1970
*/
public abstract long getExpiration();
/**
* Sets the named property to the given value.
* @param key name of the property
* @param value of the property
*/
public abstract void setProperty(String key, long value);
/**
* is this resource still up to date
* @return true if it is already expired
*/
public abstract boolean isExpired();
}