Package org.apache.directory.server.core.entry

Examples of org.apache.directory.server.core.entry.ServerEntry


            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );

            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
           
            if ( parentEntry != null )
            {
                // We have found a parent referral for the current DN
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );
   
                if ( directoryService.getReferralManager().isReferral( dn ) )
                {
                    // This is a referral. We can delete it if the ManageDsaIt flag is true
                    // Otherwise, we just throw a LdapReferralException
View Full Code Here


            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            // Check if we have an ancestor for this DN
            ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
           
            if ( parentEntry != null )
            {
                // We have found a parent referral for the current DN
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );
   
                if ( directoryService.getReferralManager().isReferral( dn ) )
                {
                    // This is a referral. We can delete it if the ManageDsaIt flag is true
                    // Otherwise, we just throw a LdapReferralException
View Full Code Here

            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            // Check if we have an ancestor for this DN
            ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
           
            if ( parentEntry != null )
            {
                // We have found a parent referral for the current DN
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );
   
                if ( directoryService.getReferralManager().isReferral( dn ) )
                {
                    // This is a referral. We can delete it if the ManageDsaIt flag is true
                    // Otherwise, we just throw a LdapReferralException
View Full Code Here

            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            // Check if we have an ancestor for this DN
            ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
           
            if ( parentEntry != null )
            {
                // We have found a parent referral for the current DN
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );
   
                if ( directoryService.getReferralManager().isReferral( dn ) )
                {
                    // This is a referral. We can delete it if the ManageDsaIt flag is true
                    // Otherwise, we just throw a LdapReferralException
View Full Code Here

           
            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            // Check if we have an ancestor for this DN
            ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
           
            if ( parentEntry != null )
            {
                // We have found a parent referral for the current DN
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );
   
                if ( directoryService.getReferralManager().isReferral( dn ) )
                {
                    // This is a referral. We can delete it if the ManageDsaIt flag is true
                    // Otherwise, we just throw a LdapReferralException
View Full Code Here

            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            // Check if we have an ancestor for this DN
            ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
           
            if ( parentEntry != null )
            {
                // We have found a parent referral for the current DN
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );
   
                if ( directoryService.getReferralManager().isReferral( dn ) )
                {
                    // This is a referral. We can return it if the ManageDsaIt flag is true
                    // Otherwise, we just throw a LdapReferralException
View Full Code Here

        DN dnRoles = new DN( "ou=Roles,o=MNN,c=WW,ou=system" );
        DN dnGroups = new DN( "ou=Groups,o=MNN,c=WW,ou=system" );
        RDN newRdn = new RDN( "ou=Groups" );

        // First check that the object exists
        ServerEntry renamed = session.lookup( dnRoles );
        assertNotNull( renamed );

        // Also check that the new entry does not exist
        try
        {
View Full Code Here

     */
    public void add( NextInterceptor next, AddOperationContext addContext ) throws Exception
    {
        DN normName = addContext.getDn();

        ServerEntry entry = addContext.getEntry();

        if ( ( entry.get( SchemaConstants.USER_PASSWORD_AT ) != null ) &&
            ( entry.get( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ) != null ) )
        {
            log.debug( "Adding the entry '{}' for DN '{}'.", entry, normName.getName() );

            ServerBinaryValue userPassword = (ServerBinaryValue)entry.get( SchemaConstants.USER_PASSWORD_AT ).get();
            String strUserPassword = userPassword.getString();

            if ( log.isDebugEnabled() )
            {
                StringBuffer sb = new StringBuffer();
                sb.append( "'" + strUserPassword + "' ( " );
                sb.append( userPassword );
                sb.append( " )" );
                log.debug( "Adding Attribute id : 'userPassword',  Values : [ {} ]", sb.toString() );
            }

            Value<?> principalNameValue = entry.get( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ).get();
           
            String principalName = principalNameValue.getString();

            log.debug( "Got principal '{}' with userPassword '{}'.", principalName, strUserPassword );

            Map<EncryptionType, EncryptionKey> keys = generateKeys( principalName, strUserPassword );

            entry.put( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, principalName );
            entry.put( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT, "0" );

            entry.put( getKeyAttribute( addContext.getSession().getDirectoryService().getSchemaManager(), keys ) );

            log.debug( "Adding modified entry '{}' for DN '{}'.", entry, normName
                .getName() );
        }

View Full Code Here

        list.beforeFirst();
       
        while ( list.next() )
        {
            ServerEntry result = list.get();

            String name = null;
            EntryAttribute attribute = result.get( ApacheSchemaConstants.APACHE_CATALOGUE_ENTRY_NAME_AT );
           
            if ( attribute != null )
            {
                name = attribute.getString();
            }
           
            String basedn = null;
            attribute = result.get( ApacheSchemaConstants.APACHE_CATALOGUE_ENTRY_BASE_DN_AT );
           
            if ( attribute != null )
            {
                basedn = attribute.getString();
            }
View Full Code Here

     */
    public void add( NextInterceptor next, AddOperationContext addContext ) throws Exception
    {
        DN normName = addContext.getDn();

        ServerEntry entry = addContext.getEntry();

        log.debug( "Adding the entry '{}' for DN '{}'.", entry, normName.getName() );

        if ( entry.get( SchemaConstants.USER_PASSWORD_AT ) != null )
        {
            String username = null;

            ServerBinaryValue userPassword = (ServerBinaryValue)entry.get( SchemaConstants.USER_PASSWORD_AT ).get();

            // The password is stored in a non H/R attribute, but it's a String
            String strUserPassword = userPassword.getString();

            if ( log.isDebugEnabled() )
            {
                StringBuffer sb = new StringBuffer();
                sb.append( "'" + strUserPassword + "' ( " );
                sb.append( userPassword );
                sb.append( " )" );
                log.debug( "Adding Attribute id : 'userPassword',  Values : [ {} ]", sb.toString() );
            }

            if ( entry.get( SchemaConstants.CN_AT ) != null )
            {
                ServerStringValue attr = (ServerStringValue)entry.get( SchemaConstants.CN_AT ).get();
                username = attr.getString();
            }

            // If userPassword fails checks, throw new NamingException.
            check( username, strUserPassword );
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.entry.ServerEntry

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.