|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.beasys.commerce.bridge.ldap.LdapHelper
Single place to make LDAP calls.
Fields inherited from interface com.beasys.commerce.bridge.ldap.LDAPBridgeConstants |
LDAP_CONFIG,
LDAP_ENABLED_ATTRIBUTE,
LDAP_GROUP_ATTRIBUTE,
LDAP_USER_ATTRIBUTE |
Constructor Summary | |
LdapHelper()
|
Method Summary | |
boolean |
authenticate(java.lang.String username,
java.lang.String password)
Authenticates a username and password against an LDAP directory. |
java.util.Iterator |
findUsernamesThatStartWith(java.lang.String start)
Returns an iterator containing the names of all the users that start with a certain set of characters. |
java.lang.String |
formatDN(java.lang.String dnInfo)
Given whatever is in the WebLogic LDAP Realm's properties file, formats a value correctly for use as a DN by reversing the order. |
java.util.Iterator |
getAllGroupNames()
Returns all of the groups that this configuration is set up to use. |
java.util.ArrayList |
getAllGroupNamesAsArrayList()
Returns all of the groups that this configuration is set up to use. |
java.lang.String |
getGroupDN(java.lang.String groupName)
Given a unique group name returns the group's DN (distinguished name). |
java.util.Iterator |
getGroupNamesForUser(java.lang.String username)
Returns the names of the groups of which a user is a member. |
java.util.Map |
getGroupProperties(java.lang.String groupName)
Returns properties for a group from LDAP. |
java.lang.Object |
getService(java.lang.String aLookupName)
|
java.lang.String |
getUserDN(java.lang.String username)
Given a unique username returns the user's DN (distinguished name). |
java.util.Iterator |
getUsernames(java.lang.String searchExpression,
int limit)
Returns the usernames in LDAP that match the search expression. |
java.util.Iterator |
getUsernamesForGroup(java.lang.String groupName)
Returns the usernames for the users in a group. |
java.util.Iterator |
getUsernamesForGroup(java.lang.String groupName,
java.lang.String searchExpression,
int limit)
Returns a group's list of members in the form of users' names |
java.util.Map |
getUserProperties(java.lang.String username)
Returns properties for a user from LDAP. |
boolean |
groupExists(java.lang.String groupName)
Returns true if a group by this name exists. |
java.util.Iterator |
realGetUsernamesForGroup(java.lang.String groupName,
java.lang.String searchExpression,
int limit)
|
boolean |
userExists(java.lang.String username)
Determines if a user exists in an LDAP directory. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public LdapHelper()
Method Detail |
public boolean userExists(java.lang.String username) throws java.lang.Exception
username
- the unique username of a person in the directorypublic boolean authenticate(java.lang.String username, java.lang.String password) throws java.lang.Exception
username
- the username of the userpassword
- the user's passwordpublic java.util.Map getUserProperties(java.lang.String username) throws java.lang.Exception
username
- the user's usernamepublic java.util.Map getGroupProperties(java.lang.String groupName) throws java.lang.Exception
groupName
- the group's unique display namepublic java.util.Iterator getAllGroupNames() throws java.lang.Exception
public java.util.ArrayList getAllGroupNamesAsArrayList() throws java.lang.Exception
public boolean groupExists(java.lang.String groupName) throws java.lang.Exception
groupName
- the name of the grouppublic java.lang.String getUserDN(java.lang.String username) throws java.lang.Exception
username
- the user's unique usernamepublic java.lang.String getGroupDN(java.lang.String groupName) throws java.lang.Exception
groupName
- the group's unique group namepublic java.util.Iterator getUsernamesForGroup(java.lang.String groupName) throws java.lang.Exception
groupName
- the name of the grouppublic java.util.Iterator getUsernames(java.lang.String searchExpression, int limit) throws java.lang.Exception
searchExpression
- a search expression such as "J* Smith" where
wildcards ("*") are the only supported special
characterlimit
- a limit of results to return (0 returns the
maximum)public java.util.Iterator getUsernamesForGroup(java.lang.String groupName, java.lang.String searchExpression, int limit) throws java.lang.Exception
groupName
- the name of the groupsearchExpression
- a search expression such as "J* Smith" where
wildcards ("*") are the only supported special
characterlimit
- a limit of results to return (0 returns the
maximum)public java.util.Iterator realGetUsernamesForGroup(java.lang.String groupName, java.lang.String searchExpression, int limit) throws java.lang.Exception
public java.util.Iterator getGroupNamesForUser(java.lang.String username) throws java.lang.Exception
username
- the name of the userpublic java.util.Iterator findUsernamesThatStartWith(java.lang.String start) throws java.lang.Exception
public java.lang.String formatDN(java.lang.String dnInfo) throws java.lang.Exception
o=Acme,ou=North America,ou=People
Then this method would format the DN to be
ou=People,ou=North America,o=Acme
This formatted DN is in the order in which LDAP servers want to see it. Note: you do not need to format a DN that is already in the correct order, if you do it's order will be reversed and it will no longer work.
dnInfo
- an LDAP DN in reverse order (as it would be in
ldaprealm.properties)public java.lang.Object getService(java.lang.String aLookupName)
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |