edu.vt.middleware.ldap.dsml
Class DsmlSearch

java.lang.Object
  extended by edu.vt.middleware.ldap.LdapSearch
      extended by edu.vt.middleware.ldap.dsml.DsmlSearch

public class DsmlSearch
extends LdapSearch

DsmlSearch queries an LDAP and returns the result as DSML. Each instance of DsmlSearch maintains it's own pool of LDAP connections.

Version:
$Revision: 1330 $ $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
Author:
Middleware Services

Nested Class Summary
static class DsmlSearch.Version
          Valid DSML versions.
 
Field Summary
 
Fields inherited from class edu.vt.middleware.ldap.LdapSearch
beanFactory, logger, pool
 
Constructor Summary
DsmlSearch(LdapPool<Ldap> pool)
          This creates a new DsmlSearch with the supplied pool.
 
Method Summary
 DsmlSearch.Version getVersion()
          This gets the version of dsml to produce.
 void search(String query, String[] attrs, Writer writer)
          This will perform an LDAP search with the supplied query and return attributes.
 void setVersion(DsmlSearch.Version v)
          This sets the version of dsml to produce.
 
Methods inherited from class edu.vt.middleware.ldap.LdapSearch
close, finalize, getLdapBeanFactory, search, setLdapBeanFactory
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DsmlSearch

public DsmlSearch(LdapPool<Ldap> pool)
This creates a new DsmlSearch with the supplied pool.

Parameters:
pool - LdapPool
Method Detail

getVersion

public DsmlSearch.Version getVersion()
This gets the version of dsml to produce.

Returns:
Version of DSML to produce

setVersion

public void setVersion(DsmlSearch.Version v)
This sets the version of dsml to produce.

Parameters:
v - Version of DSML to produce

search

public void search(String query,
                   String[] attrs,
                   Writer writer)
            throws NamingException,
                   IOException
This will perform an LDAP search with the supplied query and return attributes. The results will be written to the supplied Writer. Use version to control which version of DSML is written.

Overrides:
search in class LdapSearch
Parameters:
query - String to search for
attrs - String[] to return
writer - Writer to write to
Throws:
NamingException - if an error occurs while searching
IOException - if an error occurs while writing search results


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.