/** * {@inheritDoc} */ @Override public CodecControl<SyncStateValue> newCodecControl( SyncStateValue control ) { return new SyncStateValueDecorator( codec, control ); } }
/** * {@inheritDoc} */ @Override public byte[] getCookie() { return getDecorated().getCookie(); }
computeLength(); ByteBuffer buffer = ByteBuffer.allocate( valueLength ); buffer.put( BerValue.getBytes( getSyncStateType().getValue() ) ); BerValue.encode( buffer, getEntryUUID() ); if ( getCookie() != null ) BerValue.encode( buffer, getCookie() );
/** * Encode the SyncStateValue control * * @param buffer The encoded sink * @return A ByteBuffer that contains the encoded PDU * @throws EncoderException If anything goes wrong. */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER ) ); } // Encode the SEQ buffer.put( UniversalTag.SEQUENCE.getValue() ); buffer.put( TLV.getBytes( syncStateSeqLength ) ); // The mode buffer.put( UniversalTag.ENUMERATED.getValue() ); buffer.put( ( byte ) 0x01 ); buffer.put( BerValue.getBytes( getSyncStateType().getValue() ) ); // the entryUUID BerValue.encode( buffer, getEntryUUID() ); // The cookie if ( getCookie() != null ) { BerValue.encode( buffer, getCookie() ); } return buffer; }
/** * Compute the SyncStateValue length. * <br> * SyncStateValue : * <pre> * 0x30 L1 * | * +--> 0x0A 0x01 [0x00|0x01|0x02|0x03] (type) * [+--> 0x04 L2 abcd... (entryUUID) * [+--> 0x04 L3 abcd... (cookie) * </pre> * * @return The computed length */ @Override public int computeLength() { // The sync state type length syncStateSeqLength = 1 + 1 + 1; syncStateSeqLength += 1 + TLV.getNbBytes( getEntryUUID().length ) + getEntryUUID().length; // The cookie length, if we have a cookie if ( getCookie() != null ) { syncStateSeqLength += 1 + TLV.getNbBytes( getCookie().length ) + getCookie().length; } valueLength = 1 + TLV.getNbBytes( syncStateSeqLength ) + syncStateSeqLength; return valueLength; }
computeLength(); ByteBuffer buffer = ByteBuffer.allocate( valueLength ); buffer.put( BerValue.getBytes( getSyncStateType().getValue() ) ); BerValue.encode( buffer, getEntryUUID() ); if ( getCookie() != null ) BerValue.encode( buffer, getCookie() );
/** * Encode the SyncStateValue control * * @param buffer The encoded sink * @return A ByteBuffer that contains the encoded PDU * @throws EncoderException If anything goes wrong. */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER ) ); } // Encode the SEQ buffer.put( UniversalTag.SEQUENCE.getValue() ); buffer.put( TLV.getBytes( syncStateSeqLength ) ); // The mode buffer.put( UniversalTag.ENUMERATED.getValue() ); buffer.put( ( byte ) 0x01 ); buffer.put( BerValue.getBytes( getSyncStateType().getValue() ) ); // the entryUUID BerValue.encode( buffer, getEntryUUID() ); // The cookie if ( getCookie() != null ) { BerValue.encode( buffer, getCookie() ); } return buffer; }
/** * Compute the SyncStateValue length. * <br> * SyncStateValue : * <pre> * 0x30 L1 * | * +--> 0x0A 0x01 [0x00|0x01|0x02|0x03] (type) * [+--> 0x04 L2 abcd... (entryUUID) * [+--> 0x04 L3 abcd... (cookie) * </pre> * * @return The computed length */ @Override public int computeLength() { // The sync state type length syncStateSeqLength = 1 + 1 + 1; syncStateSeqLength += 1 + TLV.getNbBytes( getEntryUUID().length ) + getEntryUUID().length; // The cookie length, if we have a cookie if ( getCookie() != null ) { syncStateSeqLength += 1 + TLV.getNbBytes( getCookie().length ) + getCookie().length; } valueLength = 1 + TLV.getNbBytes( syncStateSeqLength ) + syncStateSeqLength; return valueLength; }
computeLength(); ByteBuffer buffer = ByteBuffer.allocate( valueLength ); buffer.put( BerValue.getBytes( getSyncStateType().getValue() ) ); BerValue.encode( buffer, getEntryUUID() ); if ( getCookie() != null ) BerValue.encode( buffer, getCookie() );
/** * Encode the SyncStateValue control * * @param buffer The encoded sink * @return A ByteBuffer that contains the encoded PDU * @throws EncoderException If anything goes wrong. */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER ) ); } // Encode the SEQ buffer.put( UniversalTag.SEQUENCE.getValue() ); buffer.put( TLV.getBytes( syncStateSeqLength ) ); // The mode buffer.put( UniversalTag.ENUMERATED.getValue() ); buffer.put( ( byte ) 0x01 ); buffer.put( BerValue.getBytes( getSyncStateType().getValue() ) ); // the entryUUID BerValue.encode( buffer, getEntryUUID() ); // The cookie if ( getCookie() != null ) { BerValue.encode( buffer, getCookie() ); } return buffer; }
/** * {@inheritDoc} */ @Override public CodecControl<SyncStateValue> newCodecControl( SyncStateValue control ) { return new SyncStateValueDecorator( codec, control ); } }
/** * {@inheritDoc} */ @Override public void setCookie( byte[] cookie ) { getDecorated().setCookie( cookie ); }
/** * Compute the SyncStateValue length. * <br> * SyncStateValue : * <pre> * 0x30 L1 * | * +--> 0x0A 0x01 [0x00|0x01|0x02|0x03] (type) * [+--> 0x04 L2 abcd... (entryUUID) * [+--> 0x04 L3 abcd... (cookie) * </pre> * * @return The computed length */ @Override public int computeLength() { // The sync state type length syncStateSeqLength = 1 + 1 + 1; syncStateSeqLength += 1 + TLV.getNbBytes( getEntryUUID().length ) + getEntryUUID().length; // The cookie length, if we have a cookie if ( getCookie() != null ) { syncStateSeqLength += 1 + TLV.getNbBytes( getCookie().length ) + getCookie().length; } valueLength = 1 + TLV.getNbBytes( syncStateSeqLength ) + syncStateSeqLength; return valueLength; }
/** * {@inheritDoc} */ @Override public CodecControl<SyncStateValue> newCodecControl( SyncStateValue control ) { return new SyncStateValueDecorator( codec, control ); } }
/** * {@inheritDoc} */ @Override public byte[] getEntryUUID() { return getDecorated().getEntryUUID(); }
/** * {@inheritDoc} */ @Override public CodecControl<SyncStateValue> newCodecControl() { return new SyncStateValueDecorator( codec ); }
/** * {@inheritDoc} */ @Override public void setCookie( byte[] cookie ) { getDecorated().setCookie( cookie ); }
/** * {@inheritDoc} */ @Override public CodecControl<SyncStateValue> newCodecControl() { return new SyncStateValueDecorator( codec ); }
/** * {@inheritDoc} */ @Override public void setSyncStateType( SyncStateTypeEnum syncStateType ) { getDecorated().setSyncStateType( syncStateType ); }
/** * {@inheritDoc} */ @Override public CodecControl<SyncStateValue> newCodecControl() { return new SyncStateValueDecorator( codec ); }