org.objectweb.speedo.usercache.api
Interface UserCacheManager

All Known Subinterfaces:
SpeedoHome
All Known Implementing Classes:
SpeedoHomeImpl

public interface UserCacheManager

Defines a Manager of a set of user caches. It permits to initalizes user caches. Each user cache is identifier by an int value. The particular '-1' value represents no user cache.

Author:
S.Chassande-Barrioz

Method Summary
 boolean activeUserCache(java.lang.String cacheName)
          Initializes the user cache
 java.util.Collection getActiveUserCache()
          Retrieves the list of user cache which has been initialized.
 java.lang.String[] getIndexededFieldsFromUserCache(int cacheId)
          Retrieves the name of the fields used as index in an user cache.
 UserCache getUserCache(int cacheId)
          Retrives a user cache
 int getUserCacheId(java.util.Collection fieldNames)
          Retrieves the name of the user cache which index is exactly composed by some field names.
 int[] getUserCacheIds()
          Retrieves the array of the user cache identifiers
 java.lang.String getUserCacheName(int cacheId)
          Retrives the name of an user cache from its int identifier.
 void userCacheEntryUnbound(java.lang.Object oid)
          An entry of user cache has been unbound from the real cache.
 

Method Detail

activeUserCache

public boolean activeUserCache(java.lang.String cacheName)
Initializes the user cache

Parameters:
cacheName - is the name of the user cache to initialize
Returns:
indicates if the cache has been initialized correctly

getUserCacheName

public java.lang.String getUserCacheName(int cacheId)
Retrives the name of an user cache from its int identifier.

Parameters:
cacheId - the identifier of an user cache
Returns:
the name of the user cache, or a null value if the identifier does not match an existing user cache.

getUserCache

public UserCache getUserCache(int cacheId)
Retrives a user cache

Returns:
the user cache instance if found, null otherwise

getUserCacheIds

public int[] getUserCacheIds()
Retrieves the array of the user cache identifiers


getIndexededFieldsFromUserCache

public java.lang.String[] getIndexededFieldsFromUserCache(int cacheId)
Retrieves the name of the fields used as index in an user cache. Be careful to respect the order of the array.

Returns:
an array of String containg the name of the fields used as index. (Never null !!!!)

getUserCacheId

public int getUserCacheId(java.util.Collection fieldNames)
Retrieves the name of the user cache which index is exactly composed by some field names.

Parameters:
fieldNames - is the collection of field names (String). The order of the collection is not important here.
Returns:
an user cache name if it has been found, null otherwise.

getActiveUserCache

public java.util.Collection getActiveUserCache()
Retrieves the list of user cache which has been initialized.

Returns:
a collection of UserCache instance

userCacheEntryUnbound

public void userCacheEntryUnbound(java.lang.Object oid)
An entry of user cache has been unbound from the real cache. A typical implementation, undinds from active user caches, the entry. To do this the a persistent object which has been previously unexported.

Parameters:
oid - is the identifier of the persistent object to unbind