m.c.m.proxyma.plugins.caches
Interface CacheProvider

All Known Implementing Classes:
EhcacheCacheProvider, NullCacheProvider

public interface CacheProvider

This is the interface to implement to provide a CacheProvider to the proxy engine.
The default implementation of it is made using ECHACHE an Open Source Cache Manager but you can add any other cache engine if you want to.
IMPORTANT: The cache plugn is used 2 times into the proxy-engine:

NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.

Version:
$Id: CacheProvider.java 177 2010-07-03 09:08:10Z marcolinuz $
Author:
Marco Casavecchia Morganti (marcolinuz) [marcolinuz-at-gmail.com]

Method Summary
 java.util.Collection<java.lang.String> getCachedURIs()
          Method provided to get a collection on URIs (keys for the cache matching) that are stored into the cache subsystem.
 java.lang.String getHtmlDescription()
          Returns a short description (html formatted) of the cache.
 java.lang.String getName()
          Returns the name of the cache provider (only a name that characterize the plugin, not the class name..) that could be used into the interfaces as cache name.
 boolean getResponseData(ProxymaResource aResource)
          Method provided to search into the cache a responseData suitable for the passed resource.
 java.lang.String getStatistics()
          Some cache subsystems keeps track of the opeations and maintains an internal statistic chat can be queried.
 void storeResponseDataIfCacheable(ProxymaResource aResource)
          Method provided to check if the resource is cacheable and store it into the cache subsystem.
 

Method Detail

storeResponseDataIfCacheable

void storeResponseDataIfCacheable(ProxymaResource aResource)
Method provided to check if the resource is cacheable and store it into the cache subsystem.

Parameters:
aResource - the resource countaining the response to store.

getResponseData

boolean getResponseData(ProxymaResource aResource)
Method provided to search into the cache a responseData suitable for the passed resource.

Parameters:
aResource - the resource to complete with a response. If a fittin gresponse is found it will be attached to the resource.
Returns:
false if no fitting response were found into the cache.

getCachedURIs

java.util.Collection<java.lang.String> getCachedURIs()
Method provided to get a collection on URIs (keys for the cache matching) that are stored into the cache subsystem.

Returns:
a collection of URIs

getStatistics

java.lang.String getStatistics()
Some cache subsystems keeps track of the opeations and maintains an internal statistic chat can be queried. This method is provided to let you use this feature if available.

Returns:
some statistics data about the cache status and usage.

getName

java.lang.String getName()
Returns the name of the cache provider (only a name that characterize the plugin, not the class name..) that could be used into the interfaces as cache name.

Returns:
the cache name.

getHtmlDescription

java.lang.String getHtmlDescription()
Returns a short description (html formatted) of the cache.
It will be used into the interfaces to give some information about the cache.

Returns:
a short description of the cache.


Copyright © 2010. All Rights Reserved.