Examples of LdapDN


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

            if ( modDnRecord.getNewrdnLine() != null && modDnRecord.getDeloldrdnLine() != null )
            {
                String newRdn = modDnRecord.getNewrdnLine().getValueAsString();
                boolean deleteOldRdn = modDnRecord.getDeloldrdnLine().isDeleteOldRdn();

                LdapDN newDn;
                if ( modDnRecord.getNewsuperiorLine() != null )
                {
                    newDn = DnUtils.composeDn( newRdn, modDnRecord.getNewsuperiorLine().getValueAsString() );
                }
                else
                {
                    LdapDN dnObject = new LdapDN( dn );
                    LdapDN parent = DnUtils.getParent( dnObject );
                    newDn = DnUtils.composeDn( newRdn, parent.getUpName() );
                }

                browserConnection.getConnection().getJNDIConnectionWrapper().renameEntry( dn, newDn.toString(),
                    deleteOldRdn, getControls( modDnRecord ), monitor, null );
            }
View Full Code Here

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

     * @param monitor the progress monitor
     */
    public static void reloadSchema( boolean forceReload, IBrowserConnection browserConnection,
        StudioProgressMonitor monitor )
    {
        LdapDN schemaLocation = getSchemaLocation( browserConnection, monitor );
        if ( schemaLocation == null )
        {
            monitor.reportError( BrowserCoreMessages.model__missing_schema_location );
            return;
        }
View Full Code Here

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

    private static LdapDN getSchemaLocation( IBrowserConnection browserConnection, StudioProgressMonitor monitor )
    {
        try
        {
            SearchParameter sp = new SearchParameter();
            sp.setSearchBase( new LdapDN() );
            sp.setScope( SearchScope.OBJECT );
            sp.setReturningAttributes( new String[]
                { SchemaConstants.SUBSCHEMA_SUBENTRY_AT } );
            NamingEnumeration<SearchResult> enumeration = SearchRunnable.search( browserConnection, sp, monitor );
            while ( enumeration != null && enumeration.hasMore() )
            {
                SearchResult sr = enumeration.next();
                NamingEnumeration<? extends Attribute> attributes = sr.getAttributes().getAll();
                while ( attributes.hasMore() )
                {
                    Attribute attribute = attributes.next();
                    if ( attribute.getID().equalsIgnoreCase( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ) )
                    {
                        String value = ( String ) attribute.get();
                        if ( LdapDN.isValid( value ) )
                        {
                            LdapDN dn = new LdapDN( value );
                            return dn;
                        }
                    }
                }
            }
View Full Code Here

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

        monitor.beginTask( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__rename_entry_task, new String[]
            { oldEntry.getDn().getUpName() } ), 3 );
        monitor.reportProgress( " " ); //$NON-NLS-1$
        monitor.worked( 1 );

        LdapDN oldDn = oldEntry.getDn();
        LdapDN parentDn = DnUtils.getParent( oldDn );
        LdapDN newDn = DnUtils.composeDn( newRdn, parentDn );

        // use a dummy monitor to be able to handle exceptions
        StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );

        // try to rename entry
View Full Code Here

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

     */
    public LdapDN getBaseDN()
    {
        try
        {
            return new LdapDN( connection.getConnectionParameter().getExtendedProperty( CONNECTION_PARAMETER_BASE_DN ) );
        }
        catch ( InvalidNameException e )
        {
            return null;
        }
View Full Code Here

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

     * @throws LdapURLEncodingException
     */
    private static DsmlDecorator convertSearchResultToDsml( SearchResult searchResult, SearchParameter searchParameter )
        throws InvalidAttributeIdentifierException, InvalidNameException, LdapURLEncodingException
    {
        Entry entry = AttributeUtils.toClientEntry( searchResult.getAttributes(), new LdapDN( searchResult
            .getNameInNamespace() ) );

        if ( isReferral( entry ) )
        {
            // The search result is a referral
View Full Code Here

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

     */
    private AddRequestDsml convertToAddRequestDsml( SearchResult searchResult )
        throws InvalidAttributeIdentifierException, InvalidNameException
    {
        AddRequestDsml ar = new AddRequestDsml();
        Entry entry = AttributeUtils.toClientEntry( searchResult.getAttributes(), new LdapDN( searchResult
            .getNameInNamespace() ) );
        ar.setEntry( entry );

        return ar;
    }
View Full Code Here

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

        }

        if ( search.getBrowserConnection() != null )
        {
            IBrowserConnection browserConnection = search.getBrowserConnection();
            LdapDN searchBase = search.getSearchBase();

            if ( browserConnectionWidget != null )
            {
                browserConnectionWidget.setBrowserConnection( browserConnection );
            }
View Full Code Here

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

    {
        Object value = getValue();
        if ( value != null && value instanceof DnValueEditorRawValueWrapper )
        {
            DnValueEditorRawValueWrapper wrapper = ( DnValueEditorRawValueWrapper ) value;
            LdapDN dn;
            try
            {
                dn = wrapper.dn != null ? new LdapDN( wrapper.dn ) : null;
            }
            catch ( InvalidNameException e )
            {
                dn = null;
            }
View Full Code Here

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

        // 1st: add base DNs, either the specified or from the namingContexts attribute
        if ( !browserConnection.isFetchBaseDNs() && browserConnection.getBaseDN() != null
            && !"".equals( browserConnection.getBaseDN().toString() ) )
        {
            // only add the specified base DN
            LdapDN dn = browserConnection.getBaseDN();
            IEntry entry = browserConnection.getEntryFromCache( dn );
            if ( entry == null )
            {
                entry = new BaseDNEntry( ( LdapDN ) dn.clone(), browserConnection );
                browserConnection.cacheEntry( entry );
            }
            rootDseEntries.put( dn, entry );
        }
        else
        {
            // get base DNs from namingContexts attribute
            Set<String> namingContextSet = new HashSet<String>();
            IAttribute attribute = browserConnection.getRootDSE().getAttribute( SchemaConstants.NAMING_CONTEXTS_AT );
            if ( attribute != null )
            {
                String[] values = attribute.getStringValues();
                for ( int i = 0; i < values.length; i++ )
                {
                    namingContextSet.add( values[i] );
                }
            }

            if ( !namingContextSet.isEmpty() )
            {
                for ( String namingContext : namingContextSet )
                {
                    if ( namingContext.length() > 0 && namingContext.charAt( namingContext.length() - 1 ) == '\u0000' )
                    {
                        namingContext = namingContext.substring( 0, namingContext.length() - 1 );
                    }

                    if ( !"".equals( namingContext ) ) //$NON-NLS-1$
                    {
                        try
                        {
                            LdapDN dn = new LdapDN( namingContext );
                            IEntry entry = browserConnection.getEntryFromCache( dn );
                            if ( entry == null )
                            {
                                entry = new BaseDNEntry( dn, browserConnection );
                                browserConnection.cacheEntry( entry );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.