public final class JndiServices extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_FILTER
Default LDAP filter.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(JndiModifications jm)
Apply directory modifications.
|
String |
completeDn(String dn) |
Map<String,LscDatasets> |
doGetAttrsList(String base,
String filter,
int scope,
List<String> attrsNames) |
boolean |
exists(String dn)
Check if the entry with the specified distinguish name exists (or
not).
|
boolean |
exists(String dn,
String filter)
Check if the entry with the specified distinguish name exists (or
not).
|
Map<String,LscDatasets> |
getAttrsList(String base,
String filter,
int scope,
List<String> attrsNames)
Search for a list of attribute values
This method is a simple LDAP search operation which is attended to
return a list of the attribute values in all returned entries
|
static CallbackHandler |
getCallbackHandler(String user,
String pass) |
LdapContext |
getContext()
Get the JNDI context.
|
String |
getContextDn() |
List<String> |
getDnList(String base,
String filter,
int scope)
Search for a list of DN.
|
static JndiServices |
getDstInstance()
Deprecated.
|
SearchResult |
getEntry(String base,
String filter)
Search for an entry.
|
SearchResult |
getEntry(String base,
String filter,
SearchControls sc)
Search for an entry.
|
SearchResult |
getEntry(String base,
String filter,
SearchControls sc,
int scope)
Search for an entry.
|
static JndiServices |
getInstance(LdapConnectionType connection) |
static JndiServices |
getInstance(Properties props) |
static JndiServices |
getInstance(Properties props,
boolean forceNewConnection)
Instance getter.
|
static Properties |
getLdapProperties(LdapConnectionType connection) |
Map<String,List<String>> |
getSchema(String[] attrsToReturn)
Return the LDAP schema.
|
static JndiServices |
getSrcInstance()
Deprecated.
|
SearchResult |
readEntry(String base,
boolean allowError)
Search for an entry.
|
SearchResult |
readEntry(String base,
String filter,
boolean allowError) |
SearchResult |
readEntry(String base,
String filter,
boolean allowError,
SearchControls sc) |
String |
rewriteBase(String base) |
List<String> |
sup(String dn,
int level) |
public static final String DEFAULT_FILTER
@Deprecated public static JndiServices getSrcInstance()
@Deprecated public static JndiServices getDstInstance()
public static JndiServices getInstance(Properties props) throws NamingException, IOException
NamingExceptionIOExceptionpublic static JndiServices getInstance(Properties props, boolean forceNewConnection) throws NamingException, IOException
props - the connection propertiesIOExceptionNamingExceptionpublic static Properties getLdapProperties(LdapConnectionType connection) throws LscConfigurationException
LscConfigurationExceptionpublic static JndiServices getInstance(LdapConnectionType connection)
public SearchResult getEntry(String base, String filter) throws NamingException
base - the base of the search operationfilter - the filter of the search operationNamingException - thrown if something goes wrongpublic SearchResult getEntry(String base, String filter, SearchControls sc) throws NamingException
base - the base of the search operationfilter - the filter of the search operationsc - the search controlsNamingException - thrown if something goes wrongpublic SearchResult getEntry(String base, String filter, SearchControls sc, int scope) throws NamingException
base - the base of the search operationfilter - the filter of the search operationsc - the search controlsscope - the search scope to useSizeLimitExceededException - thrown if more than one entry is returned by the searchNamingException - thrown if something goes wrongpublic boolean exists(String dn, String filter)
dn - the entry's distinguish namefilter - look at the dn according this filterpublic boolean exists(String dn)
dn - the entry's distinguish namepublic SearchResult readEntry(String base, boolean allowError) throws NamingException
base - the base of the search operationallowError - log error if not found or notNamingException - thrown if something goes wrongpublic SearchResult readEntry(String base, String filter, boolean allowError) throws NamingException
NamingExceptionpublic SearchResult readEntry(String base, String filter, boolean allowError, SearchControls sc) throws NamingException
NamingExceptionpublic List<String> getDnList(String base, String filter, int scope) throws NamingException
base - the base of the search operationfilter - the filter of the search operationscope - the scope of the search operationNamingException - thrown if something goes wrongpublic boolean apply(JndiModifications jm) throws CommunicationException
jm - modifications to applyCommunicationException - If the connection to the directory is lostpublic Map<String,List<String>> getSchema(String[] attrsToReturn) throws NamingException
attrsToReturn - list of attribute names to return (or null for all
'standard' attributes)NamingException - thrown if something goes wrong (badpublic List<String> sup(String dn, int level) throws NamingException
NamingExceptionpublic Map<String,LscDatasets> getAttrsList(String base, String filter, int scope, List<String> attrsNames) throws NamingException
base - the base of the search operationfilter - the filter of the search operationscope - the scope of the search operationattrsNames - table of attribute names to getNamingException - thrown if something goes wrongpublic Map<String,LscDatasets> doGetAttrsList(String base, String filter, int scope, List<String> attrsNames) throws NamingException
NamingExceptionpublic String getContextDn()
public LdapContext getContext()
public static CallbackHandler getCallbackHandler(String user, String pass)
Copyright © 2005-2017 LSC project. All Rights Reserved.