Package org.apache.directory.ldapstudio.browser.core.model

Examples of org.apache.directory.ldapstudio.browser.core.model.DN


    {
        IEntry entry = null;

        // build tree to parent
        LinkedList parentDnList = new LinkedList();
        DN parentDN = dn;
        while ( parentDN != null && connection.getEntryFromCache( parentDN ) == null )
        {
            parentDnList.addFirst( parentDN );
            parentDN = parentDN.getParentDn();
        }
        for ( Iterator it = parentDnList.iterator(); it.hasNext(); )
        {
            DN aDN = ( DN ) it.next();
            if ( aDN.getParentDn() == null )
            {
                entry = new BaseDNEntry( aDN, connection );
                connection.cacheEntry( entry );
            }
            else if ( connection.getEntryFromCache( aDN.getParentDn() ) != null )
            {
                IEntry parentEntry = connection.getEntryFromCache( aDN.getParentDn() );
                entry = new Entry( parentEntry, aDN.getRdn() );
                entry.setDirectoryEntry( true );

                parentEntry.addChild( entry );
                // parentEntry.setAttributesInitialized(false, this);
View Full Code Here


    public static DN getDn( SearchResult sr, String base, JNDIConnectionContext context ) throws NamingException,
        NameException, NoSuchFieldException
    {
        String dn = sr.getNameInNamespace();
        dn = unescapeJndiName( dn );
        return new DN( dn );
    }
View Full Code Here

    private void parseSchemaRecord( LdifContentRecord schemaRecord ) throws Exception
    {

        this.setSchemaRecord( schemaRecord );
        this.setDn( new DN( schemaRecord.getDnLine().getValueAsString() ) );

        LdifAttrValLine[] lines = schemaRecord.getAttrVals();
        for ( int i = 0; i < lines.length; i++ )
        {
            LdifAttrValLine line = lines[i];
View Full Code Here

                    try
                    {
                        this.applyModificationAndLog( record, monitor );

                        // update cache and adjust attribute/children initialization flags
                        DN dn = new DN( record.getDnLine().getValueAsString() );
                        IEntry entry = connection.getEntryFromCache( dn );
                        DN parentDn = dn.getParentDn();
                        IEntry parentEntry = parentDn != null ? connection.getEntryFromCache( dn.getParentDn() ) : null;

                        if ( record instanceof LdifChangeDeleteRecord )
                        {
                            if ( entry != null )
                            {
                                entry.setAttributesInitialized( false );
                                connection.uncacheEntry( entry );
                            }
                            if ( parentEntry != null )
                            {
                                parentEntry.setChildrenInitialized( false );
                            }
                        }
                        else if ( record instanceof LdifChangeModDnRecord )
                        {
                            if ( entry != null )
                            {
                                entry.setAttributesInitialized( false );
                                connection.uncacheEntry( entry );
                            }
                            if ( parentEntry != null )
                            {
                                parentEntry.setChildrenInitialized( false );
                            }
                            LdifChangeModDnRecord modDnRecord = ( LdifChangeModDnRecord ) record;
                            if ( modDnRecord.getNewsuperiorLine() != null )
                            {
                                DN newSuperiorDn = new DN( modDnRecord.getNewsuperiorLine().getValueAsString() );
                                IEntry newSuperiorEntry = connection.getEntryFromCache( newSuperiorDn );
                                if ( newSuperiorEntry != null )
                                {
                                    newSuperiorEntry.setChildrenInitialized( false );
                                }
View Full Code Here

                    dummyEntry = ModelConverter.ldifChangeAddRecordToEntry( ( LdifChangeAddRecord ) containers[0],
                        dummyConnection );
                }
                else if ( containers[0] instanceof LdifChangeModifyRecord )
                {
                    dummyEntry = new DummyEntry( new DN(), dummyConnection );
                }

                AttributeWizard wizard = new AttributeWizard( "Edit Attribute Description", true, false,
                    attributeDescription, dummyEntry );
                WizardDialog dialog = new WizardDialog( Display.getDefault().getActiveShell(), wizard );
View Full Code Here

    }


    public DN getBaseDN()
    {
        return new DN();
    }
View Full Code Here

        for ( int i = 0; i < oldEntries.length; i++ )
        {

            IEntry oldEntry = oldEntries[i];
            IEntry oldParent = oldEntry.getParententry();
            DN newDn = new DN( oldEntry.getRdn(), newParent.getDn() );

            // move in directory
            // TODO: use manual/simulated move, if move of subtree is not
            // supported
            int errorStatusSize1 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$
View Full Code Here

    private IEntry dummyEntry;


    public AttributeComparator( IConnection connection )
    {
        this.dummyEntry = new DummyEntry( new DN(), connection );
    }
View Full Code Here

            return null;
        }
        else if ( attributeHierarchy.size() == 1 && attributeHierarchy.getAttribute().getValueSize() == 0 )
        {
            IConnection connection = attributeHierarchy.getAttribute().getEntry().getConnection();
            DN dn = null;
            return new DnValueEditorRawValueWrapper( connection, dn );
        }
        else if ( attributeHierarchy.size() == 1 && attributeHierarchy.getAttribute().getValueSize() == 1 )
        {
            IConnection connection = attributeHierarchy.getAttribute().getEntry().getConnection();
            try
            {
                DN dn = new DN( getDisplayValue( attributeHierarchy ) );
                return new DnValueEditorRawValueWrapper( connection, dn );
            }
            catch ( NameException e )
            {
                return new DnValueEditorRawValueWrapper( connection, null );
View Full Code Here

        if ( o != null && o instanceof String )
        {
            IConnection connection = value.getAttribute().getEntry().getConnection();
            try
            {
                DN dn = new DN( ( String ) o );
                return new DnValueEditorRawValueWrapper( connection, dn );
            }
            catch ( NameException e )
            {
                return new DnValueEditorRawValueWrapper( connection, null );
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.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.