public interface LdapService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_FILE |
static java.lang.String |
DN |
static java.util.List<java.lang.String> |
GUID_CANDIDATES |
static java.lang.String |
MEMBERS |
static java.lang.String |
PARENT |
static java.util.List<java.lang.String> |
PROPERTY_BASE |
static java.util.List<java.lang.String> |
PROPERTY_CREDENTIALS |
static java.util.List<java.lang.String> |
PROPERTY_ENCRYPTION_PROTOCOL |
static java.util.List<java.lang.String> |
PROPERTY_EXTERNAL_DIR |
static java.util.List<java.lang.String> |
PROPERTY_FILTER |
static java.util.List<java.lang.Object> |
PROPERTY_FLATTEN_TREE |
static java.util.List<java.lang.String> |
PROPERTY_GROUP_MEMBER |
static java.util.List<java.lang.String> |
PROPERTY_GROUP_NAME |
static java.util.List<java.lang.String> |
PROPERTY_GROUP_OBJECT_CLASS |
static java.util.List<java.lang.String> |
PROPERTY_GUID |
static java.util.List<java.lang.String> |
PROPERTY_HOST |
static java.util.List<java.lang.Object> |
PROPERTY_LOG_RESULTING_TREE |
static java.util.List<java.lang.String> |
PROPERTY_OBJECT_CLASS |
static java.util.List<java.lang.String> |
PROPERTY_OU_NAME |
static java.util.List<java.lang.String> |
PROPERTY_OU_OBJECT_CLASS |
static java.util.List<java.lang.Object> |
PROPERTY_PORT |
static java.util.List<java.lang.String> |
PROPERTY_PRINCIPAL |
static java.util.List<java.lang.String> |
PROPERTY_USER_FIRSTNAME |
static java.util.List<java.lang.String> |
PROPERTY_USER_LASTNAME |
static java.util.List<java.lang.String> |
PROPERTY_USER_MAIL |
static java.util.List<java.lang.String> |
PROPERTY_USER_OBJECT_CLASS |
static java.util.List<java.lang.String> |
PROPERTY_USER_USERNAME |
static java.util.List<java.lang.Object> |
PROPERTY_WRITE_PROTECTION |
static java.lang.String |
VENDOR_NAME |
static java.lang.String |
VENDOR_VERSION |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
attribute(java.lang.String attribute)
Queries the attribute definition of the given attribute.
|
BindResult |
authenticate(User user,
java.lang.String password)
Authenticates the given user with the given password against the LDAP origin.
|
java.lang.String |
filter(int indentation,
boolean simplify)
Parses the installed filter and displays it in a multi-line form that makes
it easier to understand its hierarchy and embedded components.
|
java.lang.String |
getAllNames(AttributeTypeDefinition attribute)
Returns a string containing all names of the given attribute joined with a
comma.
|
java.lang.String |
getAllNames(MatchingRuleDefinition matchingRule)
Returns a string containing all names of the given matching rule joined with
a comma.
|
java.lang.String |
getAllNames(ObjectClassDefinition objectClass)
Returns a string containing all names of the given object class joined with a
comma.
|
AttributeTypeDefinition |
getAttributeDefinition(java.lang.String attribute,
Schema schema)
Queries the attribute definition of the given attribute.
|
java.util.List<AttributeTypeDefinition> |
getAttributeTypes()
Queries the schema for the existing attributes.
|
java.util.List<AttributeTypeDefinition> |
getAttributeTypes(Schema schema)
Queries the schema for the existing attributes.
|
java.lang.String |
getEntry()
Returns a string representation of the schema entry
|
MatchingRuleDefinition |
getMatchingRuleDefinition(java.lang.String matchingRule,
Schema schema)
Queries the matching rule definition of the given matching rule.
|
java.util.List<MatchingRuleDefinition> |
getMatchingRules()
Queries the schema for the existing matching rules.
|
java.util.List<MatchingRuleDefinition> |
getMatchingRules(Schema schema)
Queries the schema for the existing matching rules.
|
ObjectClassDefinition |
getObjectClassDefinition(java.lang.String objectClassName,
Schema schema)
Queries the object class definition of the given object class.
|
java.util.List<ObjectClassDefinition> |
getObjectClasses()
Queries the schema for the existing object classes.
|
java.util.List<ObjectClassDefinition> |
getObjectClasses(Schema schema)
Queries the schema for the existing object classes.
|
Schema |
getSchema()
Reads the LDAP schema
|
java.util.List<AttributeTypeDefinition> |
getSubAttributes(AttributeTypeDefinition attributeDef,
Schema schema)
Fetches the direct attributes of the given attribute definition.
|
java.util.List<ObjectClassDefinition> |
getSubClasses(ObjectClassDefinition objectClassDef,
Schema schema)
Fetches the direct subclasses of the given objectClass definition.
|
AttributeSyntaxDefinition |
getSyntaxRuleDefinition(java.lang.String oid,
Schema schema)
Queries the syntax rule definition of the given syntax rule OID.
|
java.util.List<AttributeSyntaxDefinition> |
getSyntaxRules()
Queries the schema for the existing syntax rules.
|
java.util.List<AttributeSyntaxDefinition> |
getSyntaxRules(Schema schema)
Queries the schema for the existing syntax rules.
|
java.util.List<ObjectClassDefinition> |
getUsedAsOptional(AttributeTypeDefinition attributeDef,
Schema schema)
Gets all object class definitions using the given attribute type definition
as an optional attribute.
|
java.util.List<ObjectClassDefinition> |
getUsedAsRequired(AttributeTypeDefinition attributeDef,
Schema schema)
Gets all object class definitions using the given attribute type definition
as an optional attribute.
|
java.util.List<AttributeTypeDefinition> |
getUsedBy(AttributeSyntaxDefinition syntaxRule,
Schema schema)
Gets all attributes that are used by the given syntax rule.
|
java.util.List<AttributeTypeDefinition> |
getUsedBy(MatchingRuleDefinition matchingRule,
Schema schema)
Gets all attributes that are used by the given matching rule.
|
java.lang.String |
guessGuid()
Tries to guess the appropriate GUID for the current LDAP server.
|
void |
importUsers()
Imports LDAP users as configured in sso/ldap.cf
|
java.util.Map<java.lang.String,java.lang.String> |
info()
Returns a list of useful information about the LDAP server.
|
boolean |
isEnabled()
Returns true if LDAP is enabled, else otherwise
|
java.util.Map<java.lang.String,java.lang.Object> |
matchingRule(java.lang.String matchingRule)
Queries the matching rule definition of the given matching rule.
|
java.lang.String |
normalizeFilter(java.lang.String filter)
Removes all new lines and blank spaces from the given filter.
|
java.util.Map<java.lang.String,java.lang.Object> |
objectClass(java.lang.String objectClass)
Queries the schema definition of the given object class.
|
java.lang.String |
readCurrentFilter()
Reads the installed filter from the configuration file.
|
java.lang.String |
readCurrentGuid()
Gets the currently installed GUID.
|
java.util.Map<java.lang.String,java.lang.Object> |
schemaGroups()
Queries the schema of the installed groups' object class.
|
java.util.Map<java.lang.String,java.lang.Object> |
schemaOrganizationalUnits()
Queries the schema of the installed organizational units' object class.
|
java.util.Map<java.lang.String,java.lang.Object> |
schemaUsers()
Queries the LDAP schema of the installed users' object class.
|
java.util.Map<java.lang.String,java.lang.Object> |
syntaxRule(java.lang.String oid)
Queries the syntax rule definition of the given OID.
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
testFilter(java.util.List<java.lang.String> additionalAttributes)
Returns a map with the nodes found using the LDAP filter installed including
all additional attributes requested.
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
testGroups(java.util.List<java.lang.String> additionalAttributes)
Returns a list with the LDAP groups found.
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
testGuid(java.util.List<java.lang.String> additionalAttributes)
Returns a list with the nodes found with the LDAP filter installed including
the GUID attributes of the nodes.
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
testOrganizationalUnits(java.util.List<java.lang.String> additionalAttributes)
Returns a list with the LDAP organizational units found.
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
testOrphans(java.util.List<java.lang.String> additionalAttributes)
Returns a map containing all LDAP orphans.
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
testUsers(java.util.List<java.lang.String> additionalAttributes)
Returns a list with the LDAP users found.
|
static final java.lang.String CONFIG_FILE
static final java.util.List<java.lang.String> PROPERTY_HOST
static final java.util.List<java.lang.Object> PROPERTY_PORT
static final java.util.List<java.lang.String> PROPERTY_ENCRYPTION_PROTOCOL
static final java.util.List<java.lang.String> PROPERTY_PRINCIPAL
static final java.util.List<java.lang.String> PROPERTY_CREDENTIALS
static final java.util.List<java.lang.String> PROPERTY_BASE
static final java.util.List<java.lang.String> PROPERTY_FILTER
static final java.util.List<java.lang.String> PROPERTY_EXTERNAL_DIR
static final java.util.List<java.lang.Object> PROPERTY_WRITE_PROTECTION
static final java.util.List<java.lang.Object> PROPERTY_LOG_RESULTING_TREE
static final java.util.List<java.lang.Object> PROPERTY_FLATTEN_TREE
static final java.util.List<java.lang.String> PROPERTY_OBJECT_CLASS
static final java.util.List<java.lang.String> PROPERTY_GUID
static final java.util.List<java.lang.String> PROPERTY_OU_OBJECT_CLASS
static final java.util.List<java.lang.String> PROPERTY_OU_NAME
static final java.util.List<java.lang.String> PROPERTY_GROUP_OBJECT_CLASS
static final java.util.List<java.lang.String> PROPERTY_GROUP_NAME
static final java.util.List<java.lang.String> PROPERTY_GROUP_MEMBER
static final java.util.List<java.lang.String> PROPERTY_USER_OBJECT_CLASS
static final java.util.List<java.lang.String> PROPERTY_USER_FIRSTNAME
static final java.util.List<java.lang.String> PROPERTY_USER_LASTNAME
static final java.util.List<java.lang.String> PROPERTY_USER_USERNAME
static final java.util.List<java.lang.String> PROPERTY_USER_MAIL
static final java.lang.String DN
static final java.lang.String PARENT
static final java.lang.String MEMBERS
static final java.lang.String VENDOR_NAME
static final java.lang.String VENDOR_VERSION
static final java.util.List<java.lang.String> GUID_CANDIDATES
void importUsers() throws LdapException
LdapException
- if the LDAP users cannot be importedBindResult authenticate(User user, java.lang.String password) throws LdapException
user
- the userpassword
- the clear-text passwordLdapException
- if something goes wrong during authenticationjava.util.List<java.util.Map<java.lang.String,java.lang.String>> testFilter(java.util.List<java.lang.String> additionalAttributes) throws LdapException
additionalAttributes
- the additional attributes to request from the
LDAP serverLdapException
- if an error happens during node retrievaljava.util.List<java.util.Map<java.lang.String,java.lang.String>> testOrphans(java.util.List<java.lang.String> additionalAttributes) throws LdapException
additionalAttributes
- the additional attributes to request from the
LDAP serverLdapException
- if an error happens during node retrievaljava.util.List<java.util.Map<java.lang.String,java.lang.String>> testGuid(java.util.List<java.lang.String> additionalAttributes) throws LdapException
additionalAttributes
- the additional attributes to request from the
LDAP serverLdapException
- if an error happens during node retrievaljava.util.List<java.util.Map<java.lang.String,java.lang.String>> testUsers(java.util.List<java.lang.String> additionalAttributes) throws LdapException
additionalAttributes
- the additional attributes to request from the
LDAP serverLdapException
- if an error happens during node retrievaljava.util.Map<java.lang.String,java.lang.Object> schemaUsers() throws LdapException
LdapException
- if an error happens during schema retrievaljava.lang.String filter(int indentation, boolean simplify) throws LdapException
indentation
- Number of spaces for indentation.simplify
- indicates if to simplify the filter in certain ways (for
example, by removing unnecessary levels of hierarchy, like
an AND embedded in another AND).LdapException
- if an error happens during parsingjava.util.List<ObjectClassDefinition> getObjectClasses() throws LdapException
LdapException
- if an error happens during retrievaljava.util.List<ObjectClassDefinition> getObjectClasses(Schema schema) throws LdapException
schema
- the schemaLdapException
- if an error happens during retrievaljava.util.List<AttributeTypeDefinition> getAttributeTypes() throws LdapException
LdapException
- if an error happens during retrievaljava.util.List<AttributeTypeDefinition> getAttributeTypes(Schema schema) throws LdapException
schema
- the schemaLdapException
- if an error happens during retrievaljava.util.List<MatchingRuleDefinition> getMatchingRules() throws LdapException
LdapException
- if an error happens during retrievaljava.util.List<MatchingRuleDefinition> getMatchingRules(Schema schema) throws LdapException
schema
- the schemaLdapException
- if an error happens during retrievaljava.util.List<AttributeSyntaxDefinition> getSyntaxRules() throws LdapException
LdapException
- if an error happens during retrievaljava.util.List<AttributeSyntaxDefinition> getSyntaxRules(Schema schema) throws LdapException
schema
- the schemaLdapException
- if an error happens during retrievaljava.util.Map<java.lang.String,java.lang.Object> schemaGroups() throws LdapException
LdapException
- if an error happens during schema retrievaljava.util.Map<java.lang.String,java.lang.Object> schemaOrganizationalUnits() throws LdapException
LdapException
- if an error happens during schema retrievaljava.util.Map<java.lang.String,java.lang.Object> objectClass(java.lang.String objectClass) throws LdapException
objectClass
- the object classLdapException
- if an error happens during schema retrievaljava.util.Map<java.lang.String,java.lang.Object> attribute(java.lang.String attribute) throws LdapException
attribute
- the attributeLdapException
- if an error happens during schema retrievaljava.util.Map<java.lang.String,java.lang.Object> matchingRule(java.lang.String matchingRule) throws LdapException
matchingRule
- the matching ruleLdapException
- if an error happens during schema retrievaljava.util.Map<java.lang.String,java.lang.Object> syntaxRule(java.lang.String oid) throws LdapException
oid
- the OID of the syntax rule to queryLdapException
- if an error happens during schema retrievalSchema getSchema() throws LdapException
LdapException
- if an error happens during schema retrievalObjectClassDefinition getObjectClassDefinition(java.lang.String objectClassName, Schema schema) throws LdapException
objectClassName
- the object classschema
- the schema definitionLdapException
- if an error happens during retrievalAttributeTypeDefinition getAttributeDefinition(java.lang.String attribute, Schema schema) throws LdapException
attribute
- the attributeschema
- the schema definitionLdapException
- if an error happens during retrievalMatchingRuleDefinition getMatchingRuleDefinition(java.lang.String matchingRule, Schema schema) throws LdapException
matchingRule
- the matching ruleschema
- the schema definitionLdapException
- if an error happens during retrievalAttributeSyntaxDefinition getSyntaxRuleDefinition(java.lang.String oid, Schema schema) throws LdapException
oid
- the OID of the syntax rule to queryschema
- the schema definitionLdapException
- if an error happens during retrievaljava.util.List<java.util.Map<java.lang.String,java.lang.String>> testGroups(java.util.List<java.lang.String> additionalAttributes) throws LdapException
additionalAttributes
- the additional attributes to request from the
LDAP serverLdapException
- if an error happens during node retrievaljava.util.List<java.util.Map<java.lang.String,java.lang.String>> testOrganizationalUnits(java.util.List<java.lang.String> additionalAttributes) throws LdapException
additionalAttributes
- the additional attributes to request from the
LDAP serverLdapException
- if an error happens during node retrievaljava.util.Map<java.lang.String,java.lang.String> info() throws LdapException
LdapException
- if an error happens during information retrievaljava.lang.String readCurrentFilter() throws LdapException
LdapException
- if an error happens during the retrieval.java.lang.String normalizeFilter(java.lang.String filter) throws LdapException
LdapException
- if an error happens during the normalization.java.lang.String guessGuid() throws LdapException
LdapException
- if an error happens during the guessjava.lang.String readCurrentGuid() throws LdapException
LdapException
- if something goes wrong during readingjava.util.List<ObjectClassDefinition> getSubClasses(ObjectClassDefinition objectClassDef, Schema schema) throws LdapException
objectClassDef
- the parent object class definitionschema
- the schemaLdapException
- if something goes wrong during readingjava.util.List<AttributeTypeDefinition> getSubAttributes(AttributeTypeDefinition attributeDef, Schema schema) throws LdapException
attributeDef
- the parent attribute definitionschema
- the schemaLdapException
- if something goes wrong during readingjava.util.List<ObjectClassDefinition> getUsedAsOptional(AttributeTypeDefinition attributeDef, Schema schema) throws LdapException
attributeDef
- the attribute definitionschema
- the schemaLdapException
- if something goes wrong during retrievaljava.util.List<ObjectClassDefinition> getUsedAsRequired(AttributeTypeDefinition attributeDef, Schema schema) throws LdapException
attributeDef
- the attribute definitionschema
- the schemaLdapException
- if something goes wrong during retrievaljava.util.List<AttributeTypeDefinition> getUsedBy(MatchingRuleDefinition matchingRule, Schema schema) throws LdapException
matchingRule
- the matching ruleschema
- the schemaLdapException
- if something goes wrong during retrievaljava.util.List<AttributeTypeDefinition> getUsedBy(AttributeSyntaxDefinition syntaxRule, Schema schema) throws LdapException
syntaxRule
- the syntax ruleschema
- the schemaLdapException
- if something goes wrong during retrievaljava.lang.String getAllNames(ObjectClassDefinition objectClass) throws LdapException
objectClass
- the object classLdapException
- if something goes wrongjava.lang.String getAllNames(AttributeTypeDefinition attribute) throws LdapException
attribute
- the attributeLdapException
- if something goes wrongjava.lang.String getAllNames(MatchingRuleDefinition matchingRule) throws LdapException
matchingRule
- the matching ruleLdapException
- if something goes wrongjava.lang.String getEntry() throws LdapException
LdapException
- if something goes wrongboolean isEnabled()