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

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


        if ( baseDNCombo != null && baseDNCombo.isVisible() )
        {
            try
            {
                new DN( baseDNCombo.getText() );
            }
            catch ( NameException e )
            {
                message = "Please enter a valid base DN.";
            }
View Full Code Here


        {
            Connection conn;
            try
            {
                conn = new Connection( null, getHostName(), getPort(), getEncyrptionMethod(), isAutoFetchBaseDns(),
                    new DN( getBaseDN() ), getCountLimit(), getTimeLimit(), getAliasesDereferencingMethod(),
                    getReferralsHandlingMethod(), IConnection.AUTH_ANONYMOUS, null, null );
            }
            catch ( NameException e )
            {
                conn = null;
            }
            return conn;
        }
        else if ( getAuthenticationMethod() == IConnection.AUTH_SIMPLE )
        {
            Connection conn;
            try
            {
                conn = new Connection( null, getHostName(), getPort(), getEncyrptionMethod(), isAutoFetchBaseDns(),
                    new DN( getBaseDN() ), getCountLimit(), getTimeLimit(), getAliasesDereferencingMethod(),
                    getReferralsHandlingMethod(), IConnection.AUTH_SIMPLE, getSimpleAuthBindPrincipal(),
                    getSimpleAuthBindPassword() );
            }
            catch ( NameException e )
            {
View Full Code Here

    }


    public RootDSE( IConnection connection ) throws ModelModificationException
    {
        super( new DN(), connection );
    }
View Full Code Here

                String newRdn = modDnRecord.getNewrdnLine().getValueAsString();
                boolean deleteOldRdn = modDnRecord.getDeloldrdnLine().isDeleteOldRdn();

                try
                {
                    DN newDn;
                    if ( modDnRecord.getNewsuperiorLine() != null )
                        newDn = new DN( newRdn, modDnRecord.getNewsuperiorLine().getValueAsString() );
                    else
                    {
                        DN dnObject = new DN( dn );
                        newDn = new DN( newRdn.toString(), dnObject.getParentDn().toString() );
                    }

                    try
                    {
                        this.context.rename( dn.toString(), newDn.toString(), deleteOldRdn, getControls( modDnRecord ),
View Full Code Here

            try
            {
                SearchResult sr = ( SearchResult ) enumeration.next();

                DN dn = JNDIUtils.getDn( sr, parameter.getSearchBase().toString(), context );
                LdifContentRecord record = LdifContentRecord.create( dn.toString() );

                NamingEnumeration attributeEnumeration = sr.getAttributes().getAll();
                while ( attributeEnumeration.hasMore() )
                {
                    Attribute attribute = ( Attribute ) attributeEnumeration.next();
View Full Code Here

            String type = memento.getString( "TYPE" );
            if ( "IEntry".equals( type ) )
            {
                IConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
                    memento.getString( "CONNECTION" ) );
                DN dn = new DN( memento.getString( "DN" ) );
                IEntry entry = connection.getEntryFromCache( dn );
                super.setInput( new EntryEditorInput( entry ) );
            }
            else if ( "ISearchResult".equals( type ) )
            {
                IConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
                    memento.getString( "CONNECTION" ) );
                ISearch search = connection.getSearchManager().getSearch( memento.getString( "SEARCH" ) );
                ISearchResult[] searchResults = search.getSearchResults();
                DN dn = new DN( memento.getString( "DN" ) );
                for ( int i = 0; i < searchResults.length; i++ )
                {
                    if ( dn.equals( searchResults[i].getDn() ) )
                    {
                        super.setInput( new EntryEditorInput( searchResults[i] ) );
                        break;
                    }
                }
View Full Code Here

            && getSelectedSearchResults().length == 1 )
        {
            try
            {
                IValue value = getSelectedAttributeHierarchies()[0].getAttribute().getValues()[0];
                if ( value.isString() && new DN( value.getStringValue() ) != null )
                {
                    return new ConnectionAndDn( value.getAttribute().getEntry().getConnection(), new DN( value
                        .getStringValue() ) );
                }
            }
            catch ( NameException e )
            {
                // no valid DN
            }
        }

        if ( getSelectedValues().length == 1 && getSelectedAttributes().length == 0 )
        {
            try
            {
                IValue value = getSelectedValues()[0];
                if ( value.isString() && new DN( value.getStringValue() ) != null )
                {
                    return new ConnectionAndDn( value.getAttribute().getEntry().getConnection(), new DN( value
                        .getStringValue() ) );
                }
            }
            catch ( NameException e )
            {
View Full Code Here

    protected void moveEntries( final IEntry[] entries )
    {
        MoveEntriesDialog moveDialog = new MoveEntriesDialog( getShell(), entries );
        if ( moveDialog.open() == Dialog.OK )
        {
            DN newParentDn = moveDialog.getParentDn();
            if ( newParentDn != null /* && !newRdn.equals(entry.getRdn()) */)
            {
                IEntry newParentEntry = entries[0].getConnection().getEntryFromCache( newParentDn );
                if ( newParentEntry != null )
                {
View Full Code Here

            {
                if ( values[v].isString() )
                {
                    try
                    {
                        DN dn = new DN( values[v].getStringValue() );
                        internalDnSet.add( dn );
                    }
                    catch ( NameException e )
                    {
                    }
                }
            }

            for ( int a = 0; a < attributes.length; a++ )
            {
                IValue[] vals = attributes[a].getValues();
                for ( int v = 0; v < vals.length; v++ )
                {
                    if ( vals[v].isString() )
                    {
                        try
                        {
                            DN dn = new DN( vals[v].getStringValue() );
                            internalDnSet.add( dn );
                        }
                        catch ( NameException e )
                        {
                        }
View Full Code Here

        DummyEntry newEntry = wizard.getPrototypeEntry();

        Subschema subschema = newEntry.getSubschema();
        String[] attributeNames = subschema.getAllAttributeNames();

        DN parentDn = null;
        if ( newEntry.getDn().getParentDn() != null )
        {
            parentDn = newEntry.getDn().getParentDn();
        }
        else if ( wizard.getSelectedEntry() != 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.