class documentation

Undocumented

Method __contains__ TODO
Method __delitem__ Delete all values of an attribute.
Method __eq__ Comparison. Only equality is supported.
Method __getitem__ Get all values of an attribute.
Method __hash__ Undocumented
Method __init__ Initialize the object.
Method __len__ TODO
Method __ne__ Inequality comparison. See L{__eq__}.
Method __nonzero__ Always return True
Method __repr__ Undocumented
Method __setitem__ Set values of an attribute. Please use lists. Do not modify the lists in place, that's not supported _yet_.
Method addChild Undocumented
Method bind Try to authenticate with given secret.
Method buildAttributeSet Undocumented
Method commit Send all pending changes to the LDAP server.
Method delete Delete this object from the LDAP server.
Method fetch Fetch the attributes of this object from the server.
Method get Get all values of an attribute.
Method has_key TODO
Method items TODO
Method journal Add a Modification into the list of modifications that need to be flushed to the LDAP server.
Method keys TODO
Method lookup Lookup the referred to by dn.
Method move Move the object to a new DN.
Method namingContext Return an LDAPEntry for the naming context that contains this object.
Method search Perform an LDAP search with this object as the base.
Method setPassword Update the password for the entry with a new password and salt passed as bytes.
Method setPassword_ExtendedOperation Set the password on this object.
Method setPassword_Samba Set the Samba password on this object.
Method setPasswordMaybe_Samba Set the Samba password on this object if it is a sambaSamAccount or sambaAccount.
Method toWire Undocumented
Method undo Forget all pending changes.
Instance Variable client Undocumented
Instance Variable complete Undocumented
Instance Variable dn Undocumented
Method _assertMatchedDN Undocumented
Method _canRemove Called by JournaledLDAPAttributeSet when it is about to remove a value of an attributeType.
Method _canRemoveAll Called by JournaledLDAPAttributeSet when it is about to remove all values of an attributeType.
Method _cbAddDone Undocumented
Method _cbDeleteDone Undocumented
Method _cbFetch Undocumented
Method _cbMoveDone Undocumented
Method _cbNamingContext_Entries Undocumented
Method _cbSearchEntry Undocumented
Method _cbSearchMsg Undocumented
Method _cbSetPassword Undocumented
Method _cbSetPassword_ExtendedOperation Undocumented
Method _cbSetPassword_one Undocumented
Method _checkState Undocumented
Method _commit_success Undocumented
Method _ebSetPassword_one Undocumented
Method _handle_bind_msg Undocumented
Method _setPasswordAll Undocumented
Class Variable _setPasswordPriority_ExtendedOperation Undocumented
Class Variable _setPasswordPriority_Samba Undocumented
Instance Variable _journal Undocumented
Instance Variable _remoteData Undocumented
Instance Variable _state State of an LDAPEntry is one of:

Inherited from BaseLDAPEntry (via EditableLDAPEntry):

Method __bool__ Undocumented
Method __iter__ Undocumented
Method diff Compute differences between this and another LDAP entry.
Method getLDIF Undocumented
Method hasMember Undocumented
Method _bind Undocumented
Class Variable _object_class_keys Undocumented
Class Variable _object_class_lower_keys Undocumented
Class Variable _user_password_keys Undocumented
Instance Variable _attributes Undocumented

Inherited from WireStrAlias (via EditableLDAPEntry, BaseLDAPEntry):

Method __str__ Undocumented
def __delitem__(self, key): (source)

Delete all values of an attribute. >>> o=LDAPEntry(client=ldapclient.LDAPClient(), ... dn='cn=foo,dc=example,dc=com', ... attributes={ ... 'anAttribute': ['itsValue', 'secondValue'], ... 'another': ['moreValues'], ... }) >>> del o['anAttribute'] >>> o LDAPEntry(dn='cn=foo,dc=example,dc=com', attributes={'another': ['moreValues']})

def __eq__(self, other): (source)

Comparison. Only equality is supported. >>> client=ldapclient.LDAPClient() >>> a=LDAPEntry(client=client, ... dn='dc=example,dc=com') >>> b=LDAPEntry(client=client, ... dn='dc=example,dc=com') >>> a==b 1 >>> c=LDAPEntry(client=ldapclient.LDAPClient(), ... dn='ou=different,dc=example,dc=com') >>> a==c 0 Comparison does not consider the client of the object. >>> anotherClient=ldapclient.LDAPClient() >>> d=LDAPEntry(client=anotherClient, ... dn='dc=example,dc=com') >>> a==d 1

def __getitem__(self, *a, **kw): (source)

Get all values of an attribute. >>> o=LDAPEntry(client=ldapclient.LDAPClient(), ... dn='cn=foo,dc=example,dc=com', ... attributes={'anAttribute': ['itsValue']}) >>> o['anAttribute'] ['itsValue']

def __hash__(self): (source)

Undocumented

def __init__(self, client, dn, attributes={}, complete=0): (source)

Initialize the object. @param client: The LDAP client connection this object belongs to. @param dn: Distinguished Name of the object, as a string. @param attributes: Attributes of the object. A dictionary of attribute types to list of attribute values.

def __ne__(self, other): (source)

Inequality comparison. See L{__eq__}.

def __nonzero__(self): (source)
def __repr__(self): (source)

Undocumented

def __setitem__(self, key, value): (source)

Set values of an attribute. Please use lists. Do not modify the lists in place, that's not supported _yet_. >>> o=LDAPEntry(client=ldapclient.LDAPClient(), ... dn='cn=foo,dc=example,dc=com', ... attributes={'anAttribute': ['itsValue']}) >>> o['anAttribute']=['foo', 'bar'] >>> o['anAttribute'] ['bar', 'foo']

