/** * {@inheritDoc} */ @Override public void enableNotification( ChangeType changeType ) { changeTypes |= changeType.getValue(); }
/** * {@inheritDoc} */ @Override public void disableNotification( ChangeType changeType ) { changeTypes &= ~changeType.getValue(); }
/** * {@inheritDoc} */ @Override public void disableNotification( ChangeType changeType ) { changeTypes &= ~changeType.getValue(); }
/** * {@inheritDoc} */ @Override public boolean isNotificationEnabled( ChangeType changeType ) { return ( changeType.getValue() & changeTypes ) > 0; }
/** * {@inheritDoc} */ @Override public void enableNotification( ChangeType changeType ) { changeTypes |= changeType.getValue(); }
/** * {@inheritDoc} */ @Override public void disableNotification( ChangeType changeType ) { changeTypes &= ~changeType.getValue(); }
/** * {@inheritDoc} */ @Override public boolean isNotificationEnabled( ChangeType changeType ) { return ( changeType.getValue() & changeTypes ) > 0; }
/** * {@inheritDoc} */ @Override public boolean isNotificationEnabled( ChangeType changeType ) { return ( changeType.getValue() & changeTypes ) > 0; }
/** * {@inheritDoc} */ @Override public void enableNotification( ChangeType changeType ) { changeTypes |= changeType.getValue(); }
/** * {@inheritDoc} */ public byte[] serialize( Object object ) throws IOException { ReplicaEventMessage replicaEventMessage = ( ReplicaEventMessage ) object; Entry entry = replicaEventMessage.getEntry(); ChangeType changeType = replicaEventMessage.getChangeType(); try ( ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream( baos ) ) { // The change type first out.writeByte( changeType.getValue() ); // The entry DN entry.getDn().writeExternal( out ); // The entry entry.writeExternal( out ); out.flush(); return baos.toByteArray(); } }
buffer.put( BerValue.getBytes( getChangeType().getValue() ) );
buffer.put( BerValue.getBytes( getChangeType().getValue() ) );
buffer.put( BerValue.getBytes( getChangeType().getValue() ) );
/** * Encodes the entry change 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 ) ); } buffer.put( UniversalTag.SEQUENCE.getValue() ); buffer.put( TLV.getBytes( eccSeqLength ) ); buffer.put( UniversalTag.ENUMERATED.getValue() ); buffer.put( ( byte ) 1 ); buffer.put( BerValue.getBytes( getChangeType().getValue() ) ); if ( getPreviousDn() != null ) { BerValue.encode( buffer, previousDnBytes ); } if ( getChangeNumber() != UNDEFINED_CHANGE_NUMBER ) { BerValue.encode( buffer, getChangeNumber() ); } return buffer; }
/** * Encodes the entry change 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 ) ); } buffer.put( UniversalTag.SEQUENCE.getValue() ); buffer.put( TLV.getBytes( eccSeqLength ) ); buffer.put( UniversalTag.ENUMERATED.getValue() ); buffer.put( ( byte ) 1 ); buffer.put( BerValue.getBytes( getChangeType().getValue() ) ); if ( getPreviousDn() != null ) { BerValue.encode( buffer, previousDnBytes ); } if ( getChangeNumber() != UNDEFINED_CHANGE_NUMBER ) { BerValue.encode( buffer, getChangeNumber() ); } return buffer; }
/** * Encodes the entry change 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 ) ); } buffer.put( UniversalTag.SEQUENCE.getValue() ); buffer.put( TLV.getBytes( eccSeqLength ) ); buffer.put( UniversalTag.ENUMERATED.getValue() ); buffer.put( ( byte ) 1 ); buffer.put( BerValue.getBytes( getChangeType().getValue() ) ); if ( getPreviousDn() != null ) { BerValue.encode( buffer, previousDnBytes ); } if ( getChangeNumber() != UNDEFINED_CHANGE_NUMBER ) { BerValue.encode( buffer, getChangeNumber() ); } return buffer; }
final EntryChange c = (EntryChange) responseControl; ctl = new EntryChangeNotificationControl( PersistentSearchChangeType.valueOf(c.getChangeType().getValue()), c.getPreviousDn().toString(), c.getChangeNumber(),