|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.bnl.gums.db.HibernateAccountMapperDB
public class HibernateAccountMapperDB
Constructor Summary | |
---|---|
HibernateAccountMapperDB(HibernatePersistenceFactory persistenceFactory,
String map)
Creates a new instance of HibernateMapping |
Method Summary | |
---|---|
void |
addAccount(String account)
Adds an account to the pool of free accounts. |
String |
assignAccount(GridUser user)
Assigns a new account from the pool to the user. |
void |
createMapping(String userDN,
String account)
Saves in the DB the new mapping between the userDN and the account. |
String |
getMap()
|
boolean |
needsCacheRefresh()
This is a function meant to be used by a wrapper class that is caching some result from the database. |
boolean |
removeAccount(String account)
Removes account from the pool of free accounts. |
boolean |
removeMapping(String userDN)
Removes the mapping for the given user. |
String |
retrieveAccount(GridUser user)
Retrieves the account associated to the Grid identity. |
Map |
retrieveAccountMap()
Retrieves user to account map. |
String |
retrieveMapping(String userDN)
Retrieves a user mapping from the database. |
Map |
retrieveReverseAccountMap()
Retrieves account to user map. |
List |
retrieveUsersNotUsedSince(Date date)
Retrieve the list of accounts not in use since the given date. |
void |
setCacheRefreshed()
Call when a wrapper class using the DB object has updated its cache. |
void |
unassignAccount(String account)
Unassigns whatever user is assigned to this account from the account mapping and renders that account available to the pool. |
void |
unassignUser(String userDN)
Removes user from the mapping, and renders it available to the pool. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HibernateAccountMapperDB(HibernatePersistenceFactory persistenceFactory, String map)
Method Detail |
---|
public void addAccount(String account)
AccountPoolMapperDB
addAccount
in interface AccountPoolMapperDB
account
- the account to be addedpublic String assignAccount(GridUser user)
AccountPoolMapperDB
assignAccount
in interface AccountPoolMapperDB
public void createMapping(String userDN, String account)
ManualAccountMapperDB
createMapping
in interface ManualAccountMapperDB
userDN
- a certificate DNaccount
- a UNIX account namepublic String getMap()
getMap
in interface AccountPoolMapperDB
public boolean needsCacheRefresh()
AccountPoolMapperDB
needsCacheRefresh
in interface AccountPoolMapperDB
public boolean removeAccount(String account)
AccountPoolMapperDB
removeAccount
in interface AccountPoolMapperDB
account
- the account to be removed
public boolean removeMapping(String userDN)
ManualAccountMapperDB
removeMapping
in interface ManualAccountMapperDB
userDN
- a certificate DN
public String retrieveAccount(GridUser user)
AccountPoolMapperDB
retrieveAccount
in interface AccountPoolMapperDB
public Map retrieveAccountMap()
ManualAccountMapperDB
retrieveAccountMap
in interface AccountPoolMapperDB
retrieveAccountMap
in interface ManualAccountMapperDB
public String retrieveMapping(String userDN)
ManualAccountMapperDB
retrieveMapping
in interface ManualAccountMapperDB
userDN
- a certificate DN
public Map retrieveReverseAccountMap()
ManualAccountMapperDB
retrieveReverseAccountMap
in interface AccountPoolMapperDB
retrieveReverseAccountMap
in interface ManualAccountMapperDB
public List retrieveUsersNotUsedSince(Date date)
AccountPoolMapperDB
retrieveUsersNotUsedSince
in interface AccountPoolMapperDB
date
- the time since the accounts haven't been used.
public void setCacheRefreshed()
AccountPoolMapperDB
setCacheRefreshed
in interface AccountPoolMapperDB
public void unassignAccount(String account)
AccountPoolMapperDB
unassignAccount
in interface AccountPoolMapperDB
account
- that should be unassignedpublic void unassignUser(String userDN)
AccountPoolMapperDB
unassignUser
in interface AccountPoolMapperDB
userDN
- the user that shouldn't be mapped anymore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |