Package org.apache.directory.shared.ldap.extras.extended.ads_impl

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.GracefulShutdown


        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        GracefulShutdown gracefulShutdown = container.getGracefulShutdown();
        assertEquals( 1, gracefulShutdown.getTimeOffline() );
        assertEquals( 1, gracefulShutdown.getDelay() );

        // Check the length
        assertEquals( 0x08, gracefulShutdown.computeLength() );

        // Check the encoding
        try
        {
            ByteBuffer bb1 = gracefulShutdown.encode();

            String encodedPdu = Strings.dumpBytes(bb1.array());

            assertEquals( encodedPdu, decodedPdu );
        }
View Full Code Here


        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        GracefulShutdown gracefulShutdown = container.getGracefulShutdown();
        assertEquals( 1, gracefulShutdown.getTimeOffline() );
        assertEquals( 0, gracefulShutdown.getDelay() );

        // Check the length
        assertEquals( 0x05, gracefulShutdown.computeLength() );

        // Check the encoding
        try
        {
            ByteBuffer bb1 = gracefulShutdown.encode();

            String encodedPdu = Strings.dumpBytes(bb1.array());

            assertEquals( encodedPdu, decodedPdu );
        }
View Full Code Here

        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        GracefulShutdown gracefulShutdown = container.getGracefulShutdown();
        assertEquals( 0, gracefulShutdown.getTimeOffline() );
        assertEquals( 1, gracefulShutdown.getDelay() );

        // Check the length
        assertEquals( 0x05, gracefulShutdown.computeLength() );

        // Check the encoding
        try
        {
            ByteBuffer bb1 = gracefulShutdown.encode();

            String encodedPdu = Strings.dumpBytes(bb1.array());

            assertEquals( encodedPdu, decodedPdu );
        }
View Full Code Here

        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        GracefulShutdown gracefulShutdown = container.getGracefulShutdown();
        assertEquals( 0, gracefulShutdown.getTimeOffline() );
        assertEquals( 0, gracefulShutdown.getDelay() );

        // Check the length
        assertEquals( 0x02, gracefulShutdown.computeLength() );

        // Check the encoding
        try
        {
            ByteBuffer bb1 = gracefulShutdown.encode();

            String encodedPdu = Strings.dumpBytes(bb1.array());

            assertEquals( encodedPdu, decodedPdu );
        }
View Full Code Here

        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        GracefulShutdown gracefulShutdown = container.getGracefulShutdown();
        assertEquals( 0, gracefulShutdown.getTimeOffline() );
        assertEquals( 500, gracefulShutdown.getDelay() );

        // Check the length
        assertEquals( 0x06, gracefulShutdown.computeLength() );

        // Check the encoding
        try
        {
            ByteBuffer bb1 = gracefulShutdown.encode();

            String encodedPdu = Strings.dumpBytes(bb1.array());

            assertEquals( encodedPdu, decodedPdu );
        }
View Full Code Here

        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        GracefulShutdown gracefulShutdown = container.getGracefulShutdown();
        assertEquals( 0, gracefulShutdown.getTimeOffline() );
        assertEquals( 32767, gracefulShutdown.getDelay() );

        // Check the length
        assertEquals( 0x06, gracefulShutdown.computeLength() );

        // Check the encoding
        try
        {
            ByteBuffer bb1 = gracefulShutdown.encode();

            String encodedPdu = Strings.dumpBytes(bb1.array());

            assertEquals( encodedPdu, decodedPdu );
        }
View Full Code Here

        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        GracefulShutdown gracefulShutdown = container.getGracefulShutdown();
        assertEquals( 0, gracefulShutdown.getTimeOffline() );
        assertEquals( 32768, gracefulShutdown.getDelay() );

        // Check the length
        assertEquals( 0x07, gracefulShutdown.computeLength() );

        // Check the encoding
        try
        {
            ByteBuffer bb1 = gracefulShutdown.encode();

            String encodedPdu = Strings.dumpBytes(bb1.array());

            assertEquals( encodedPdu, decodedPdu );
        }
View Full Code Here

    {
        GracefulShutdownDecoder decoder = new GracefulShutdownDecoder();

        try
        {
            GracefulShutdown gs = (GracefulShutdown) decoder.decode( requestValue );

            if ( requestValue != null )
            {
                this.requestValue = new byte[requestValue.length];
                System.arraycopy( requestValue, 0, this.requestValue, 0, requestValue.length );
            }
            else
            {
                this.requestValue = null;
            }

            this.timeOffline = gs.getTimeOffline();
            this.delay = gs.getDelay();
        }
        catch ( DecoderException e )
        {
            LOG.error( I18n.err( I18n.ERR_04165 ), e );
            throw new RuntimeException( e );
View Full Code Here

    {
        if ( requestValue == null )
        {
            try
            {
                GracefulShutdown gs = new GracefulShutdown();
                gs.setDelay( this.delay );
                gs.setTimeOffline( this.timeOffline );
                requestValue = gs.encode().array();
            }
            catch ( EncoderException e )
            {
                LOG.error( I18n.err( I18n.ERR_04164 ), e );
                throw new RuntimeException( e );
View Full Code Here

        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        GracefulShutdown gracefulShutdown = container.getGracefulShutdown();
        assertEquals( 0, gracefulShutdown.getTimeOffline() );
        assertEquals( 32767, gracefulShutdown.getDelay() );

        // Check the length
        assertEquals( 0x06, gracefulShutdown.computeLength() );

        // Check the encoding
        try
        {
            ByteBuffer bb1 = gracefulShutdown.encode();

            String encodedPdu = Strings.dumpBytes(bb1.array());

            assertEquals( encodedPdu, decodedPdu );
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.extras.extended.ads_impl.GracefulShutdown

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.