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
AbstractLdapResult
provides a base implementation ofLdapResult
where 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 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
Constructors Constructor Description AbstractLdapResult(LdapBeanFactory lbf)
Creates a newAbstractLdapResult
with the supplied ldap bean factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEntries(java.util.Collection<LdapEntry> c)
This adds aCollection
of entries to thisLdapResult
.void
addEntries(java.util.Iterator<javax.naming.directory.SearchResult> i)
This adds anIterator
ofSearchResult
to thisLdapResult
.void
addEntries(javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> ne)
This adds aNamingEnumeration
ofSearchResult
to thisLdapResult
.void
addEntry(LdapEntry e)
This adds a new entry to thisLdapResult
.void
addEntry(javax.naming.directory.SearchResult sr)
This adds a new entry to thisLdapResult
.void
clear()
This removes all entries from thisLdapResult
.java.util.Collection<LdapEntry>
getEntries()
This returns aCollection
ofLdapEntry
for thisLdapResult
.LdapEntry
getEntry(java.lang.String dn)
This returns theLdapEntry
for thisLdapResult
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.java.util.List<javax.naming.directory.SearchResult>
toSearchResults()
This returns aList
ofSearchResult
that represent the entries in thisLdapResult
.java.lang.String
toString()
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 newAbstractLdapResult
with the supplied ldap bean factory.- Parameters:
lbf
-LdapBeanFactory
-
-
Method Detail
-
getEntries
public java.util.Collection<LdapEntry> getEntries()
This returns aCollection
ofLdapEntry
for thisLdapResult
.- Specified by:
getEntries
in interfaceLdapResult
- Returns:
Collection
-
getEntry
public LdapEntry getEntry(java.lang.String dn)
This returns theLdapEntry
for thisLdapResult
with the supplied DN.- Specified by:
getEntry
in interfaceLdapResult
- Parameters:
dn
-String
- Returns:
LdapEntry
-
addEntry
public void addEntry(LdapEntry e)
This adds a new entry to thisLdapResult
.- Specified by:
addEntry
in interfaceLdapResult
- Parameters:
e
-LdapEntry
-
addEntry
public void addEntry(javax.naming.directory.SearchResult sr) throws javax.naming.NamingException
This adds a new entry to thisLdapResult
.- Specified by:
addEntry
in 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 aCollection
of entries to thisLdapResult
. The list should containLdapEntry
objects.- Specified by:
addEntries
in interfaceLdapResult
- Parameters:
c
-Collection
-
addEntries
public void addEntries(javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> ne) throws javax.naming.NamingException
This adds aNamingEnumeration
ofSearchResult
to thisLdapResult
.- Specified by:
addEntries
in 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.NamingException
This adds anIterator
ofSearchResult
to thisLdapResult
.- Specified by:
addEntries
in 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:
size
in interfaceLdapResult
- Returns:
int
-
clear
public void clear()
This removes all entries from thisLdapResult
.- Specified by:
clear
in interfaceLdapResult
-
hashCode
public int hashCode()
This returns the hash code for this object.- Specified by:
hashCode
in classAbstractLdapBean
- Returns:
int
-
toString
public java.lang.String toString()
This returns a string representation of this object.- Overrides:
toString
in classjava.lang.Object
- Returns:
String
-
toSearchResults
public java.util.List<javax.naming.directory.SearchResult> toSearchResults()
This returns aList
ofSearchResult
that represent the entries in thisLdapResult
.- Specified by:
toSearchResults
in interfaceLdapResult
- Returns:
List
-
-