def addChild(self, rdn, attributes): (source)

Undocumented

def bind(self, password): (source)

Try to authenticate with given secret. @return: Deferred ILDAPEntry (that is, self). @raise ldaperrors.LDAPInvalidCredentials: password was incorrect.

def buildAttributeSet(self, key, values): (source)
def commit(self): (source)

Send all pending changes to the LDAP server. @returns: a Deferred that fires True (operation succeeded) or False (operation failed).

def delete(self): (source)

Delete this object from the LDAP server. @return: A Deferred that will complete when the delete is done.

def fetch(self, *attributes): (source)

Fetch the attributes of this object from the server. @param attributes: Attributes to fetch. If none, fetch all attributes. Fetched attributes are overwritten, and if fetching all attributes, attributes that are not on the server are removed. @return: A Deferred that will complete when the operation is done.

def get(self, *a, **kw): (source)

Get all values of an attribute. >>> o=LDAPEntry(client=ldapclient.LDAPClient(), ... dn='cn=foo,dc=example,dc=com', ... attributes={'anAttribute': ['itsValue']}) >>> o.get('anAttribute') ['itsValue'] >>> o.get('foo') >>> o.get('foo', []) []

def journal(self, journalOperation): (source)

Add a Modification into the list of modifications that need to be flushed to the LDAP server. Normal callers should not use this, they should use the o['foo']=['bar', 'baz'] -style API that enforces schema, handles errors and updates the cached data.

def lookup(self, dn): (source)

Lookup the referred to by dn. @return: A Deferred returning an ILDAPEntry, or failing with e.g. LDAPNoSuchObject.

def move(self, newDN): (source)

Move the object to a new DN. @param newDN: the new DistinguishedName @return: A Deferred that will complete when the move is done.

def namingContext(self): (source)

Return an LDAPEntry for the naming context that contains this object.

def search(self, filterText=None, filterObject=None, attributes=(), scope=None, derefAliases=None, sizeLimit=0, sizeLimitIsNonFatal=False, timeLimit=0, typesOnly=0, callback=None, controls=None, return_controls=False): (source)

Perform an LDAP search with this object as the base. @param filterText: LDAP search filter as a string. @param filterObject: LDAP search filter as LDAPFilter. Note if both filterText and filterObject are given, they are combined with AND. If neither is given, the search is made with a filter that matches everything. @param attributes: List of attributes to retrieve for the result objects. An empty list and means all. @param scope: Whether to recurse into subtrees. @param derefAliases: Whether to deref LDAP aliases. TODO write better documentation. @param sizeLimit: At most how many entries to return. 0 means unlimited. @param timeLimit: At most how long to use for processing the search request. 0 means unlimited. @param typesOnly: Whether to return attribute types only, or also values. @param callback: Callback function to call for each resulting LDAPEntry. None means gather the results into a list and give that to the Deferred returned from here. @return: A Deferred that will complete when the search is done. The Deferred gives None if callback was given and a list of the search results if callback is not given or is None.

def setPassword(self, newPasswd): (source)

Update the password for the entry with a new password and salt passed as bytes.

def setPassword_ExtendedOperation(self, newPasswd): (source)

Set the password on this object. @param newPasswd: A string containing the new password. @return: A Deferred that will complete when the operation is done.

def setPassword_Samba(self, newPasswd, style=None): (source)

Set the Samba password on this object. @param newPasswd: A string containing the new password. @param style: one of 'sambaSamAccount', 'sambaAccount' or None. Specifies the style of samba accounts used. None is default and is the same as 'sambaSamAccount'. @return: A Deferred that will complete when the operation is done.

def setPasswordMaybe_Samba(self, newPasswd): (source)

Set the Samba password on this object if it is a sambaSamAccount or sambaAccount. @param newPasswd: A string containing the new password. @return: A Deferred that will complete when the operation is done.

def toWire(self): (source)

Undocumented

def undo(self): (source)
client = (source)

Undocumented

complete: int = (source)

Undocumented

def _assertMatchedDN(self, dn): (source)

Undocumented

def _canRemove(self, key, value): (source)

Called by JournaledLDAPAttributeSet when it is about to remove a value of an attributeType.

def _canRemoveAll(self, key): (source)

Called by JournaledLDAPAttributeSet when it is about to remove all values of an attributeType.

def _cbAddDone(self, msg, dn): (source)

Undocumented

def _cbDeleteDone(self, msg): (source)

Undocumented

def _cbFetch(self, results, overWrite): (source)

Undocumented

def _cbMoveDone(self, msg, newDN): (source)

Undocumented

def _cbNamingContext_Entries(self, results): (source)

Undocumented

def _cbSearchEntry(self, callback, objectName, attributes, complete): (source)

Undocumented

def _cbSearchMsg(self, msg, controls, d, callback, complete, sizeLimitIsNonFatal): (source)

Undocumented

def _cbSetPassword(self, dl, names): (source)

Undocumented

def _cbSetPassword_ExtendedOperation(self, msg): (source)

Undocumented

def _cbSetPassword_one(self, result): (source)

Undocumented

def _checkState(self): (source)

Undocumented

def _commit_success(self, msg): (source)

Undocumented

def _ebSetPassword_one(self, fail): (source)

Undocumented

def _handle_bind_msg(self, msg): (source)

Undocumented

def _setPasswordAll(self, results, newPasswd, prefix, names): (source)

Undocumented

_setPasswordPriority_ExtendedOperation: int = (source)

Undocumented

_setPasswordPriority_Samba: int = (source)

Undocumented

_journal: list = (source)

Undocumented

_remoteData = (source)

Undocumented

_state: str = (source)

State of an LDAPEntry is one of: invalid - object not initialized yet ready - normal deleted - object has been deleted