org.springframework.ldap.core.DirContextProcessor Java Examples

The following examples show how to use org.springframework.ldap.core.DirContextProcessor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringLdap.java    From Android_Code_Arbiter with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void queryVulnerableToInjection(LdapTemplate template, String jndiInjectMe, SearchControls searchControls, DirContextProcessor dirContextProcessor) throws NamingException {
    template.list(jndiInjectMe);
    template.list(jndiInjectMe, new DefaultNameClassPairMapper());
    template.list(jndiInjectMe, new CountNameClassPairCallbackHandler());

    template.lookup(jndiInjectMe);
    template.lookup(jndiInjectMe, new DefaultIncrementalAttributesMapper());
    template.lookup(jndiInjectMe, new LdapEntryIdentificationContextMapper());

    template.search(jndiInjectMe,"dn=1",searchControls,new CountNameClassPairCallbackHandler());
    template.search(jndiInjectMe,"dn=1",searchControls,new DefaultIncrementalAttributesMapper(), dirContextProcessor);
    template.search(jndiInjectMe,"dn=1",searchControls,new LdapEntryIdentificationContextMapper(),dirContextProcessor);
    template.search(jndiInjectMe,"dn=1",searchControls,new CountNameClassPairCallbackHandler(),dirContextProcessor);
    template.search(jndiInjectMe,"dn=1",SearchControls.OBJECT_SCOPE,true,new CountNameClassPairCallbackHandler());
    template.search(jndiInjectMe,"dn=1",new CountNameClassPairCallbackHandler());
    template.search(jndiInjectMe,"dn=1",SearchControls.OBJECT_SCOPE,new String[0],new DefaultIncrementalAttributesMapper());
    template.search(jndiInjectMe,"dn=1",SearchControls.OBJECT_SCOPE,new DefaultIncrementalAttributesMapper());
    template.search(jndiInjectMe,"dn=1",new DefaultIncrementalAttributesMapper());
    template.search(jndiInjectMe,"dn=1",SearchControls.OBJECT_SCOPE,new String[0],new LdapEntryIdentificationContextMapper());
    template.search(jndiInjectMe,"dn=1",SearchControls.OBJECT_SCOPE,new LdapEntryIdentificationContextMapper());
    template.search(jndiInjectMe,"dn=1",new LdapEntryIdentificationContextMapper());
    template.search(jndiInjectMe,"dn=1",searchControls,new LdapEntryIdentificationContextMapper());
    template.search(jndiInjectMe,"dn=1",searchControls, new DefaultIncrementalAttributesMapper());
}
 
Example #2
Source File: SimpleLdapTemplate.java    From spring-ldap with Apache License 2.0 5 votes vote down vote up
/**
    * {@inheritDoc}
    */
   @Override
@SuppressWarnings("unchecked")
public <T> List<T> search(String base, String filter, SearchControls controls,
		ParameterizedContextMapper<T> mapper, DirContextProcessor processor) {
	return ldapOperations.search(base, filter, controls, mapper, processor);
}
 
Example #3
Source File: SimpleLdapTemplate.java    From spring-ldap with Apache License 2.0 5 votes vote down vote up
/**
    * {@inheritDoc}
    */
   @Override
@SuppressWarnings("unchecked")
public <T> List<T> search(Name base, String filter, SearchControls controls, ParameterizedContextMapper<T> mapper,
		DirContextProcessor processor) {
	return ldapOperations.search(base, filter, controls, mapper, processor);
}
 
Example #4
Source File: AggregateDirContextProcessorTest.java    From spring-ldap with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
    // Create processor1 mock
    processor1Mock = mock(DirContextProcessor.class);

    // Create processor2 mock
    processor2Mock = mock(DirContextProcessor.class);

    tested = new AggregateDirContextProcessor();
    tested.addDirContextProcessor(processor1Mock);
    tested.addDirContextProcessor(processor2Mock);

}
 
Example #5
Source File: LdapUserGroupProvider.java    From nifi-registry with Apache License 2.0 4 votes vote down vote up
private boolean hasMorePages(final DirContextProcessor processor ) {
    return processor instanceof PagedResultsDirContextProcessor && ((PagedResultsDirContextProcessor) processor).hasMore();
}
 
