001: /***************************************************************
002: * This file is part of the [fleXive](R) project.
003: *
004: * Copyright (c) 1999-2008
005: * UCS - unique computing solutions gmbh (http://www.ucs.at)
006: * All rights reserved
007: *
008: * The [fleXive](R) project is free software; you can redistribute
009: * it and/or modify it under the terms of the GNU General Public
010: * License as published by the Free Software Foundation;
011: * either version 2 of the License, or (at your option) any
012: * later version.
013: *
014: * The GNU General Public License can be found at
015: * http://www.gnu.org/copyleft/gpl.html.
016: * A copy is found in the textfile GPL.txt and important notices to the
017: * license from the author are found in LICENSE.txt distributed with
018: * these libraries.
019: *
020: * This library is distributed in the hope that it will be useful,
021: * but WITHOUT ANY WARRANTY; without even the implied warranty of
022: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
023: * GNU General Public License for more details.
024: *
025: * For further information about UCS - unique computing solutions gmbh,
026: * please see the company website: http://www.ucs.at
027: *
028: * For further information about [fleXive](R), please see the
029: * project website: http://www.flexive.org
030: *
031: *
032: * This copyright notice MUST APPEAR in all copies of the file!
033: ***************************************************************/package com.flexive.shared.cache;
034:
035: import org.jboss.cache.Cache;
036:
037: import java.util.Set;
038:
039: /**
040: * Backing Cache for storing environment and contents
041: *
042: * @author Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
043: */
044: public interface FxBackingCache {
045:
046: /**
047: * Cache key for the system up time
048: */
049: public static final String SYSTEM_UP_KEY = "SYSTEM_UP";
050:
051: /**
052: * Reads a entry from the division cache that the current request is in.
053: *
054: * @param path path
055: * @param key key
056: * @return entry
057: * @throws FxCacheException on errors
058: */
059: Object get(String path, Object key) throws FxCacheException;
060:
061: /**
062: * Checks if the given key exists under the given path.
063: *
064: * @param path path
065: * @param key key
066: * @return entry
067: * @throws FxCacheException on errors
068: */
069: boolean exists(String path, Object key) throws FxCacheException;
070:
071: /**
072: * Puts a entry into the cache of the division the current request is in.
073: *
074: * @param path path
075: * @param key key
076: * @param value value
077: * @throws FxCacheException on errors
078: */
079: void put(String path, Object key, Object value)
080: throws FxCacheException;
081:
082: /**
083: * Removes from the cache of the division the current request is in.
084: *
085: * @param path path
086: * @throws FxCacheException on errors
087: */
088: void remove(String path) throws FxCacheException;
089:
090: /**
091: * Removes a entry from the cache of the division the current request is in.
092: *
093: * @param path path
094: * @param key key
095: * @throws FxCacheException on errors
096: */
097: void remove(String path, Object key) throws FxCacheException;
098:
099: /**
100: * Get all keys for a path
101: *
102: * @param path path
103: * @return set of keys
104: * @throws FxCacheException on errors
105: */
106: Set getKeys(String path) throws FxCacheException;
107:
108: /**
109: * Get all child nodes for a path
110: *
111: * @param path path
112: * @return set of child names
113: * @throws FxCacheException on errors
114: */
115: Set getChildrenNames(String path) throws FxCacheException;
116:
117: /**
118: * Get the wrapped cache
119: *
120: * @return TreeCache
121: * @throws FxCacheException on errors
122: */
123: Cache<Object, Object> getCache() throws FxCacheException;
124: }
|