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

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


                        if ( readIn.available() > 1 && connection != null )
                        {
                            int size = readIn.readInt();
                            byte[] dn = new byte[size];
                            readIn.read( dn );
                            entry = connection.getEntryFromCache( new DN( new String( dn ) ) );
                        }
                        else
                        {
                            return null;
                        }
View Full Code Here


    transient ConnectionSearchHandler searchHandler;


    public Connection()
    {
        this( null, null, 0, 0, true, new DN(), 0, 0, IConnection.DEREFERENCE_ALIASES_NEVER,
            IConnection.HANDLE_REFERRALS_IGNORE, IConnection.AUTH_ANONYMOUS, null, null );
    }
View Full Code Here

                {
                    if ( this.rootDSE.getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY ) != null )
                    {
                        // check if schema is up-to-date
                        SearchParameter sp = new SearchParameter();
                        sp.setSearchBase( new DN( this.rootDSE.getAttribute(
                            IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY ).getStringValue() ) );
                        sp.setFilter( Schema.SCHEMA_FILTER );
                        sp.setScope( ISearch.SCOPE_OBJECT );
                        sp.setReturningAttributes( new String[]
                            { IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP,
View Full Code Here

            rootDSE = new RootDSE( this );
            cacheEntry( rootDSE );
        }

        // get well-known root DSE attributes, includes + and *
        ISearch search = new Search( null, this, new DN(), ISearch.FILTER_TRUE, ROOT_DSE_ATTRIBUTES, ISearch.SCOPE_OBJECT, 0,
            0, IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
        search( search, monitor );

        // get base DNs
        if( !isFetchBaseDNs() && getBaseDN() != null && !"".equals( getBaseDN().toString() ))
        {
            // only add the specified base DN
            DN dn = getBaseDN();
            IEntry entry = new BaseDNEntry( new DN( dn ), this );
            cacheEntry( entry );
            rootDSE.addChild( entry );
           
            // check if entry exists
            search = new Search( null, this, dn, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, ISearch.SCOPE_OBJECT, 1, 0,
                IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, true, true, null );
            search( search, monitor );
        }
        else
        {
            // get naming contexts
            Set<String> namingContextSet = new HashSet<String>();
            IAttribute attribute = rootDSE.getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS );
            if ( attribute != null )
            {
                String[] values = attribute.getStringValues();
                for ( int i = 0; i < values.length; i++ )
                {
                    namingContextSet.add( values[i] );
                }
            }
            for ( String namingContext : namingContextSet )
            {
                if ( !"".equals( namingContext ) ) { //$NON-NLS-1$
                    try
                    {
                        IEntry entry = new BaseDNEntry( new DN( namingContext ), this );
                        rootDSE.addChild( entry );
                        cacheEntry( entry );
                    }
                    catch ( Exception e )
                    {
                        monitor.reportError( BrowserCoreMessages.model__error_setting_base_dn, e );
                    }
                }
                else
                {
                    // special handling of empty namingContext: perform a one-level search and add all result DNs to the set
                    search = new Search( null, this, new DN(), ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, ISearch.SCOPE_ONELEVEL, 0,
                        0, IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
                    search( search, monitor );
                    ISearchResult[] results = search.getSearchResults();
                    for ( int k = 0; results != null && k < results.length; k++ )
                    {
View Full Code Here

            String[] values = attribute.getStringValues();
            for ( int i = 0; i < values.length; i++ )
            {
                try
                {
                    metadataEntryList.add( new DN( values[i] ) );
                }
                catch ( NameException e )
                {
                }
            }
View Full Code Here

        {

            if ( this.rootDSE.getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY ) != null )
            {
                SearchParameter sp = new SearchParameter();
                sp.setSearchBase( new DN( this.rootDSE.getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY )
                    .getStringValue() ) );
                sp.setFilter( Schema.SCHEMA_FILTER );
                sp.setScope( ISearch.SCOPE_OBJECT );
                sp.setReturningAttributes( new String[]
                    { Schema.SCHEMA_ATTRIBUTE_OBJECTCLASSES, Schema.SCHEMA_ATTRIBUTE_ATTRIBUTETYPES,
View Full Code Here

            { this.oldEntry.getDn().toString() } ), 3 );
        monitor.reportProgress( " " ); //$NON-NLS-1$
        monitor.worked( 1 );

        IEntry parent = oldEntry.getParententry();
        DN newDn = new DN( newRdn, parent.getDn() );

        // rename in directory
        // TODO: use manual/simulated rename, if rename of subtree is not
        // supported
        connection.rename( oldEntry, newDn, deleteOldRdn, monitor );
View Full Code Here

    }


    public DN getDn()
    {
        DN dn = new DN( new RDN( this.rdn ), this.parent.getDn() );
        return dn;
    }
View Full Code Here

    {
        LdifPart[] parts = ldifRecord.getParts();

        EventRegistry.suspendEventFireingInCurrentThread();

        DummyEntry entry = new DummyEntry( new DN( ldifRecord.getDnLine().getValueAsString() ), connection );

        for ( int i = 0; i < parts.length; i++ )
        {
            if ( parts[i] instanceof LdifAttrValLine )
            {
View Full Code Here

                        LdifContainer container = enumeration.next( monitor );
                        if ( container instanceof LdifContentRecord )
                        {

                            LdifContentRecord record = ( LdifContentRecord ) container;
                            DN dn = new DN( record.getDnLine().getValueAsString() );

                            // get entry from cache or create it
                            IEntry entry = connection.getEntryFromCache( dn );
                            if ( entry == 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.