Package edu.vt.middleware.ldap.bean
Class AbstractLdapResult<T extends java.util.Map<java.lang.String,LdapEntry>>
- java.lang.Object
-
- edu.vt.middleware.ldap.bean.AbstractLdapBean
-
- 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 java.util.Map<java.lang.String,LdapEntry>> extends AbstractLdapBean implements LdapResult
AbstractLdapResultprovides a base implementation ofLdapResultwhere the underlying entries are backed by aMap.- Version:
- $Revision: 1330 $ $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 May 2010) $
- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected TentriesEntries contained in this result.protected static intHASH_CODE_SEEDhash code seed.-
Fields inherited from class edu.vt.middleware.ldap.bean.AbstractLdapBean
beanFactory, logger
-
-
Constructor Summary
Constructors Constructor Description AbstractLdapResult(LdapBeanFactory lbf)Creates a newAbstractLdapResultwith the supplied ldap bean factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntries(java.util.Collection<LdapEntry> c)This adds aCollectionof entries to thisLdapResult.voidaddEntries(java.util.Iterator<javax.naming.directory.SearchResult> i)This adds anIteratorofSearchResultto thisLdapResult.voidaddEntries(javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> ne)This adds aNamingEnumerationofSearchResultto thisLdapResult.voidaddEntry(LdapEntry e)This adds a new entry to thisLdapResult.voidaddEntry(javax.naming.directory.SearchResult sr)This adds a new entry to thisLdapResult.voidclear()This removes all entries from thisLdapResult.java.util.Collection<LdapEntry>getEntries()This returns aCollectionofLdapEntryfor thisLdapResult.LdapEntrygetEntry(java.lang.String dn)This returns theLdapEntryfor thisLdapResultwith the supplied DN.inthashCode()This returns the hash code for this object.intsize()This returns the number of entries in this result.java.util.List<javax.naming.directory.SearchResult>toSearchResults()This returns aListofSearchResultthat represent the entries in thisLdapResult.java.lang.StringtoString()This returns a string representation of this object.-
Methods inherited from class edu.vt.middleware.ldap.bean.AbstractLdapBean
equals
-
-
-
-
Field Detail
-
HASH_CODE_SEED
protected static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractLdapResult
public AbstractLdapResult(LdapBeanFactory lbf)
Creates a newAbstractLdapResultwith the supplied ldap bean factory.- Parameters:
lbf-LdapBeanFactory
-
-
Method Detail
-
getEntries
public java.util.Collection<LdapEntry> getEntries()
This returns aCollectionofLdapEntryfor thisLdapResult.- Specified by:
getEntriesin interfaceLdapResult- Returns:
Collection
-
getEntry
public LdapEntry getEntry(java.lang.String dn)
This returns theLdapEntryfor thisLdapResultwith the supplied DN.- Specified by:
getEntryin interfaceLdapResult- Parameters:
dn-String- Returns:
LdapEntry
-
addEntry
public void addEntry(LdapEntry e)
This adds a new entry to thisLdapResult.- Specified by:
addEntryin interfaceLdapResult- Parameters:
e-LdapEntry
-
addEntry
public void addEntry(javax.naming.directory.SearchResult sr) throws javax.naming.NamingExceptionThis adds a new entry to thisLdapResult.- Specified by:
addEntryin interfaceLdapResult- Parameters:
sr-SearchResult- Throws:
javax.naming.NamingException- if the search results cannot be read
-
addEntries
public void addEntries(java.util.Collection<LdapEntry> c)
This adds aCollectionof entries to thisLdapResult. The list should containLdapEntryobjects.- Specified by:
addEntriesin interfaceLdapResult- Parameters:
c-Collection
-
addEntries
public void addEntries(javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> ne) throws javax.naming.NamingExceptionThis adds aNamingEnumerationofSearchResultto thisLdapResult.- Specified by:
addEntriesin interfaceLdapResult- Parameters:
ne-NamingEnumeration- Throws:
javax.naming.NamingException- if the search results cannot be read
-
addEntries
public void addEntries(java.util.Iterator<javax.naming.directory.SearchResult> i) throws javax.naming.NamingExceptionThis adds anIteratorofSearchResultto thisLdapResult.- Specified by:
addEntriesin interfaceLdapResult- Parameters:
i-Iterator- Throws:
javax.naming.NamingException- if the search results cannot be read
-
size
public int size()
This returns the number of entries in this result.- Specified by:
sizein interfaceLdapResult- Returns:
int
-
clear
public void clear()
This removes all entries from thisLdapResult.- Specified by:
clearin interfaceLdapResult
-
hashCode
public int hashCode()
This returns the hash code for this object.- Specified by:
hashCodein classAbstractLdapBean- Returns:
int
-
toString
public java.lang.String toString()
This returns a string representation of this object.- Overrides:
toStringin classjava.lang.Object- Returns:
String
-
toSearchResults
public java.util.List<javax.naming.directory.SearchResult> toSearchResults()
This returns aListofSearchResultthat represent the entries in thisLdapResult.- Specified by:
toSearchResultsin interfaceLdapResult- Returns:
List
-
-