org.ldaptive.io
Class Dsmlv1Reader

java.lang.Object
  extended by org.ldaptive.io.Dsmlv1Reader
All Implemented Interfaces:
SearchResultReader

public class Dsmlv1Reader
extends Object
implements SearchResultReader

Reads DSML version 1 from a Reader and returns a SearchResult.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Constructor Summary
Dsmlv1Reader(Reader reader)
          Creates a new dsml reader.
Dsmlv1Reader(Reader reader, SortBehavior sb)
          Creates a new dsml reader.
 
Method Summary
protected  LdapAttribute createLdapAttribute(String name, NodeList nodes)
          Returns an ldap attribute derived from the supplied node list.
protected  LdapEntry createLdapEntry(Element entryElement)
          Converts the supplied DSML entry element into an ldap entry object.
protected  SearchResult createSearchResult(Document doc)
          Creates a search result that corresponds to the supplied DSML document.
protected  Object getAttrValue(Element valueElement, boolean base64)
          Returns the value of the supplied element taking into account whether the value needs to be base64 decoded.
 SearchResult read()
          Reads DSML data from the reader and returns a search result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dsmlv1Reader

public Dsmlv1Reader(Reader reader)
Creates a new dsml reader.

Parameters:
reader - to read DSML from

Dsmlv1Reader

public Dsmlv1Reader(Reader reader,
                    SortBehavior sb)
Creates a new dsml reader.

Parameters:
reader - to read DSML from
sb - sort behavior of the ldap result
Method Detail

read

public SearchResult read()
                  throws IOException
Reads DSML data from the reader and returns a search result.

Specified by:
read in interface SearchResultReader
Returns:
search result derived from the DSML
Throws:
IOException - if an error occurs using the reader

createSearchResult

protected SearchResult createSearchResult(Document doc)
Creates a search result that corresponds to the supplied DSML document.

Parameters:
doc - DSML to parse
Returns:
search result

createLdapEntry

protected LdapEntry createLdapEntry(Element entryElement)
Converts the supplied DSML entry element into an ldap entry object.

Parameters:
entryElement - to parse
Returns:
ldap entry

createLdapAttribute

protected LdapAttribute createLdapAttribute(String name,
                                            NodeList nodes)
Returns an ldap attribute derived from the supplied node list.

Parameters:
name - of the ldap attribute
nodes - to parse
Returns:
ldap attribute

getAttrValue

protected Object getAttrValue(Element valueElement,
                              boolean base64)
Returns the value of the supplied element taking into account whether the value needs to be base64 decoded.

Parameters:
valueElement - to read value from
base64 - whether to base64 decode the value
Returns:
String or byte[] depending on the base64 flag


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