gov.bnl.gums.db
Interface AccountPoolMapperDB

All Known Implementing Classes:
HibernateAccountMapperDB, LDAPAccountMapperDB

public interface AccountPoolMapperDB

Provides the set of accounts for the AccountPoolMapper class which assignes accounts from a pool.

The implementation shouldn't buffer the information, as it the AccountPoolMapper responsability to do so.

Author:
Gabriele Carcassi, Jay Packard

Method Summary
 void addAccount(java.lang.String account)
          Adds an account to the pool of free accounts.
 java.lang.String assignAccount(java.lang.String userDN)
          Assigns a new account from the pool to the user.
 boolean needsCacheRefresh()
           
 boolean removeAccount(java.lang.String account)
          Removes account from the pool of free accounts.
 java.lang.String retrieveAccount(java.lang.String userDN)
          Retrieves the account associated to the Grid identity.
 java.util.Map retrieveAccountMap()
          Retrieves a user to account map.
 java.util.Map retrieveReverseAccountMap()
          Retrieves an account to user DN map, including null DNs, where empty strings are returned if the account is unassigned.
 java.util.List retrieveUsersNotUsedSince(java.util.Date date)
          Retrieve the list of accounts not in use since the given date.
 void setNeedsCacheRefresh(boolean value)
          Set when cache has been refreshed
 void unassignAccount(java.lang.String account)
          Unassigns whatever user is assigned to this account from the account mapping and renders that account available to the pool.
 void unassignUser(java.lang.String user)
          Removes user from the mapping, and renders it available to the pool.
 

Method Detail

addAccount

void addAccount(java.lang.String account)
Adds an account to the pool of free accounts. If the account already exists, will throw an exception

Parameters:
account - the account to be added

assignAccount

java.lang.String assignAccount(java.lang.String userDN)
Assigns a new account from the pool to the user. If the user is already mapped, will throw an exception.

Parameters:
userDN - the user to be mapped
Returns:
the account or null if no more accounts are available

needsCacheRefresh

boolean needsCacheRefresh()
Returns:
whether changes require a cache refresh

removeAccount

boolean removeAccount(java.lang.String account)
Removes account from the pool of free accounts.

Parameters:
account - the account to be removed
Returns:
if account was removed

retrieveAccount

java.lang.String retrieveAccount(java.lang.String userDN)
Retrieves the account associated to the Grid identity.

Parameters:
userDN - the certificate DN
Returns:
the account or null if the user wasn't mapped

retrieveAccountMap

java.util.Map retrieveAccountMap()
Retrieves a user to account map.

Returns:
a Map between the userDN (String) as the key and the account (String).

retrieveReverseAccountMap

java.util.Map retrieveReverseAccountMap()
Retrieves an account to user DN map, including null DNs, where empty strings are returned if the account is unassigned.

Returns:
a Map between the userDN (String) as the key and the account (String).

retrieveUsersNotUsedSince

java.util.List retrieveUsersNotUsedSince(java.util.Date date)
Retrieve the list of accounts not in use since the given date.

Parameters:
date - the time since the accounts haven't been used.
Returns:
a list of String with the accounts

setNeedsCacheRefresh

void setNeedsCacheRefresh(boolean value)
Set when cache has been refreshed

Parameters:
value -

unassignAccount

void unassignAccount(java.lang.String account)
Unassigns whatever user is assigned to this account from the account mapping and renders that account available to the pool.

Parameters:
account - that should be unassigned

unassignUser

void unassignUser(java.lang.String user)
Removes user from the mapping, and renders it available to the pool.

Parameters:
user - the user that shouldn't be mapped anymore


Copyright © 2004-2008. All Rights Reserved.