Search in sources :

Example 1 with OidNormalizer

use of org.apache.directory.api.ldap.model.schema.normalizers.OidNormalizer in project directory-ldap-api by apache.

the class SearchRequestSubstringTest method setUp.

@BeforeClass
public static void setUp() throws Exception {
    // DC normalizer
    OidNormalizer dcOidNormalizer = new OidNormalizer("dc", new DeepTrimToLowerNormalizer(SchemaConstants.DOMAIN_COMPONENT_AT_OID));
    oids.put("dc", dcOidNormalizer);
    oids.put("domaincomponent", dcOidNormalizer);
    oids.put("0.9.2342.19200300.100.1.25", dcOidNormalizer);
    // OU normalizer
    OidNormalizer ouOidNormalizer = new OidNormalizer("ou", new DeepTrimToLowerNormalizer(SchemaConstants.OU_AT_OID));
    oids.put("ou", ouOidNormalizer);
    oids.put("organizationalUnitName", ouOidNormalizer);
    oids.put("2.5.4.11", ouOidNormalizer);
    // ObjectClass normalizer
    OidNormalizer objectClassOidNormalizer = new OidNormalizer("objectClass", new DeepTrimToLowerNormalizer(SchemaConstants.OBJECT_CLASS_AT_OID));
    oids.put("objectclass", objectClassOidNormalizer);
    oids.put("2.5.4.0", objectClassOidNormalizer);
}
Also used : DeepTrimToLowerNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer) OidNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.OidNormalizer) BeforeClass(org.junit.BeforeClass)

Example 2 with OidNormalizer

use of org.apache.directory.api.ldap.model.schema.normalizers.OidNormalizer in project directory-ldap-api by apache.

the class SearchRequestTest method setUp.

@Before
public void setUp() throws Exception {
    // DC normalizer
    OidNormalizer dcOidNormalizer = new OidNormalizer("dc", new DeepTrimToLowerNormalizer(SchemaConstants.DOMAIN_COMPONENT_AT_OID));
    oids.put("dc", dcOidNormalizer);
    oids.put("domaincomponent", dcOidNormalizer);
    oids.put("0.9.2342.19200300.100.1.25", dcOidNormalizer);
    // OU normalizer
    OidNormalizer ouOidNormalizer = new OidNormalizer("ou", new DeepTrimToLowerNormalizer(SchemaConstants.OU_AT_OID));
    oids.put("ou", ouOidNormalizer);
    oids.put("organizationalUnitName", ouOidNormalizer);
    oids.put("2.5.4.11", ouOidNormalizer);
    // ObjectClass normalizer
    OidNormalizer objectClassOidNormalizer = new OidNormalizer("objectClass", new DeepTrimToLowerNormalizer(SchemaConstants.OBJECT_CLASS_AT_OID));
    oids.put("objectclass", objectClassOidNormalizer);
    oids.put("2.5.4.0", objectClassOidNormalizer);
}
Also used : DeepTrimToLowerNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer) OidNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.OidNormalizer) Before(org.junit.Before)

Example 3 with OidNormalizer

use of org.apache.directory.api.ldap.model.schema.normalizers.OidNormalizer in project directory-ldap-api by apache.

the class SearchRequestMatchingRuleAssertionTest method setUp.

@BeforeClass
public static void setUp() throws Exception {
    // DC normalizer
    OidNormalizer dcOidNormalizer = new OidNormalizer("dc", new DeepTrimToLowerNormalizer(SchemaConstants.DOMAIN_COMPONENT_AT_OID));
    oids.put("dc", dcOidNormalizer);
    oids.put("domaincomponent", dcOidNormalizer);
    oids.put("0.9.2342.19200300.100.1.25", dcOidNormalizer);
    // OU normalizer
    OidNormalizer ouOidNormalizer = new OidNormalizer("ou", new DeepTrimToLowerNormalizer(SchemaConstants.OU_AT_OID));
    oids.put("ou", ouOidNormalizer);
    oids.put("organizationalUnitName", ouOidNormalizer);
    oids.put("2.5.4.11", ouOidNormalizer);
    // ObjectClass normalizer
    OidNormalizer objectClassOidNormalizer = new OidNormalizer("objectClass", new DeepTrimToLowerNormalizer(SchemaConstants.OBJECT_CLASS_AT_OID));
    oids.put("objectclass", objectClassOidNormalizer);
    oids.put("2.5.4.0", objectClassOidNormalizer);
}
Also used : DeepTrimToLowerNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer) OidNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.OidNormalizer) BeforeClass(org.junit.BeforeClass)

Example 4 with OidNormalizer

use of org.apache.directory.api.ldap.model.schema.normalizers.OidNormalizer in project directory-ldap-api by apache.

the class DefaultAttributeTypeRegistry method addMappingFor.

/**
 * {@inheritDoc}
 */
@Override
public void addMappingFor(AttributeType attributeType) throws LdapException {
    MatchingRule equality = attributeType.getEquality();
    OidNormalizer oidNormalizer;
    String oid = attributeType.getOid();
    if (equality == null) {
        LOG.debug("Attribute {} does not have an EQUALITY MatchingRule : using NoopNormalizer", attributeType.getName());
        oidNormalizer = new OidNormalizer(oid, new NoOpNormalizer(attributeType.getOid()));
    } else {
        oidNormalizer = new OidNormalizer(oid, equality.getNormalizer());
    }
    oidNormalizerMap.put(oid, oidNormalizer);
    // Also inject the attributeType's short names in the map
    for (String name : attributeType.getNames()) {
        oidNormalizerMap.put(Strings.toLowerCaseAscii(name), oidNormalizer);
    }
}
Also used : NoOpNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.NoOpNormalizer) OidNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.OidNormalizer) MatchingRule(org.apache.directory.api.ldap.model.schema.MatchingRule)

Aggregations

OidNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.OidNormalizer)4 DeepTrimToLowerNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer)3 BeforeClass (org.junit.BeforeClass)2 MatchingRule (org.apache.directory.api.ldap.model.schema.MatchingRule)1 NoOpNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.NoOpNormalizer)1 Before (org.junit.Before)1