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

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


    {
        if ( !wizard.isNewContextEntry() )
        {
            dnBuilderWidget.validate();

            Rdn rdn = dnBuilderWidget.getRdn();
            LdapDN parentDn = dnBuilderWidget.getParentDn();
            final LdapDN dn = DnUtils.composeDn( rdn, parentDn );

            // check if parent exists
            ReadEntryRunnable readEntryRunnable1 = new ReadEntryRunnable( wizard.getSelectedConnection(), parentDn );
View Full Code Here


            if ( entry != null )
            {
                RenameEntryDialog renameDialog = new RenameEntryDialog( parent.getShell(), entry );
                if ( renameDialog.open() == Dialog.OK )
                {
                    Rdn newRdn = renameDialog.getRdn();
                    if ( newRdn != null && !newRdn.equals( entry.getRdn() ) )
                    {
                        IEntry originalEntry = entry.getBrowserConnection().getEntryFromCache( entry.getDn() );
                        new RenameEntryJob( originalEntry, newRdn, new SimulateRenameDialogImpl( parent.getShell() ) )
                            .execute();
                    }
View Full Code Here

        StringBuffer sb = new StringBuffer();

        Iterator<Rdn> it = dn.getRdns().iterator();
        while ( it.hasNext() )
        {
            Rdn rdn = it.next();
            sb.append( getOidString( rdn, schema ) );
            if ( it.hasNext() )
            {
                sb.append( ',' );
            }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Rdn getRdn()
    {
        Rdn rdn = dn.getRdn();
        return rdn == null ? new Rdn() : rdn;
    }
View Full Code Here

        }

        try
        {
            LdapDN dn = new LdapDN( newDn );
            Rdn newrdn = dn.getRdn();
            LdapDN newsuperior = DnUtils.getParent( dn );

            LdifChangeModDnRecord record = new LdifChangeModDnRecord( LdifDnLine.create( oldDn ) );
            addControlLines( record, controls );
            record.setChangeType( LdifChangeTypeLine.createModDn() );
            record.setNewrdn( LdifNewrdnLine.create( newrdn.getUpName() ) );
            record.setDeloldrdn( deleteOldRdn ? LdifDeloldrdnLine.create1() : LdifDeloldrdnLine.create0() );
            record.setNewsuperior( LdifNewsuperiorLine.create( newsuperior.getUpName() ) );
            record.finish( LdifSepLine.create() );

            String formattedString = record.toFormattedString( LdifFormatParameters.DEFAULT );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Rdn getRdn()
    {
        Rdn rdn = getDn().getRdn();
        return rdn == null ? new Rdn() : rdn;
    }
View Full Code Here

        {
            return BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_BROWSER_SCHEMABROWSEREDITOR );
        }
        else
        {
            Rdn rdn = entry.getRdn();
            Iterator<AttributeTypeAndValue> atavIterator = rdn.iterator();
            while ( atavIterator.hasNext() )
            {
                AttributeTypeAndValue atav = atavIterator.next();
                if ( "cn".equalsIgnoreCase( atav.getUpType() ) || "sn".equalsIgnoreCase( atav.getUpType() )
                    || "uid".equalsIgnoreCase( atav.getUpType() ) || "userid".equalsIgnoreCase( atav.getUpType() ) )
View Full Code Here

        {
            return getDelegate().getRdn();
        }
        else
        {
            Rdn rdn = dn.getRdn();
            return rdn == null ? new Rdn() : rdn;
        }
    }
View Full Code Here

            while ( !monitor.isCanceled() && entries.hasMore() )
            {
                // get next entry to copy
                SearchResult sr = entries.next();
                LdapDN oldLdapDn = JNDIUtils.getDn( sr );
                Rdn oldRdn = oldLdapDn.getRdn();
               
                // reuse attributes of the entry to copy
                Attributes newAttributes = sr.getAttributes();

                // compose new DN
                Rdn newRdn = oldLdapDn.getRdn();
                if( forceNewRdn != null )
                {
                    newRdn = forceNewRdn;
                }
                LdapDN newLdapDn = DnUtils.composeDn( newRdn, parentDn );

                // apply new RDN to the attributes
                applyNewRdn( newAttributes, oldRdn, newRdn );

                // determine referrals handling method
                ReferralHandlingMethod referralsHandlingMethod = newAttributes.get( "ref" ) != null ? ReferralHandlingMethod.MANAGE
                    : ReferralHandlingMethod.FOLLOW;

                // create entry
                targetBrowserConnection.getConnection().getJNDIConnectionWrapper().createEntry( newLdapDn.getUpName(),
                    newAttributes, referralsHandlingMethod, null, dummyMonitor, null );

                while ( dummyMonitor.errorsReported() )
                {
                    if ( dialog != null && dummyMonitor.getException() instanceof NameAlreadyBoundException )
                    {
                        // open dialog
                        dialog.setExistingEntry( targetBrowserConnection, newLdapDn );
                        dialog.open();
                        EntryExistsCopyStrategy strategy = dialog.getStrategy();
//                        boolean rememberSelection = dialog.isRememberSelection();
                        if ( strategy != null )
                        {
                            dummyMonitor.reset();

                            switch ( strategy )
                            {
                                case BREAK:
                                    monitor.setCanceled( true );
                                    break;
                                case IGNORE_AND_CONTINUE:
                                    break;
//                                case OVERWRITE_AND_CONTINUE:
//                                    break;
                                case RENAME_AND_CONTINUE:
                                    Rdn renamedRdn = dialog.getRdn();
                                   
                                    // apply renamed RDN to the attributes
                                    applyNewRdn( newAttributes, newRdn, renamedRdn );
                                   
                                    // compose new DN
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Rdn getRdn()
    {
        Rdn rdn = dn.getRdn();
        return rdn == null ? new Rdn() : rdn;
    }
View Full Code Here

TOP

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

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.