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

Examples of org.apache.directory.shared.ldap.name.DN


        // Get the modified entry and store it in the context for post usage
        ClonedServerEntry modifiedEntry = lookup( id );
        modifyContext.setAlteredEntry( modifiedEntry );

        // just overwrite the existing file
        DN dn = modifyContext.getDn();

        // And write it back on disk
        FileWriter fw = new FileWriter( getFile( dn, DELETE ) );
        fw.write( LdifUtils.convertEntryToLdif( modifiedEntry ) );
        fw.close();
View Full Code Here


     * {@inheritDoc}
     */
    @Override
    public void move( MoveOperationContext moveContext ) throws Exception
    {
        DN oldDn = moveContext.getDn();
        Long id = getEntryId( oldDn.getNormName() );

        wrappedPartition.move( moveContext );

        // Get the modified entry
        ClonedServerEntry modifiedEntry = lookup( id );
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws Exception
    {
        DN oldDn = moveAndRenameContext.getDn();
        Long id = getEntryId( oldDn.getNormName() );

        wrappedPartition.moveAndRename( moveAndRenameContext );

        // Get the modified entry and store it in the context for post usage
        ClonedServerEntry modifiedEntry = lookup( id );
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void rename( RenameOperationContext renameContext ) throws Exception
    {
        DN oldDn = renameContext.getDn();
        Long id = getEntryId( oldDn.getNormName() );

        // Create the new entry
        wrappedPartition.rename( renameContext );

        // Get the modified entry and store it in the context for post usage
View Full Code Here

    private File getFile( DN entryDn, boolean create ) throws NamingException
    {
        StringBuilder filePath = new StringBuilder();
        filePath.append( suffixDirectory ).append( File.separator );

        DN baseDn = ( DN ) entryDn.getSuffix( suffix.size() );

        for ( int i = 0; i < baseDn.size() - 1; i++ )
        {
            String rdnFileName = getFileName( baseDn.getRdn( i ) );

            filePath.append( rdnFileName ).append( File.separator );
        }

        String rdnFileName = getFileName( entryDn.getRdn() ) + CONF_FILE_EXTN;
View Full Code Here


    public MockOperation( int count ) throws Exception
    {
        this.count = count;
        this.session = new MockCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
            new MockDirectoryService( count ) );
    }
View Full Code Here

    /**
     * @param principalDN the principalDN to set
     */
    public void setPrincipalDN( String principalDN ) throws InvalidNameException
    {
        this.principalDN = new DN( principalDN );
    }
View Full Code Here

    /**
     * Helper class used to update the static DNs for each kind of Schema Object
     */
    private DN updateDNs( Map<String, DN> staticDNs, String path, Schema schema ) throws NamingException
    {
        DN dn = staticDNs.get( schema.getSchemaName() );

        if ( dn == null )
        {
            dn = new DN( path, "cn=" + schema.getSchemaName(), SchemaConstants.OU_SCHEMA );

            dn.normalize( schemaManager.getNormalizerMapping() );
            staticDNs.put( schema.getSchemaName(), dn );
        }

        return dn;
    }
View Full Code Here

    {
        List<Entry> attributeTypeList = new ArrayList<Entry>();

        for ( Schema schema : schemas )
        {
            DN dn = updateDNs( staticAttributeTypeDNs, SchemaConstants.ATTRIBUTES_TYPE_PATH, schema );

            // Check that we don't have an entry in the Dit for this schema
            if ( !partition.hasEntry( new EntryOperationContext( null, dn ) ) )
            {
                // No : get out, no AttributeType to load
View Full Code Here

            return comparatorList;
        }

        for ( Schema schema : schemas )
        {
            DN dn = updateDNs( staticComparatorsDNs, SchemaConstants.COMPARATORS_PATH, schema );

            if ( !partition.hasEntry( new EntryOperationContext( null, dn ) ) )
            {
                return comparatorList;
            }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.name.DN

Copyright © 2018 www.massapicom. 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.