Package org.apache.directory.shared.asn1.util

Examples of org.apache.directory.shared.asn1.util.OID


     */
    public ExtendedResponse extended( String oid, byte[] value ) throws LdapException
    {
        try
        {
            return extended( new Oid( oid ), value );
        }
        catch ( DecoderException e )
        {
            String msg = "Failed to decode the OID " + oid;
            LOG.error( msg );
View Full Code Here


     */
    public ExtendedResponse extended( String oid, byte[] value ) throws LdapException
    {
        try
        {
            return extended( new Oid( oid ), value );
        }
        catch ( DecoderException e )
        {
            String msg = "Failed to decode the OID " + oid;
            LOG.error( msg );
View Full Code Here

     */
    public ExtendedResponse extended( String oid, byte[] value ) throws LdapException
    {
        try
        {
            return extended( new Oid( oid ), value );
        }
        catch ( DecoderException e )
        {
            String msg = "Failed to decode the OID " + oid;
            LOG.error( msg );
View Full Code Here

            LOG.error( msg );
            throw new DecoderException( msg );
        }
        else
        {
            extendedResponse.setResponseName( new Oid( Strings.asciiBytesToString( tlv.getValue().getData() ) )
                .toString() );
        }

        // We can have an END transition
        container.setGrammarEndAllowed( true );
View Full Code Here

     */
    public ExtendedResponse extended( String oid, byte[] value ) throws LdapException
    {
        try
        {
            return extended( new Oid( oid ), value );
        }
        catch ( DecoderException e )
        {
            String msg = "Failed to decode the OID " + oid;
            LOG.error( msg );
View Full Code Here

            LOG.error( msg );
            throw new DecoderException( msg );
        }
        else
        {
            String responseName = new Oid( Strings.asciiBytesToString( tlv.getValue().getData() ) )
                .toString();

            extendedResponse = LdapApiServiceFactory.getSingleton().newExtendedResponse( responseName,
                container.getMessageId(), null );
            container.setMessage( LdapApiServiceFactory.getSingleton().decorate( extendedResponse ) );
View Full Code Here

     */
    public ExtendedResponse extended( String oid, byte[] value ) throws LdapException
    {
        try
        {
            return extended( new Oid( oid ), value );
        }
        catch ( DecoderException e )
        {
            String msg = "Failed to decode the OID " + oid;
            LOG.error( msg );
View Full Code Here

     */
    public ExtendedResponse extended( String oid, byte[] value ) throws LdapException
    {
        try
        {
            return extended( new Oid( oid ), value );
        }
        catch ( DecoderException e )
        {
            String msg = "Failed to decode the OID " + oid;
            LOG.error( msg );
View Full Code Here

     */
    @Test
    public void testOidJointIsoItuT()
    {

        Oid oid = new Oid();

        try
        {

            // joint-iso-itu-t(2), presentation(0)
            oid.setOid( new byte[]
                { 80 + 0 } );
            assertEquals( "2.0", oid.toString() );

            // joint-iso-itu-t(2), asn1(1)
            oid.setOid( new byte[]
                { 80 + 1 } );
            assertEquals( "2.1", oid.toString() );

            // joint-iso-itu-t(2), association-control(2)
            oid.setOid( new byte[]
                { 80 + 2 } );
            assertEquals( "2.2", oid.toString() );

            // joint-iso-itu-t(2), reliable-transfer(3)
            oid.setOid( new byte[]
                { 80 + 3 } );
            assertEquals( "2.3", oid.toString() );

            // ...
            // joint-iso-itu-t(2), upu(40)
            oid.setOid( new byte[]
                { 80 + 40 } );
            assertEquals( "2.40", oid.toString() );

            // ...
            // joint-iso-itu-t(2), xxx(100)
            oid.setOid( new byte[]
                { ( byte ) ( 0x81 ), 0x34 } );
            assertEquals( "2.100", oid.toString() );
        }
        catch ( DecoderException de )
        {
            fail();
        }
View Full Code Here

     */
    @Test
    public void testOidStringGood()
    {

        Oid oid = new Oid();

        try
        {
            oid.setOid( "0.0" );
            assertEquals( "0.0", oid.toString() );

            oid.setOid( "0.0.0.0.0" );
            assertEquals( "0.0.0.0.0", oid.toString() );

            oid.setOid( "0.1.2.3.4" );
            assertEquals( "0.1.2.3.4", oid.toString() );

            oid.setOid( "2.123456" );
            assertEquals( "2.123456", oid.toString() );

            oid.setOid( "1.2.840.113554.1.2.2" );
            assertEquals( "1.2.840.113554.1.2.2", oid.toString() );
        }
        catch ( DecoderException de )
        {
            fail();
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.asn1.util.OID

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.