Package com.sun.identity.policy.plugins
Class LDAPUsers
- java.lang.Object
-
- com.sun.identity.policy.plugins.LDAPUsers
-
-
Constructor Summary
Constructors Constructor Description LDAPUsers()
Constructor with no parameter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Creates and returns a copy of this object.boolean
equals(Object o)
Indicates whether some other object is "equal to" this one.String
getDisplayNameForValue(String value, Locale locale)
Returns the display name for the value for the given locale.ValidValues
getValidEntries(SSOToken token, String pattern, String[] attributeNames)
Returns a set of possible values that satisfy thepattern
.ValidValues
getValidValues(SSOToken token)
Returns a list of possible values for theLDAPUsers
.ValidValues
getValidValues(SSOToken token, String pattern)
Returns a list of possible values for theLDAPUsers
that satisfy the givenpattern
.Set
getValues()
Returns the values that was set using the methodsetValues
.Syntax
getValueSyntax(SSOToken token)
Returns the syntax of the values theLDAPUsers
int
hashCode()
Return a hash code for thisLDAPUsers
.void
initialize(Map configParams)
Initialize the LDAPGroup object by using the configuration information passed by the Policy Framework.boolean
isMember(SSOToken token)
Determines if the user belongs to this instance of theLDAPUsers
object.protected org.forgerock.opendj.ldif.ConnectionEntryReader
search(String searchFilter, org.forgerock.opendj.ldap.Connection ld, String... attributeNames)
void
setValues(Set names)
Sets the names for the instance of theLDAPUsers
object.
-
-
-
Method Detail
-
initialize
public void initialize(Map configParams) throws PolicyException
Initialize the LDAPGroup object by using the configuration information passed by the Policy Framework.- Specified by:
initialize
in interfaceSubject
- Parameters:
configParams
- the configuration information- Throws:
PolicyException
- if an error occured during initialization of the instance
-
getValueSyntax
public Syntax getValueSyntax(SSOToken token) throws SSOException
Returns the syntax of the values theLDAPUsers
- Specified by:
getValueSyntax
in interfaceSubject
- Parameters:
token
- theSSOToken
that will be used to determine the syntax- Returns:
- set of of valid names for the user collection.
- Throws:
SSOException
- ifSSOToken
is not valid- See Also:
Syntax
-
getValidValues
public ValidValues getValidValues(SSOToken token) throws SSOException, PolicyException
Returns a list of possible values for theLDAPUsers
.- Specified by:
getValidValues
in interfaceSubject
- Parameters:
token
- theSSOToken
that will be used to determine the possible values- Returns:
ValidValues
object- Throws:
SSOException
- ifSSOToken
is not validPolicyException
- if unable to get the list of valid names.
-
getValidValues
public ValidValues getValidValues(SSOToken token, String pattern) throws SSOException, PolicyException
Returns a list of possible values for theLDAPUsers
that satisfy the givenpattern
.- Specified by:
getValidValues
in interfaceSubject
- Parameters:
token
- theSSOToken
that will be used to determine the possible valuespattern
- search pattern that will be used to narrow the list of valid names.- Returns:
ValidValues
object- Throws:
SSOException
- ifSSOToken
is not validPolicyException
- if unable to get the list of valid names.
-
getValidEntries
public ValidValues getValidEntries(SSOToken token, String pattern, String[] attributeNames) throws SSOException, PolicyException
Returns a set of possible values that satisfy thepattern
. The returnedValidValues
object contains a set of map of user DN to a map of user's attribute name to a string array of attribute values.- Parameters:
token
- Single Sign On token for fetching the possible values.pattern
- Search pattern of which possible values are matched to.attributeNames
- Array of attribute names to be to returned.- Returns:
- a set of possible values that satify the
pattern
. - Throws:
SSOException
- ifSSOToken
is invalid.PolicyException
- if there are problems getting these values.
-
search
protected org.forgerock.opendj.ldif.ConnectionEntryReader search(String searchFilter, org.forgerock.opendj.ldap.Connection ld, String... attributeNames)
-
getDisplayNameForValue
public String getDisplayNameForValue(String value, Locale locale) throws NameNotFoundException
Returns the display name for the value for the given locale. For all the valid values obtained through the methodsgetValidValues
this method must be called by GUI and CLI to get the corresponding display name. Thelocale
variable could be used by the plugin to customize the display name for the given locale. Thelocale
variable could benull
, in which case the plugin must use the default locale (most probabily en_US). Alternatively, if the plugin does not have to localize the value, it can just return thevalue
as is.- Specified by:
getDisplayNameForValue
in interfaceSubject
- Parameters:
value
- one of the valid value for the pluginlocale
- locale for which the display name must be customized- Returns:
- the display name for the value for the given locale.
- Throws:
NameNotFoundException
- if the givenvalue
is not one of the valid values for the plugin
-
getValues
public Set getValues()
Returns the values that was set using the methodsetValues
.
-
setValues
public void setValues(Set names) throws InvalidNameException
Sets the names for the instance of theLDAPUsers
object. The names are obtained from the policy object, usually configured when a policy is created.- Specified by:
setValues
in interfaceSubject
- Parameters:
names
- names selected for the instance of the user collection object.- Throws:
InvalidNameException
- if the given names are not valid
-
isMember
public boolean isMember(SSOToken token) throws SSOException, PolicyException
Determines if the user belongs to this instance of theLDAPUsers
object.- Specified by:
isMember
in interfaceSubject
- Parameters:
token
- single-sign-on token of the user- Returns:
true
if the user is memeber of the given subject;false
otherwise.- Throws:
SSOException
- if SSO token is not validPolicyException
- if an error occured while checking if the user is a member of this subject
-
hashCode
public int hashCode()
Return a hash code for thisLDAPUsers
.
-
equals
public boolean equals(Object o)
Indicates whether some other object is "equal to" this one.
-
-