Package org.apache.directory.shared.ldap.ldif

Examples of org.apache.directory.shared.ldap.ldif.LdifEntry


            opRevision = revision.incrementAndGet();
           
            // Store the added entry
            ServerEntry addEntry = opContext.getEntry();

            LdifEntry ldif = new LdifEntry();
            ldif.setChangeType( ChangeType.Add );
            ldif.setDn( opContext.getDn() );

            Set<AttributeType> list = addEntry.getAttributeTypes();
           
            for ( AttributeType attributeType:list )
            {
                ldif.addAttribute( ((ServerAttribute)addEntry.get( attributeType) ).toClientAttribute() );
            }
           
            log( opRevision, ldif );
        }
View Full Code Here


        if ( journalEnabled )
        {
            opRevision = revision.incrementAndGet();
           
            // Store the deleted entry
            LdifEntry ldif = new LdifEntry();
            ldif.setChangeType( ChangeType.Delete );
            ldif.setDn( opContext.getDn() );
           
            journal.log( getPrincipal(), opRevision, ldif );
        }

        try
View Full Code Here

        if ( journalEnabled )
        {
            opRevision = revision.incrementAndGet();
           
            // Store the modified entry
            LdifEntry ldif = new LdifEntry();
            ldif.setChangeType( ChangeType.Modify );
            ldif.setDn( opContext.getDn() );
           
            // Store the modifications
            for ( Modification modification:opContext.getModItems() )
            {
                ldif.addModificationItem( modification );
            }
           
            journal.log( getPrincipal(), opRevision, ldif );
        }
       
View Full Code Here

        if ( journalEnabled )
        {
            opRevision = revision.incrementAndGet();
           
            // Store the renamed entry
            LdifEntry ldif = new LdifEntry();
            ldif.setChangeType( ChangeType.ModRdn );
            ldif.setDn( opContext.getDn() );
            ldif.setNewRdn( opContext.getNewRdn().toString() );
            ldif.setDeleteOldRdn( opContext.getDelOldDn() );
           
            journal.log( getPrincipal(), opRevision, ldif );
        }
       
        try
View Full Code Here

        if ( journalEnabled )
        {
            opRevision = revision.incrementAndGet();
           
            // Store the renamed entry
            LdifEntry ldif = new LdifEntry();
            ldif.setChangeType( ChangeType.ModDn );
            ldif.setDn( opContext.getDn() );
            ldif.setNewRdn( opContext.getNewRdn().toString() );
            ldif.setDeleteOldRdn( opContext.getDelOldDn() );
            ldif.setNewSuperior( opContext.getNewDn().getNormName() );
           
            journal.log( getPrincipal(), opRevision, ldif );
        }
       
        try
View Full Code Here

        if ( journalEnabled )
        {
            opRevision = revision.incrementAndGet();
           
            // Store the moved entry
            LdifEntry ldif = new LdifEntry();
            ldif.setChangeType( ChangeType.ModDn );
            ldif.setDn( opContext.getDn() );
            ldif.setNewSuperior( opContext.getParent().getNormName() );
           
            journal.log( getPrincipal(), opRevision, ldif );
        }
       
        try
View Full Code Here

                List<LdifEntry> entries = ldifReader.parseLdifFile( ldifFile.getAbsolutePath() );

                if ( entries != null && !entries.isEmpty() )
                {
                    // this ldif will have only one entry
                    LdifEntry ldifEntry = entries.get( 0 );
                    LOG.debug( "adding entry {}", ldifEntry );

                    ServerEntry serverEntry = new DefaultServerEntry( schemaManager, ldifEntry.getEntry() );

                    // call add on the wrapped store not on the self 
                    wrappedStore.add( serverEntry );
                }
            }
View Full Code Here

                ldifReader.close();

                if ( ( ldifEntries != null ) && !ldifEntries.isEmpty() )
                {
                    // this ldif will have only one entry
                    LdifEntry ldifEntry = ldifEntries.get( 0 );
                    LOG.debug( "Adding entry {}", ldifEntry );

                    ServerEntry serverEntry = new DefaultServerEntry( schemaManager, ldifEntry.getEntry() );

                    if ( !serverEntry.containsAttribute( SchemaConstants.ENTRY_CSN_AT ) )
                    {
                        serverEntry.put( SchemaConstants.ENTRY_CSN_AT, defaultCSNFactory.newInstance().toString() );
                    }
View Full Code Here

     * @throws NamingException if there are problems
     */
    @Test
    public void testNoDeleteOnAdminByNonAdmin() throws Exception
    {
        LdifEntry akarasulu = getUserAddLdif();

        service.getAdminSession().add(
            new DefaultServerEntry( service.getSchemaManager(), akarasulu.getEntry() ) );

        try
        {
            service.getAdminSession().delete( new DN( "uid=admin,ou=system") );
            fail( "User 'admin' should not be able to delete his account" );
View Full Code Here

     * @throws NamingException if there are problems
     */
    @Test
    public void testNoRdnChangesOnAdminByNonAdmin() throws Exception
    {
        LdifEntry akarasulu = getUserAddLdif();

        service.getAdminSession().add(
            new DefaultServerEntry( service.getSchemaManager(), akarasulu.getEntry() ) );

        try
        {
            service.getAdminSession().rename(
                new DN( "uid=admin,ou=system" ),
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.ldif.LdifEntry

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.