Search in sources :

Example 6 with LDAPNode

use of org.structr.ldap.entity.LDAPNode in project structr by structr.

the class StructrLDAPWrapper method filter.

public List<Entry> filter(final Dn dn, final ExprNode filter, final SearchScope scope) throws LdapException {
    try (final Tx tx = app().tx()) {
        final LDAPNode entry = find(dn);
        List<Entry> result = null;
        if (entry != null) {
            result = filter(entry, filter, scope, 0);
        }
        tx.success();
        if (result != null) {
            return result;
        }
    } catch (FrameworkException fex) {
        handleException(fex);
    }
    return Collections.emptyList();
}
Also used : LDAPNode(org.structr.ldap.entity.LDAPNode) DefaultEntry(org.apache.directory.api.ldap.model.entry.DefaultEntry) Entry(org.apache.directory.api.ldap.model.entry.Entry) ClonedServerEntry(org.apache.directory.server.core.api.entry.ClonedServerEntry) Tx(org.structr.core.graph.Tx) FrameworkException(org.structr.common.error.FrameworkException)

Example 7 with LDAPNode

use of org.structr.ldap.entity.LDAPNode in project structr by structr.

the class StructrLDAPWrapper method get.

public Entry get(final Dn dn) throws LdapException {
    try (final Tx tx = app().tx()) {
        final LDAPNode entry = find(dn);
        tx.success();
        if (entry != null) {
            return getEntry(entry);
        }
    } catch (FrameworkException fex) {
        handleException(fex);
    }
    // not found
    return null;
}
Also used : LDAPNode(org.structr.ldap.entity.LDAPNode) Tx(org.structr.core.graph.Tx) FrameworkException(org.structr.common.error.FrameworkException)

Aggregations

LDAPNode (org.structr.ldap.entity.LDAPNode)7 FrameworkException (org.structr.common.error.FrameworkException)4 Tx (org.structr.core.graph.Tx)4 LinkedList (java.util.LinkedList)2 DefaultEntry (org.apache.directory.api.ldap.model.entry.DefaultEntry)2 Entry (org.apache.directory.api.ldap.model.entry.Entry)2 Rdn (org.apache.directory.api.ldap.model.name.Rdn)2 ClonedServerEntry (org.apache.directory.server.core.api.entry.ClonedServerEntry)2 App (org.structr.core.app.App)2 StructrApp (org.structr.core.app.StructrApp)2 NodeAttribute (org.structr.core.graph.NodeAttribute)2 LinkedHashSet (java.util.LinkedHashSet)1 Attribute (org.apache.directory.api.ldap.model.entry.Attribute)1 DefaultAttribute (org.apache.directory.api.ldap.model.entry.DefaultAttribute)1 Dn (org.apache.directory.api.ldap.model.name.Dn)1 AttributeType (org.apache.directory.api.ldap.model.schema.AttributeType)1 ObjectClassRegistry (org.apache.directory.api.ldap.model.schema.registries.ObjectClassRegistry)1 LDAPAttribute (org.structr.ldap.entity.LDAPAttribute)1