public void action( LdapMessageContainer<MessageDecorator<? extends Message>> container ) { TLV tlv = container.getCurrentTLV(); // If the length is null, we store an empty value if ( tlv.getLength() == 0 ) { LOG.debug( "No vals for this attribute" ); } // We can have an END transition container.setGrammarEndAllowed( true ); LOG.debug( "Some vals are to be decoded" ); } } );
public void action( IAsn1Container container ) { LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container; TLV tlv = ldapMessageContainer.getCurrentTLV(); // If the length is null, we store an empty value if ( tlv.getLength() == 0 ) { log.debug( "No vals for this attribute" ); } // We can have an END transition ldapMessageContainer.grammarEndAllowed( true ); log.debug( "Some vals are to be decoded" ); } } );
public void action( IAsn1Container container ) throws DecoderException { LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container; TLV tlv = ldapMessageContainer.getCurrentTLV(); if ( tlv.getLength() == 0 ) { log.error( I18n.err( I18n.ERR_04107 ) ); throw new DecoderException( "The substring sequence is empty" ); } } } );
public void action( LdapMessageContainer<MessageDecorator<? extends Message>> container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); if ( tlv.getLength() == 0 ) { LOG.error( I18n.err( I18n.ERR_04107 ) ); throw new DecoderException( "The substring sequence is empty" ); } } } );
public void action( LdapMessageContainer<MessageDecorator<? extends Message>> container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); int expectedLength = tlv.getLength(); // The Length should be null if ( expectedLength == 0 ) { String msg = I18n.err( I18n.ERR_04096 ); LOG.error( msg ); // This will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } } };
public void action( LdapMessageContainer<MessageDecorator<? extends Message>> container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); // The Length should not be null if ( tlv.getLength() == 0 ) { LOG.error( I18n.err( I18n.ERR_04066 ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04067 ) ); } } } );
public void action( IAsn1Container container ) throws DecoderException { LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container; TLV tlv = ldapMessageContainer.getCurrentTLV(); // The Length should not be null if ( tlv.getLength() == 0 ) { log.error( I18n.err( I18n.ERR_04066 ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04067 ) ); } return; } } );
public void action( IAsn1Container container ) throws DecoderException { LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container; TLV tlv = ldapMessageContainer.getCurrentTLV(); int expectedLength = tlv.getLength(); // The Length should be null if ( expectedLength == 0 ) { log.error( I18n.err( I18n.ERR_04096 ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04096 ) ); } } };
public void action( IAsn1Container container ) throws DecoderException { LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container; // Now, we can allocate the CompareResponse Object CompareResponseCodec compareResponse = new CompareResponseCodec(); compareResponse.setMessageId( ldapMessageContainer.getMessageId() ); ldapMessageContainer.setLdapMessage( compareResponse ); // We will check that the request is not null TLV tlv = ldapMessageContainer.getCurrentTLV(); if ( tlv.getLength() == 0 ) { String msg = I18n.err( I18n.ERR_04094 ); log.error( msg ); throw new DecoderException( msg ); } log.debug( "Compare response " ); } } );
public void action( LdapMessageContainer<BindRequestDecorator> container ) throws DecoderException { BindRequest bindRequestMessage = container.getMessage(); TLV tlv = container.getCurrentTLV(); // We will check that the sasl is not null if ( tlv.getLength() == 0 ) { String msg = I18n.err( I18n.ERR_04079 ); LOG.error( msg ); BindResponseImpl response = new BindResponseImpl( bindRequestMessage.getMessageId() ); throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_CREDENTIALS, bindRequestMessage.getName(), null ); } bindRequestMessage.setSimple( false ); if ( IS_DEBUG ) { LOG.debug( "The SaslCredential has been created" ); } } } );
public void action( LdapMessageContainer<MessageDecorator<? extends Message>> container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); // If we have a Referrals sequence, then it should not be empty // sasl credentials if ( tlv.getLength() == 0 ) { String msg = I18n.err( I18n.ERR_04080 ); LOG.error( msg ); // This will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } Message response = container.getMessage(); LdapResult ldapResult = ( ( ResultResponse ) response ).getLdapResult(); Referral referral = new ReferralImpl(); ldapResult.setReferral( referral ); } } );
public void action( IAsn1Container container ) throws DecoderException { LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container; // Now, we can allocate the AddRequest Object AddRequestCodec addRequest = new AddRequestCodec(); addRequest.setMessageId( ldapMessageContainer.getMessageId() ); ldapMessageContainer.setLdapMessage( addRequest ); // We will check that the request is not null TLV tlv = ldapMessageContainer.getCurrentTLV(); if ( tlv.getLength() == 0 ) { String msg = I18n.err( I18n.ERR_04084 ); log.error( msg ); // Will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } } } );
public void action( LdapMessageContainer<CompareResponseDecorator> container ) throws DecoderException { // Now, we can allocate the CompareResponse Object CompareResponseDecorator compareResponse = new CompareResponseDecorator( container.getLdapCodecService(), new CompareResponseImpl( container.getMessageId() ) ); container.setMessage( compareResponse ); // We will check that the request is not null TLV tlv = container.getCurrentTLV(); if ( tlv.getLength() == 0 ) { String msg = I18n.err( I18n.ERR_04094 ); LOG.error( msg ); throw new DecoderException( msg ); } LOG.debug( "Compare response " ); } } );
public void action( LdapMessageContainer<UnbindRequestDecorator> container ) throws DecoderException { // Create the UnbindRequest LdapMessage instance and store it in the container UnbindRequestDecorator unbindRequest = new UnbindRequestDecorator( container.getLdapCodecService(), new UnbindRequestImpl( container.getMessageId() ) ); container.setMessage( unbindRequest ); TLV tlv = container.getCurrentTLV(); int expectedLength = tlv.getLength(); // The Length should be null if ( expectedLength != 0 ) { LOG.error( I18n.err( I18n.ERR_04071, Integer.valueOf( expectedLength ) ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( I18n.err( I18n.ERR_04072 ) ); } // We can quit now container.setGrammarEndAllowed( true ); } } );
public void action( LdapMessageContainer<BindRequestDecorator> container ) throws DecoderException { // Create the BindRequest LdapMessage instance and store it in the container BindRequestDecorator bindRequest = new BindRequestDecorator( container.getLdapCodecService(), new BindRequestImpl( container.getMessageId() ) ); container.setMessage( bindRequest ); // We will check that the request is not null TLV tlv = container.getCurrentTLV(); if ( tlv.getLength() == 0 ) { String msg = I18n.err( I18n.ERR_04077 ); LOG.error( msg ); // This will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } } } );
public void action( LdapMessageContainer<AddRequestDecorator> container ) throws DecoderException { // Now, we can allocate the AddRequest Object int messageId = container.getMessageId(); AddRequestDecorator addRequest = new AddRequestDecorator( container.getLdapCodecService(), new AddRequestImpl( messageId ) ); container.setMessage( addRequest ); // We will check that the request is not null TLV tlv = container.getCurrentTLV(); if ( tlv.getLength() == 0 ) { String msg = I18n.err( I18n.ERR_04084 ); LOG.error( msg ); // Will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } } } );
public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException { SearchRequestDecorator searchRequestDecorator = container.getMessage(); TLV tlv = container.getCurrentTLV(); // Store the value. SubstringFilter substringFilter = ( SubstringFilter ) searchRequestDecorator.getTerminalFilter(); if ( tlv.getLength() == 0 ) { String msg = I18n.err( I18n.ERR_04108 ); LOG.error( msg ); throw new DecoderException( msg ); } substringFilter.setInitialSubstrings( Strings.utf8ToString(tlv.getValue().getData()) ); // We now have to get back to the nearest filter which is // not terminal. searchRequestDecorator.unstackFilters( container ); } } );
public void action( IAsn1Container container ) throws DecoderException { LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container; SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest(); TLV tlv = ldapMessageContainer.getCurrentTLV(); // Store the value. SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter(); if ( tlv.getLength() == 0 ) { log.error( I18n.err( I18n.ERR_04108 ) ); throw new DecoderException( I18n.err( I18n.ERR_04108 ) ); } substringFilter.setInitialSubstrings( StringTools.utf8ToString( tlv.getValue().getData() ) ); // We now have to get back to the nearest filter which is // not terminal. searchRequest.unstackFilters( container ); } } );
public void action( IAsn1Container container ) throws DecoderException { PagedResultsControlContainer pagedSearchContainer = ( PagedResultsControlContainer ) container; Value value = pagedSearchContainer.getCurrentTLV().getValue(); if ( pagedSearchContainer.getCurrentTLV().getLength() == 0 ) { pagedSearchContainer.getPagedSearchControl().setCookie( StringTools.EMPTY_BYTES ); } else { pagedSearchContainer.getPagedSearchControl().setCookie( value.getData() ); } // We can have an END transition pagedSearchContainer.grammarEndAllowed( true ); } } );
public void action( PagedResultsContainer container ) throws DecoderException { Value value = container.getCurrentTLV().getValue(); if ( container.getCurrentTLV().getLength() == 0 ) { container.getDecorator().setCookie( StringConstants.EMPTY_BYTES ); } else { container.getDecorator().setCookie( value.getData() ); } // We can have an END transition container.setGrammarEndAllowed( true ); } } );