|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.bnl.gums.persistence.PersistenceFactory gov.bnl.gums.persistence.LDAPPersistenceFactory
public class LDAPPersistenceFactory
Constructor Summary | |
---|---|
LDAPPersistenceFactory()
Create a new ldap persistence factory. |
|
LDAPPersistenceFactory(Configuration configuration)
Create a new ldap persistence factory with a configuration. |
|
LDAPPersistenceFactory(Configuration configuration,
java.lang.String name)
Create a new ldap persistence factory with a configuration and a name. |
Method Summary | |
---|---|
void |
addMapEntry(java.lang.String userDN,
java.lang.String account,
java.lang.String mapName,
java.lang.String mapDN)
Adds a userDN -> account mapping entry in the "map=mapName" LDAP map. |
void |
addToSecondaryGroup(java.lang.String account,
java.lang.String groupname)
Adds the account to the given secondary group. |
void |
addUserGroupEntry(java.lang.String userDN,
java.lang.String groupName,
java.lang.String groupDN)
Adds a certificate DN to the group "group=groupName". |
void |
changeGroupID(java.lang.String account,
java.lang.String groupname)
Changes the primary gid for the given account. |
PersistenceFactory |
clone(Configuration configuration)
Create a clone of itself |
void |
createAccountInMap(java.lang.String account,
java.lang.String mapName,
java.lang.String mapDN)
Creates an account in the map "map=mapName", without having a userDN: this is useful for pools of accounts. |
protected javax.naming.directory.DirContext |
createLDAPContext()
Create a new LDAP DirContext based on the configuration. |
void |
createMap(java.lang.String mapName,
java.lang.String mapDN)
Creates a new "map=mapName" entry in the LDAP GUMS tree. |
void |
createUserGroup(java.lang.String groupName,
java.lang.String groupDN)
Creates a new "group=groupName" entry in the LDAP GUMS tree. |
boolean |
destroyAccountInMap(java.lang.String account,
java.lang.String mapName,
java.lang.String mapDN)
Deletes the account in map. |
void |
destroyMap(java.lang.String mapName,
java.lang.String mapDN)
Deletes the "map=mapName" map in the LDAP GUMS tree. |
java.lang.String |
getAccountField()
|
java.lang.String |
getCaCertFile()
|
java.lang.String |
getGroupIdField()
|
java.lang.String |
getGumsOU()
|
javax.naming.directory.DirContext |
getLDAPContext()
Returns a Context ready to be used (taken from the pool). |
java.lang.String |
getMemberAccountField()
|
java.lang.String |
getTrustStorePassword()
|
java.lang.String |
getType()
|
static java.lang.String |
getTypeStatic()
|
boolean |
isSynchGroups()
This property forces the gid update for account pools at every access. |
void |
releaseContext(javax.naming.directory.DirContext context)
Returns the LDAP DirContext to the pool, so that it can be reused. |
boolean |
removeMapEntry(java.lang.String userDN,
java.lang.String mapName,
java.lang.String mapDN)
Removes a userDN -> acount mapping entry in the "map=mapName LDAP map. |
void |
removeUserGroupEntry(java.lang.String userDN,
java.lang.String groupName,
java.lang.String groupDN)
Removes a certificate DN to the group "group=groupName". |
AccountPoolMapperDB |
retrieveAccountPoolMapperDB(java.lang.String nameAndGroups)
|
javax.naming.directory.DirContext |
retrieveContext()
Retrieves an LDAP DirContext from the pool, if available and still valid, or creates a new DirContext if none are found. |
ManualAccountMapperDB |
retrieveManualAccountMapperDB(java.lang.String name)
|
ManualUserGroupDB |
retrieveManualUserGroupDB(java.lang.String name)
|
UserGroupDB |
retrieveUserGroupDB(java.lang.String name)
|
void |
setAccountField(java.lang.String accountField)
|
void |
setCaCertFile(java.lang.String caCertFile)
|
void |
setGroupIdField(java.lang.String groupIdField)
|
void |
setMemberAccountField(java.lang.String memberAccountField)
|
void |
setProperties(java.util.Properties properties)
Sets the list of properties to be used to connect to LDAP, that is to create the JNDI context. |
void |
setSynchGroups(boolean synchGroups)
This property forces the gid update for account pools at every access. |
void |
setTrustStorePassword(java.lang.String trustStorePassword)
|
java.lang.String |
toXML()
Get XML representation of this object for writing to gums.config |
Methods inherited from class gov.bnl.gums.persistence.PersistenceFactory |
---|
getConfiguration, getDescription, getName, getProperties, setConfiguration, setDescription, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LDAPPersistenceFactory()
public LDAPPersistenceFactory(Configuration configuration)
configuration
- public LDAPPersistenceFactory(Configuration configuration, java.lang.String name)
configuration
- name
- Method Detail |
---|
public static java.lang.String getTypeStatic()
public void addMapEntry(java.lang.String userDN, java.lang.String account, java.lang.String mapName, java.lang.String mapDN)
userDN
- the certificate DN of the user (i.e. "/DC=org/DC=doegrids/OU=People/CN=John Smith")account
- the account to whith to map the DN (i.e. "carcassi")mapName
- the name of the map (i.e. "usatlasSpecialMap")mapDN
- the map DN (i.e. "map=usatlasSpecialMap, ou=GUMS")public void addToSecondaryGroup(java.lang.String account, java.lang.String groupname)
account
- the account to add to the secondary group (i.e. "carcassi")groupname
- the secondary group name (i.e. "usatlas")public void addUserGroupEntry(java.lang.String userDN, java.lang.String groupName, java.lang.String groupDN)
userDN
- the certificate DN of the user (i.e. "/DC=org/DC=doegrids/OU=People/CN=John Smith")groupName
- the name of the group (i.e. "usatlas")groupDN
- the group DN (i.e. "group=usatlas, ou=GUMS")public void changeGroupID(java.lang.String account, java.lang.String groupname)
account
- the account to change the primary group (i.e. "carcassi")groupname
- the primary group name (i.e. "usatlas")public PersistenceFactory clone(Configuration configuration)
PersistenceFactory
clone
in class PersistenceFactory
public void createAccountInMap(java.lang.String account, java.lang.String mapName, java.lang.String mapDN)
account
- the account to whith to map the DN (i.e. "grid0001")mapName
- the name of the map (i.e. "usatlasSpecialMap")mapDN
- the map DN (i.e. "map=usatlasSpecialMap, ou=GUMS")public void createMap(java.lang.String mapName, java.lang.String mapDN)
mapName
- the name of the map (i.e. "usatlasSpecialMap")mapDN
- the map DN (i.e. "map=usatlasSpecialMap, ou=GUMS")public void createUserGroup(java.lang.String groupName, java.lang.String groupDN)
groupName
- the name of the group (i.e. "usatlas")groupDN
- the group DN (i.e. "group=usatlas, ou=GUMS")public boolean destroyAccountInMap(java.lang.String account, java.lang.String mapName, java.lang.String mapDN)
mapName
- the name of the map (i.e. "usatlasSpecialMap")mapDN
- the map DN (i.e. "map=usatlasSpecialMap, ou=GUMS")public void destroyMap(java.lang.String mapName, java.lang.String mapDN)
mapName
- the name of the map (i.e. "usatlasSpecialMap")mapDN
- the map DN (i.e. "map=usatlasSpecialMap, ou=GUMS")public java.lang.String getAccountField()
public java.lang.String getCaCertFile()
public java.lang.String getGumsOU()
public java.lang.String getGroupIdField()
public javax.naming.directory.DirContext getLDAPContext()
public java.lang.String getMemberAccountField()
public java.lang.String getTrustStorePassword()
public java.lang.String getType()
getType
in class PersistenceFactory
public boolean isSynchGroups()
public void releaseContext(javax.naming.directory.DirContext context)
context
- the LDAP context to be returnedpublic boolean removeMapEntry(java.lang.String userDN, java.lang.String mapName, java.lang.String mapDN)
userDN
- the certificate DN of the user (i.e. "/DC=org/DC=doegrids/OU=People/CN=Gabriele Carcassi 12345")mapName
- the name of the map (i.e. "usatlasSpecialMap")mapDN
- the map DN (i.e. "map=usatlasSpecialMap")
public void removeUserGroupEntry(java.lang.String userDN, java.lang.String groupName, java.lang.String groupDN)
userDN
- the certificate DN of the user (i.e. "/DC=org/DC=doegrids/OU=People/CN=Gabriele Carcassi 12345")groupName
- the name of the group (i.e. "usatlas")groupDN
- the group DN (i.e. "group=usatlas")public AccountPoolMapperDB retrieveAccountPoolMapperDB(java.lang.String nameAndGroups)
retrieveAccountPoolMapperDB
in class PersistenceFactory
public javax.naming.directory.DirContext retrieveContext()
public ManualAccountMapperDB retrieveManualAccountMapperDB(java.lang.String name)
retrieveManualAccountMapperDB
in class PersistenceFactory
public ManualUserGroupDB retrieveManualUserGroupDB(java.lang.String name)
retrieveManualUserGroupDB
in class PersistenceFactory
public UserGroupDB retrieveUserGroupDB(java.lang.String name)
retrieveUserGroupDB
in class PersistenceFactory
public void setAccountField(java.lang.String accountField)
public void setCaCertFile(java.lang.String caCertFile)
public void setGroupIdField(java.lang.String groupIdField)
public void setMemberAccountField(java.lang.String memberAccountField)
public void setProperties(java.util.Properties properties)
setProperties
in class PersistenceFactory
properties
- a set of JNDI propertiespublic void setSynchGroups(boolean synchGroups)
synchGroups
- if true gids are updated every time accounts from the pool are returned.public void setTrustStorePassword(java.lang.String trustStorePassword)
public java.lang.String toXML()
PersistenceFactory
toXML
in class PersistenceFactory
protected javax.naming.directory.DirContext createLDAPContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |