edu.vt.middleware.ldap.bean
Class AbstractLdapResult<T extends Map<String,LdapEntry>>

java.lang.Object
  extended by edu.vt.middleware.ldap.bean.AbstractLdapBean
      extended by edu.vt.middleware.ldap.bean.AbstractLdapResult<T>
Type Parameters:
T - type of backing map
All Implemented Interfaces:
LdapResult
Direct Known Subclasses:
OrderedLdapBeanFactory.OrderedLdapResult, SortedLdapBeanFactory.SortedLdapResult, UnorderedLdapBeanFactory.UnorderedLdapResult

public abstract class AbstractLdapResult<T extends Map<String,LdapEntry>>
extends AbstractLdapBean
implements LdapResult

AbstractLdapResult provides a base implementation of LdapResult where the underlying entries are backed by a Map.

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

Field Summary
protected  T entries
          Entries contained in this result.
protected static int HASH_CODE_SEED
          hash code seed.
 
Fields inherited from class edu.vt.middleware.ldap.bean.AbstractLdapBean
beanFactory, logger
 
Constructor Summary
AbstractLdapResult(LdapBeanFactory lbf)
          Creates a new AbstractLdapResult with the supplied ldap bean factory.
 
Method Summary
 void addEntries(Collection<LdapEntry> c)
          This adds a Collection of entries to this LdapResult.
 void addEntries(Iterator<SearchResult> i)
          This adds an Iterator of SearchResult to this LdapResult.
 void addEntries(NamingEnumeration<SearchResult> ne)
          This adds a NamingEnumeration of SearchResult to this LdapResult.
 void addEntry(LdapEntry e)
          This adds a new entry to this LdapResult.
 void addEntry(SearchResult sr)
          This adds a new entry to this LdapResult.
 void clear()
          This removes all entries from this LdapResult.
 Collection<LdapEntry> getEntries()
          This returns a Collection of LdapEntry for this LdapResult.
 LdapEntry getEntry(String dn)
          This returns the LdapEntry for this LdapResult with the supplied DN.
 int hashCode()
          This returns the hash code for this object.
 int size()
          This returns the number of entries in this result.
 List<SearchResult> toSearchResults()
          This returns a List of SearchResult that represent the entries in this LdapResult.
 String toString()
          This returns a string representation of this object.
 
Methods inherited from class edu.vt.middleware.ldap.bean.AbstractLdapBean
equals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HASH_CODE_SEED

protected static final int HASH_CODE_SEED
hash code seed.

See Also:
Constant Field Values

entries

protected T extends Map<String,LdapEntry> entries
Entries contained in this result.

Constructor Detail

AbstractLdapResult

public AbstractLdapResult(LdapBeanFactory lbf)
Creates a new AbstractLdapResult with the supplied ldap bean factory.

Parameters:
lbf - LdapBeanFactory
Method Detail

getEntries

public Collection<LdapEntry> getEntries()
This returns a Collection of LdapEntry for this LdapResult.

Specified by:
getEntries in interface LdapResult
Returns:
Collection

getEntry

public LdapEntry getEntry(String dn)
This returns the LdapEntry for this LdapResult with the supplied DN.

Specified by:
getEntry in interface LdapResult
Parameters:
dn - String
Returns:
LdapEntry

addEntry

public void addEntry(LdapEntry e)
This adds a new entry to this LdapResult.

Specified by:
addEntry in interface LdapResult
Parameters:
e - LdapEntry

addEntry

public void addEntry(SearchResult sr)
              throws NamingException
This adds a new entry to this LdapResult.

Specified by:
addEntry in interface LdapResult
Parameters:
sr - SearchResult
Throws:
NamingException - if the search results cannot be read

addEntries

public void addEntries(Collection<LdapEntry> c)
This adds a Collection of entries to this LdapResult. The list should contain LdapEntry objects.

Specified by:
addEntries in interface LdapResult
Parameters:
c - Collection

addEntries

public void addEntries(NamingEnumeration<SearchResult> ne)
                throws NamingException
This adds a NamingEnumeration of SearchResult to this LdapResult.

Specified by:
addEntries in interface LdapResult
Parameters:
ne - NamingEnumeration
Throws:
NamingException - if the search results cannot be read

addEntries

public void addEntries(Iterator<SearchResult> i)
                throws NamingException
This adds an Iterator of SearchResult to this LdapResult.

Specified by:
addEntries in interface LdapResult
Parameters:
i - Iterator
Throws:
NamingException - if the search results cannot be read

size

public int size()
This returns the number of entries in this result.

Specified by:
size in interface LdapResult
Returns:
int

clear

public void clear()
This removes all entries from this LdapResult.

Specified by:
clear in interface LdapResult

hashCode

public int hashCode()
This returns the hash code for this object.

Specified by:
hashCode in class AbstractLdapBean
Returns:
int

toString

public String toString()
This returns a string representation of this object.

Overrides:
toString in class Object
Returns:
String

toSearchResults

public List<SearchResult> toSearchResults()
This returns a List of SearchResult that represent the entries in this LdapResult.

Specified by:
toSearchResults in interface LdapResult
Returns:
List


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