Class LdapEntry
Represents a single entry in a directory, consisting of a distinguished name (DN) and zero or more attributes. An instance of LdapEntry is created in order to add an entry to a directory, and instances of LdapEntry are returned on a search by enumerating an LdapSearchResults.
Inherited Members
Namespace: Swan.Ldap
Syntax
public class LdapEntry
Constructors
LdapEntry(String, LdapAttributeSet)
Initializes a new instance of the LdapEntry class. Constructs a new entry with the specified distinguished name and set of attributes.
Declaration
public LdapEntry(string dn = null, LdapAttributeSet attrs = null)
Parameters
Type | Name | Description |
---|---|---|
String | dn | The distinguished name of the new entry. The value is not validated. An invalid distinguished name will cause operations using this entry to fail. |
LdapAttributeSet | attrs | The initial set of attributes assigned to the entry. |
Properties
DN
Returns the distinguished name of the entry.
Declaration
public string DN { get; }
Property Value
Type | Description |
---|---|
String | The dn. |
Methods
GetAttribute(String)
Returns the attributes matching the specified attrName.
Declaration
public LdapAttribute GetAttribute(string attrName)
Parameters
Type | Name | Description |
---|---|---|
String | attrName | The name of the attribute or attributes to return. |
Returns
Type | Description |
---|---|
LdapAttribute | The attribute matching the name. |
GetAttributeSet()
Returns the attribute set of the entry. All base and subtype variants of all attributes are returned. The LdapAttributeSet returned may be empty if there are no attributes in the entry.
Declaration
public LdapAttributeSet GetAttributeSet()
Returns
Type | Description |
---|---|
LdapAttributeSet | The attribute set of the entry. |
GetAttributeSet(String)
Returns an attribute set from the entry, consisting of only those attributes matching the specified subtypes. The getAttributeSet method can be used to extract only a particular language variant subtype of each attribute, if it exists. The "subtype" may be, for example, "lang-ja", "binary", or "lang-ja;phonetic". If more than one subtype is specified, separated with a semicolon, only those attributes with all of the named subtypes will be returned. The LdapAttributeSet returned may be empty if there are no matching attributes in the entry.
Declaration
public LdapAttributeSet GetAttributeSet(string subtype)
Parameters
Type | Name | Description |
---|---|---|
String | subtype | One or more subtype specification(s), separated with semicolons. The "lang-ja" and "lang-en;phonetic" are valid subtype specifications. |
Returns
Type | Description |
---|---|
LdapAttributeSet | An attribute set from the entry with the attributes that match the specified subtypes or an empty set if no attributes match. |