Package org.springframework.ldap.core

Examples of org.springframework.ldap.core.ContextExecutor


     * @throws IncorrectResultSizeDataAccessException if no results are found or the search returns more than one
     *         result.
     */
    public DirContextOperations searchForSingleEntry(final String base, final String filter, final Object[] params) {

        return (DirContextOperations) executeReadOnly(new ContextExecutor() {
                public Object executeWithContext(DirContext ctx) throws NamingException {
                    DistinguishedName ctxBaseDn = new DistinguishedName(ctx.getNameInNamespace());
                    NamingEnumeration<SearchResult> resultsEnum = ctx.search(base, filter, params, searchControls);
                    Set<DirContextOperations> results = new HashSet<DirContextOperations>();
                    try {
View Full Code Here


            AuthenticationErrorCallback errorCallback) {

        try {
            DirContext ctx = getContextSource().getContext(username,
                    password);
            ContextExecutor ce = new ContextExecutor() {
                public Object executeWithContext(DirContext ctx)
                        throws javax.naming.NamingException {
                    callback.executeWithContext(ctx, null);
                    return null;
                }
            };
            try {
                ce.executeWithContext(ctx);
            } catch (javax.naming.NamingException e) {
                throw LdapUtils.convertLdapException(e);
            } catch (Exception e) {
               throw e;
            } finally {
View Full Code Here

TOP

Related Classes of org.springframework.ldap.core.ContextExecutor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.