Package org.apache.directory.shared.ldap.name

Examples of org.apache.directory.shared.ldap.name.LdapDN.normalize()


        Attribute modifiersNameAttr = subentry.get( "modifiersName" );
        Attribute modifyTimestampAttr = subentry.get( "modifyTimestamp" );
        assertNotNull( modifiersNameAttr );
        LdapDN expectedDN = new LdapDN( "uid=admin,ou=system" );
        expectedDN.normalize( service.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
        assertEquals( expectedDN.getNormName(), modifiersNameAttr.get() );
        assertNotNull( modifyTimestampAttr );

        Calendar cal = Calendar.getInstance( tz );
        String modifyTimestampStr = ( String ) modifyTimestampAttr.get();
View Full Code Here


   
   
    private void modify( int op, List<String> descriptions, String opAttr ) throws Exception
    {
        LdapDN dn = new LdapDN( getSubschemaSubentryDN() );
        dn.normalize( service.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
        Attribute attr = new BasicAttribute( opAttr );
        for ( String description : descriptions )
        {
            attr.add( description );
        }
View Full Code Here

        {
            principalDn = "";
        }

        LdapDN userDn = new LdapDN( principalDn );
        userDn.normalize( service.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
        LdapPrincipal principal = new LdapPrincipal( userDn, AuthenticationLevel.SIMPLE );

        if ( dn == null )
        {
            dn = "";
View Full Code Here

        {
            principalDn = "";
        }
       
        LdapDN userDn = new LdapDN( principalDn );
        userDn.normalize( service.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
        LdapPrincipal principal = new LdapPrincipal( userDn, AuthenticationLevel.SIMPLE );
       
        if ( dn == null )
        {
            dn = "";
View Full Code Here

       
        // Test AddContextPartition
        service.addPartition( partition );
       
        LdapDN suffixDn = new LdapDN( "ou=removable" );
        suffixDn.normalize( service.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
        ServerEntry ctxEntry = new DefaultServerEntry( service.getRegistries(), suffixDn );
        ctxEntry.put( "objectClass", "top" );
        ctxEntry.get( "objectClass" ).add( "organizationalUnit" );
        ctxEntry.put( "ou", "removable" );
        ctxEntry.put( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
View Full Code Here

        Set<String> oids = new HashSet<String>( results.size() );
       
        for ( ServerEntry result : results )
        {
            LdapDN dn = result.getDn();
            dn.normalize( this.targetRegistries.getAttributeTypeRegistry().getNormalizerMapping() );
            oids.add( ( String ) dn.getRdn().getValue() );
        }
       
        return oids;
    }
View Full Code Here


    private EntryFilteringCursor listSchemas() throws Exception
    {
        LdapDN base = new LdapDN( ServerDNConstants.OU_SCHEMA_DN );
        base.normalize( attrRegistry.getNormalizerMapping() );
        ExprNode filter = new EqualityNode<String>( oidRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT ),
            new ClientStringValue( MetaSchemaConstants.META_SCHEMA_OC ) );

        SearchOperationContext searchContext = new SearchOperationContext( null );
        searchContext.setDn( base );
View Full Code Here


    public Schema getSchema( String schemaName ) throws Exception
    {
        LdapDN dn = new LdapDN( "cn=" + schemaName + ",ou=schema" );
        dn.normalize( attrRegistry.getNormalizerMapping() );
        return factory.getSchema( partition.lookup( new LookupOperationContext( null, dn ) ) );
    }


    public boolean hasMatchingRule( String oid ) throws Exception
View Full Code Here

    public LdapDN findDn( String entityName ) throws Exception
    {
        ServerEntry sr = find( entityName );
        LdapDN dn = sr.getDn();
        dn.normalize( attrRegistry.getNormalizerMapping() );
        return dn;
    }


    /**
 
View Full Code Here

     * @throws NamingException if there is a problem updating the schema entry
     */
    public void enableSchema( String schemaName ) throws Exception
    {
        LdapDN dn = new LdapDN( "cn=" + schemaName + ",ou=schema" );
        dn.normalize( attrRegistry.getNormalizerMapping() );
        ServerEntry entry = partition.lookup( new LookupOperationContext( null, dn ) );
        EntryAttribute disabledAttr = entry.get( disabledAttributeType );
        List<Modification> mods = new ArrayList<Modification>( 3 );

        if ( disabledAttr == null )
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.