/** * {@inheritDoc} */ @Override public boolean isTrue() { return getDecorated().isTrue(); }
/** * Compute the CompareResponse length * <br> * CompareResponse : * <pre> * 0x6F L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * * Length(CompareResponse) = Length(0x6F) + Length(L1) + L1 * </pre> */ @Override public int computeLength() { compareResponseLength = ( ( LdapResultDecorator ) getLdapResult() ).computeLength(); return 1 + TLV.getNbBytes( compareResponseLength ) + compareResponseLength; }
/** * {@inheritDoc} */ 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_05148_NULL_COMPARE_REQUEST ); LOG.error( msg ); throw new DecoderException( msg ); } if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05169_COMPARE_RESPONSE ) ); } } }
/** * {@inheritDoc} */ 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_05148_NULL_COMPARE_REQUEST ); LOG.error( msg ); throw new DecoderException( msg ); } if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05169_COMPARE_RESPONSE ) ); } } }
/** * Compute the CompareResponse length * <br> * CompareResponse : * <pre> * 0x6F L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * * Length(CompareResponse) = Length(0x6F) + Length(L1) + L1 * </pre> */ @Override public int computeLength() { compareResponseLength = ( ( LdapResultDecorator ) getLdapResult() ).computeLength(); return 1 + TLV.getNbBytes( compareResponseLength ) + compareResponseLength; }
/** * {@inheritDoc} */ 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_05148_NULL_COMPARE_REQUEST ); LOG.error( msg ); throw new DecoderException( msg ); } if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05169_COMPARE_RESPONSE ) ); } } }
/** * {@inheritDoc} */ @Override public boolean isTrue() { return getDecorated().isTrue(); }
/** * Compute the CompareResponse length * <br> * CompareResponse : * <pre> * 0x6F L1 * | * +--> LdapResult * * L1 = Length(LdapResult) * * Length(CompareResponse) = Length(0x6F) + Length(L1) + L1 * </pre> */ @Override public int computeLength() { compareResponseLength = ( ( LdapResultDecorator ) getLdapResult() ).computeLength(); return 1 + TLV.getNbBytes( compareResponseLength ) + compareResponseLength; }
decorator = new CompareResponseDecorator( codec, ( CompareResponse ) decoratedMessage ); break;
/** * {@inheritDoc} */ @Override public boolean isTrue() { return getDecorated().isTrue(); }
/** * Encode the CompareResponse message to a PDU. * * @param buffer The buffer where to put the PDU */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { try { // The CompareResponse Tag buffer.put( LdapCodecConstants.COMPARE_RESPONSE_TAG ); buffer.put( TLV.getBytes( compareResponseLength ) ); // The LdapResult ( ( LdapResultDecorator ) getLdapResult() ).encode( buffer ); } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_08212_PDU_BUFFER_TOO_SMALL ), boe ); } return buffer; } }
decorator = new CompareResponseDecorator( codec, ( CompareResponse ) decoratedMessage ); break;
/** * Encode the CompareResponse message to a PDU. * * @param buffer The buffer where to put the PDU */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { try { // The CompareResponse Tag buffer.put( LdapCodecConstants.COMPARE_RESPONSE_TAG ); buffer.put( TLV.getBytes( compareResponseLength ) ); // The LdapResult ( ( LdapResultDecorator ) getLdapResult() ).encode( buffer ); } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_08212_PDU_BUFFER_TOO_SMALL ), boe ); } return buffer; } }
decorator = new CompareResponseDecorator( codec, ( CompareResponse ) decoratedMessage ); break;
/** * Encode the CompareResponse message to a PDU. * * @param buffer The buffer where to put the PDU */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { try { // The CompareResponse Tag buffer.put( LdapCodecConstants.COMPARE_RESPONSE_TAG ); buffer.put( TLV.getBytes( compareResponseLength ) ); // The LdapResult ( ( LdapResultDecorator ) getLdapResult() ).encode( buffer ); } catch ( BufferOverflowException boe ) { throw new EncoderException( I18n.err( I18n.ERR_08212_PDU_BUFFER_TOO_SMALL ), boe ); } return buffer; } }