Package netscape.ldap
Class LDAPEntry
java.lang.Object
netscape.ldap.LDAPEntry
- All Implemented Interfaces:
Serializable
Represents an entry in the directory.
- Version:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty entry.Constructs a new entry with the specified distinguished name and with an empty attribute set.LDAPEntry
(String distinguishedName, LDAPAttributeSet attrs) Constructs a new entry with the specified distinguished name and set of attributes. -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String attrName) In an entry, returns the single attribute that exactly matches the specified attribute name.getAttribute
(String attrName, String lang) Returns the subtype that matches "attrName" and that best matches a language specification "lang".Returns the attribute set of the entry.getAttributeSet
(String subtype) Creates a new attribute set containing only the attributes that have the specified subtypes.getDN()
Returns the distinguished name of the current entry.toString()
Retrieves the string representation of the entry's distinguished name (DN) and its attributes.
-
Constructor Details
-
LDAPEntry
public LDAPEntry()Constructs an empty entry. -
LDAPEntry
Constructs a new entry with the specified distinguished name and with an empty attribute set.- Parameters:
distinguishedName
- the distinguished name of the new entry
-
LDAPEntry
Constructs a new entry with the specified distinguished name and set of attributes.- Parameters:
distinguishedName
- the distinguished name of the new entryattrs
- the set of attributes to assign to the new entry- See Also:
-
-
Method Details
-
getDN
Returns the distinguished name of the current entry.- Returns:
- distinguished name of the current entry.
-
getAttributeSet
Returns the attribute set of the entry.- Returns:
- set of attributes in the entry.
- See Also:
-
getAttributeSet
Creates a new attribute set containing only the attributes that have the specified subtypes.For example, suppose an entry contains the following attributes:
cn cn;lang-ja sn;phonetic;lang-ja sn;lang-us
If you call thegetAttributeSet
method and passlang-ja
as the argument, the method returns an attribute set containing the following attributes:cn;lang-ja sn;phonetic;lang-ja
- Parameters:
subtype
- semi-colon delimited list of subtypes that you want to find in attribute names."lang-ja" // Only Japanese language subtypes "binary" // Only binary subtypes "binary;lang-ja" // Only Japanese language subtypes which also are binary
- Returns:
- attribute set containing the attributes that have the specified subtypes.
- See Also:
-
getAttribute
In an entry, returns the single attribute that exactly matches the specified attribute name.- Parameters:
attrName
- name of attribute to return For example:"cn" // Only a non-subtyped version of cn "cn;lang-ja" // Only a Japanese version of cn, will not // return "cn;lang-ja-JP-kanji", for example
- Returns:
- attribute in the current entry that has exactly the same name, or null (if no attribute in the entry matches the specified name).
- See Also:
-
getAttribute
Returns the subtype that matches "attrName" and that best matches a language specification "lang". If there are subtypes other than "lang" subtypes included in attrName, e.g. "cn;binary", only attributes with all of those subtypes are returned. If lang is null or empty, the method behaves as getAttribute(attrName). If there are no matching attributes, null is returned. Example:Assume the entry contains only the following attributes:
cn;lang-en
cn;lang-ja-JP-kanji
sn
getAttribute( "cn" ) returnsnull
. getAttribute( "sn" ) returns the "sn
" attribute. getAttribute( "cn", "lang-en-us" ) returns the "cn;lang-en
" attribute. getAttribute( "cn", "lang-en" ) returns the "cn;lang-en
" attribute. getAttribute( "cn", "lang-ja" ) returnsnull
. getAttribute( "sn", "lang-en" ) returns the "sn
" attribute.- Parameters:
attrName
- name of attribute to find in the entrylang
- a language specification (for example,lang-en
)- Returns:
- the attribute that matches the base name and that best matches any specified language subtype.
- See Also:
-
toString
Retrieves the string representation of the entry's distinguished name (DN) and its attributes. For example:LDAPEntry: uid=bjensen, ou=People, o=airius.com; LDAPAttributeSet: LDAPAttribute {type='cn', values='Barbara Jensen,Babs Jensen'} LDAPAttribute {type='sn', values='Jensen'}LDAPAttribute {type='givenname', values='Barbara'}LDAPAttribute {type='objectclass', values='top,person, organizationalPerson,inetOrgPerson'}LDAPAttribute {type='ou', values='Product Development,People'}
-