Package org.apache.directory.api.ldap.model.csn

Examples of org.apache.directory.api.ldap.model.csn.Csn


    @Test
    public void testCSNNoReplica()
    {
        try
        {
            new Csn( "20010101000000.000000Z#000001##000001" );
            fail();
        }
        catch ( InvalidCSNException ice )
        {
            assertTrue( true );
View Full Code Here


    @Test
    public void testCSNInvalidReplica()
    {
        try
        {
            new Csn( "20010101000000.000000Z#000001#a12-b3é#000001" );
            fail();
        }
        catch ( InvalidCSNException ice )
        {
            assertTrue( true );
View Full Code Here

    @Test
    public void testCSNNoOpNumber()
    {
        try
        {
            new Csn( "20010101000000.000000Z#000000#abc" );
            fail();
        }
        catch ( InvalidCSNException ice )
        {
            assertTrue( true );
        }

        try
        {
            new Csn( "20010101000000.000000Z#000000#abc#  " );
            fail();
        }
        catch ( InvalidCSNException ice )
        {
            assertTrue( true );
View Full Code Here

    @Test
    public void testCSNInvalidOpNumber()
    {
        try
        {
            new Csn( "20010101000000.000000Z#000000#abc#000zzz" );
            fail();
        }
        catch ( InvalidCSNException ice )
        {
            assertTrue( true );
        }

        try
        {
            new Csn( "20010101000000.000000Z#000000#abc#00000" );
            fail();
        }
        catch ( InvalidCSNException ice )
        {
            assertTrue( true );
        }

        try
        {
            new Csn( "20010101000000.000000Z#000000#abc#" );
            fail();
        }
        catch ( InvalidCSNException ice )
        {
            assertTrue( true );
        }

        try
        {
            new Csn( "20010101000000.000000Z#000000#abc#00000G" );
            fail();
        }
        catch ( InvalidCSNException ice )
        {
            assertTrue( true );
View Full Code Here


    @Test
    public void testCSNToBytes()
    {
        Csn csn = new Csn( "20010101000000.000000Z#000000#abc#000001" );

        byte[] bytes = csn.getBytes();

        byte[] expected = new byte[]
            {
                '2', '0', '0', '1', '0', '1', '0', '1',
                '0', '0', '0', '0', '0', '0', '.', '0',
                '0', '0', '0', '0', '0', 'Z', '#', '0',
                '0', '0', '0', '0', '0', '#', 'a', 'b',
                'c', '#', '0', '0', '0', '0', '0', '1'
        };

        assertTrue( Arrays.equals( expected, bytes ) );

        Csn deserializedCSN = new Csn( bytes );
        assertEquals( csn, deserializedCSN );
    }
View Full Code Here

                return;
            }
           
            if ( config.isMmrMode() )
            {
                Csn localCsn = new Csn( localEntry.get( SchemaConstants.ENTRY_CSN_AT ).getString() );
                Csn remoteCsn = new Csn( remoteEntry.get( SchemaConstants.ENTRY_CSN_AT ).getString() );
               
                if ( localCsn.compareTo( remoteCsn ) >= 0 )
                {
                    // just discard the received modified entry, that is old
                    LOG.debug( "local modification is latest, discarding the modDn operation dn {}", remoteEntry.getDn() );
View Full Code Here

       
        Entry localEntry = session.getDirectoryService().getOperationManager().lookup( lookupCtx );

        if ( config.isMmrMode() )
        {
            Csn localCsn = new Csn( localEntry.get( SchemaConstants.ENTRY_CSN_AT ).getString() );
            Csn remoteCsn = new Csn( remoteEntry.get( SchemaConstants.ENTRY_CSN_AT ).getString() );
           
            if ( localCsn.compareTo( remoteCsn ) >= 0 )
            {
                // just discard the received modified entry, that is old
                LOG.debug( "local modification is latest, discarding the modification of dn {}", remoteEntry.getDn() );
View Full Code Here

                return;
            }

            if ( config.isMmrMode() )
            {
                Csn localCsn = new Csn( localEntry.get( SchemaConstants.ENTRY_CSN_AT ).getString() );
                Csn remoteCsn = new Csn( remoteEntry.get( SchemaConstants.ENTRY_CSN_AT ).getString() );

                if ( localCsn.compareTo( remoteCsn ) >= 0 )
                {
                    // just discard the received modified entry, that is old
                    CONSUMER_LOG.debug( "local modification is latest, discarding the modDn operation dn {}",
View Full Code Here

        Entry localEntry = session.getDirectoryService().getOperationManager().lookup( lookupCtx );

        if ( config.isMmrMode() )
        {
            Csn localCsn = new Csn( localEntry.get( SchemaConstants.ENTRY_CSN_AT ).getString() );
            Csn remoteCsn = new Csn( remoteEntry.get( SchemaConstants.ENTRY_CSN_AT ).getString() );

            if ( localCsn.compareTo( remoteCsn ) >= 0 )
            {
                // just discard the received modified entry, that is old
                CONSUMER_LOG.debug( "local modification is latest, discarding the modification of dn {}", remoteEntry.getDn() );
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.csn.Csn

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.