info.aduna.gee.publication.servlets.cache
Class AssociateInfoCache

java.lang.Object
  extended by info.aduna.gee.publication.servlets.cache.AssociateInfoCache

public class AssociateInfoCache
extends Object

Class AssociateInfoCache


Field Summary
protected static HashMap _associatesPerHost
          A mapping of hostnames to (Array)Lists of AssociateInfo objects.
 
Constructor Summary
AssociateInfoCache()
           
 
Method Summary
protected static ArrayList _fillCache(String host)
          Fills the cache for the indicated host with the info from the associatesdb.
static ArrayList ensureAssociatesLoaded(String host)
          Ensures that the list of associates for a certain host is loaded.
static List getAssociatesForUser(String host, String username)
          Gets a list of AssociateInfo objects whose 'user' is equal to the supplied name.
static List getUsersForAssociate(String host, String assocName)
          Gets a list of AssociateInfo objects whose 'associate' is equal to the supplied name.
static void put(String host, String username, String associate, int personal)
          Puts a (new) associate into the AssociateInfoCache and the underlying associatesdb.
static void refresh(String host)
          Refreshes (throws away) the cached info for a certain host.
static void removeAssociates(String host, String username)
          Removes all associates of the user with the supplied name from the AssociateInfoCache and the underlying associatesdb.
static void removeUser(String host, String username)
          Removes ALL associate-info for the user with the supplied name from the AssociateInfoCache and the underlying associatesdb.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_associatesPerHost

protected static HashMap _associatesPerHost
A mapping of hostnames to (Array)Lists of AssociateInfo objects.

Constructor Detail

AssociateInfoCache

public AssociateInfoCache()
Method Detail

refresh

public static void refresh(String host)
Refreshes (throws away) the cached info for a certain host.

Parameters:
host - the name of the server to refresh the cache for

ensureAssociatesLoaded

public static ArrayList ensureAssociatesLoaded(String host)
Ensures that the list of associates for a certain host is loaded.

Parameters:
host - the name of the server to ensure the loaded list for
Returns:
the list of associates (guaranteed non-null).

getAssociatesForUser

public static List getAssociatesForUser(String host,
                                        String username)
Gets a list of AssociateInfo objects whose 'user' is equal to the supplied name.

Parameters:
host - the Zpad server on which the user is registered
username - the name of the user
Returns:
a List of AssociateInfo object.

getUsersForAssociate

public static List getUsersForAssociate(String host,
                                        String assocName)
Gets a list of AssociateInfo objects whose 'associate' is equal to the supplied name.

Parameters:
host - the Zpad server on which the associate is registered
assocName - the associate name
Returns:
a List of AssociateInfo object.

put

public static void put(String host,
                       String username,
                       String associate,
                       int personal)
Puts a (new) associate into the AssociateInfoCache and the underlying associatesdb.


removeAssociates

public static void removeAssociates(String host,
                                    String username)
Removes all associates of the user with the supplied name from the AssociateInfoCache and the underlying associatesdb.


removeUser

public static void removeUser(String host,
                              String username)
Removes ALL associate-info for the user with the supplied name from the AssociateInfoCache and the underlying associatesdb. Both entries of the user itself as entries where the user is an associate are removed.


_fillCache

protected static ArrayList _fillCache(String host)
Fills the cache for the indicated host with the info from the associatesdb. If the associatesdb for that host does not exist, an empty ArrayList will be inserted.



Copyright © 1997-2008 Aduna. All Rights Reserved.