@@ -0,0 +1,2702 @@
+/*%0A * Copyright %5B2006%5D %5BUniversity Corporation for Advanced Internet Development, Inc.%5D%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.opensaml.xml.util;%0A%0Aimport org.joda.time.DateTime;%0A%0A/**%0A * Generic data storage facility for use by services that require%0A * some degree of persistence. Implementations will vary in how much%0A * persistence they can supply.%0A * %0A * Storage is divided into %22contexts%22 identified by a string label.%0A * Keys need to be unique only within a given context, so multiple%0A * components can share a single storage service safely as long as they%0A * use different labels.%0A */%0Apublic interface StorageService%3CKeyType, ValueType%3E %7B%0A%0A    /**%0A     * Checks to see if a value exists for a given key.%0A     * %0A     * @param context the storage context%0A     * @param key the key%0A     * %0A     * @return true if there is at least one cache value corresponding to the key, false if not%0A     */%0A    public boolean exists(String context, KeyType key);%0A    %0A    /**%0A     * Gets the value stored under a particular key.%0A     * %0A     * @param context the storage context%0A     * @param key the key%0A     * %0A     * @return the value for that key, or null if there is no value for the given key%0A     */%0A    public ValueType get(String context, KeyType key);%0A    %0A    /**%0A     * Adds a value, indexed by a key, in to storage.  Note that implementations of this %0A     * service may determine, on its own, when to evict items from storage, the expiration %0A     * time given here is meant only as a system provided hint.%0A     * %0A     * @param context the storage context%0A     * @param key the key%0A     * @param value the value%0A     * @param expiration instance when the given value has expired, or null%0A     * %0A     * @return the value that was registered under that key previously, if there was a previous value%0A     */%0A    public ValueType put(String context, KeyType key, ValueType value, DateTime expiration);%0A    %0A    /**%0A     * Removes an item from storage.%0A     * %0A     * @param context the storage context%0A     * @param key the key to the valye to remove%0A     * %0A     * @return the value that was removed%0A     */%0A    public ValueType remove(String context, KeyType key);%0A%7D

Add storage service interface