class DefaultDirContextValidator implements DirContextValidator {

    public boolean validateDirContext(DirContextType contextType, DirContext dirContext) {
        Assert.notNull(contextType, "contextType may not be null");
        Assert.notNull(dirContext, "dirContext may not be null");
        
        try {
            final NamingEnumeration<SearchResult> searchResults = dirContext.search(this.base, this.filter, this.searchControls);

            if (searchResults.hasMore()) {
                this.logger.debug("DirContext '{}' passed validation.", dirContext);

                return true;
            }
        }
        catch (Exception e) {
            this.logger.debug("DirContext '{}' failed validation with an exception.", dirContext, e);
            return false;
        }

        this.logger.debug("DirContext '{}' failed validation.", dirContext);
        return false;
    }

    public  DefaultDirContextValidator();
    public  DefaultDirContextValidator(int searchScope);

}