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

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


    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


                        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

    {
        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
    {
        DN dn = null;
        if ( sr.isRelative() )
        {
            Name name = ( Name ) context.getNameParser().parse( base ).clone();
            Name rdnName = context.getNameParser().parse( unescapeJndiName( sr.getName() ) );
            name.addAll( rdnName );
            dn = new DN( name.toString() );
        }
        else
        {
            URL url = new URL( sr.getName() );
            dn = url.getDn();
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

            {
                monitor.reportProgress( BrowserCoreMessages.model__setting_base_dn );
                if ( !this.connectionParameter.isFetchBaseDNs() )
                {
                    this.baseDNEntries = new BaseDNEntry[1];
                    this.baseDNEntries[0] = new BaseDNEntry( new DN( this.connectionParameter.getBaseDN() ), this );
                    this.cacheEntry( this.baseDNEntries[0] );
                }
            }
            catch ( ModelModificationException mme )
            {
                monitor.reportError( BrowserCoreMessages.model__error_setting_base_dn, mme );
            }

            try
            {
                this.loadDirectoryMetadataEntries();
            }
            catch ( ModelModificationException mme )
            {
                monitor.reportError( BrowserCoreMessages.model__error_setting_metadata, mme );
            }

            try
            {
                monitor.reportProgress( BrowserCoreMessages.model__loading_schema );

                // check if schema is cached
                if ( this.schema == Schema.DEFAULT_SCHEMA )
                {
                    this.loadSchema( monitor );
                }
                else
                {
                    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( ISearch.FILTER_TRUE );
                        sp.setScope( ISearch.SCOPE_OBJECT );
                        sp.setReturningAttributes( new String[]
                            { IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP,
View Full Code Here

    {
        this.rootDSE = new RootDSE( this );
        this.cacheEntry( this.rootDSE );

        // First get ALL attributes
        ISearch search = new Search( null, this, new DN(), ISearch.FILTER_TRUE, null, ISearch.SCOPE_OBJECT, 0, 0,
            IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
        this.search( search, monitor );

        // Second get well-known root DSE attributes
        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 );
        this.search( search, monitor );

        // Set base DNs from root DSE
        if ( this.rootDSE != null )
        {
            try
            {
                List baseDnEntryList = new ArrayList();
                String[] baseDnAttributeNames = new String[]
                    { IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS };
                for ( int x = 0; x < baseDnAttributeNames.length; x++ )
                {
                    IAttribute attribute = this.rootDSE.getAttribute( baseDnAttributeNames[x] );
                    if ( attribute != null )
                    {
                        String[] values = attribute.getStringValues();
                        for ( int i = 0; i < values.length; i++ )
                        {
                            if ( !"".equals( values[i] ) ) { //$NON-NLS-1$
                                baseDnEntryList.add( values[i] );
                            }
                        }
                    }
                }
                this.baseDNEntries = new BaseDNEntry[baseDnEntryList.size()];
                for ( int i = 0; i < this.baseDNEntries.length; i++ )
                {
                    this.baseDNEntries[i] = new BaseDNEntry( new DN( ( String ) baseDnEntryList.get( i ) ), this );
                    this.cacheEntry( this.baseDNEntries[i] );
                }

                // this.loadDirectoryMetadataEntries();
            }
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

            // System.out.println(this.rootDSE.getAttribute(IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY));

            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( ISearch.FILTER_TRUE );
                sp.setScope( ISearch.SCOPE_OBJECT );
                sp.setReturningAttributes( new String[]
                    { Schema.SCHEMA_ATTRIBUTE_OBJECTCLASSES, Schema.SCHEMA_ATTRIBUTE_ATTRIBUTETYPES,
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

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.