Example #6
Source File: LdapUserGroupProvider.java    From nifi with Apache License 2.0 4 votes vote down vote up
private boolean hasMorePages(final DirContextProcessor processor ) {
    return processor instanceof PagedResultsDirContextProcessor && ((PagedResultsDirContextProcessor) processor).hasMore();
}
 
Example #7
Source File: AggregateDirContextProcessor.java    From spring-ldap with Apache License 2.0 4 votes vote down vote up
public void preProcess(DirContext ctx) throws NamingException {
    for (DirContextProcessor processor : dirContextProcessors) {
        processor.preProcess(ctx);
    }
}
 
Example #8
Source File: AggregateDirContextProcessor.java    From spring-ldap with Apache License 2.0 4 votes vote down vote up
public void postProcess(DirContext ctx) throws NamingException {
    for (DirContextProcessor processor : dirContextProcessors) {
        processor.postProcess(ctx);
    }
}
 
Example #9
Source File: SimpleLdapOperations.java    From spring-ldap with Apache License 2.0 2 votes vote down vote up
/**
 * Search for a List of type T using the supplied filter, SearchControls,
 * DirContextProcessor and ParameterizedContextMapper.
 * 
 * @param base Base DN relative to the base of the ContextSource - where to
 * start the search.
 * @param filter Search filter.
 * @param controls the SearchControls. Make sure that the returningObjFlag
 * is set to <code>true</code>.
 * @param mapper the Mapper to supply all results to.
 * @param processor the DirContextProcessor to be used for applying pre/post
 * processing on the DirContext instance.
 * @return a List of type T containing objects for all entries found, as
 * mapped by the ParameterizedContextMapper.
 * @throws NamingException if any error occurs.
 */
<T> List<T> search(String base, String filter, SearchControls controls,
		ParameterizedContextMapper<T> mapper, DirContextProcessor processor);
 
Example #10
Source File: SimpleLdapOperations.java    From spring-ldap with Apache License 2.0 2 votes vote down vote up
/**
 * Search for a List of type T using the supplied filter, SearchControls,
 * DirContextProcessor and ParameterizedContextMapper.
 * 
 * @param base Base DN relative to the base of the ContextSource - where to
 * start the search.
 * @param filter Search filter.
 * @param controls the SearchControls. Make sure that the returningObjFlag
 * is set to <code>true</code>.
 * @param mapper the Mapper to supply all results to.
 * @param processor the DirContextProcessor to be used for applying pre/post
 * processing on the DirContext instance.
 * @return a List of type T containing objects for all entries found, as
 * mapped by the ParameterizedContextMapper.
 * @throws NamingException if any error occurs.
 * @since 1.3
 */
<T> List<T> search(Name base, String filter, SearchControls controls,
		ParameterizedContextMapper<T> mapper, DirContextProcessor processor);
 
Example #11
Source File: AggregateDirContextProcessor.java    From spring-ldap with Apache License 2.0 2 votes vote down vote up
/**
 * Add the supplied DirContextProcessor to the list of managed objects.
 * 
 * @param processor
 *            the DirContextpProcessor to add.
 */
public void addDirContextProcessor(DirContextProcessor processor) {
    dirContextProcessors.add(processor);
}
 
Example #12
Source File: AggregateDirContextProcessor.java    From spring-ldap with Apache License 2.0 2 votes vote down vote up
/**
 * Get the list of managed {@link DirContextProcessor} instances.
 * 
 * @return the managed list of {@link DirContextProcessor} instances.
 */
public List<DirContextProcessor> getDirContextProcessors() {
    return dirContextProcessors;
}
 
Example #13
Source File: AggregateDirContextProcessor.java    From spring-ldap with Apache License 2.0 2 votes vote down vote up
/**
 * Set the list of managed {@link DirContextProcessor} instances.
 * 
 * @param dirContextProcessors
 *            the list of {@link DirContextProcessor} instances to set.
 */
public void setDirContextProcessors(List<DirContextProcessor> dirContextProcessors) {
    this.dirContextProcessors = new ArrayList<DirContextProcessor>(dirContextProcessors);
}