Forward port fix OPENDJ-1516: Trunk sends MSG_TYPE_REPLICA_OFFLINE messages to a v7 DS
| | |
| | | @Override |
| | | public byte[] getBytes(short protocolVersion) |
| | | { |
| | | if (protocolVersion < ProtocolVersion.REPLICATION_PROTOCOL_V8) |
| | | { |
| | | return null; |
| | | } |
| | | final ByteArrayBuilder builder = new ByteArrayBuilder(size()); |
| | | builder.appendByte(MSG_TYPE_REPLICA_OFFLINE); |
| | | builder.appendShort(protocolVersion); |
| | |
| | | * @param protocolVersion |
| | | * The protocol version to use for serialization. The version should |
| | | * normally be older than the current one. |
| | | * @return The encoded PDU. |
| | | * @return The encoded PDU, or <code>null</code> if the message isn't supported |
| | | * in that protocol version. |
| | | */ |
| | | public abstract byte[] getBytes(short protocolVersion); |
| | | |
| | |
| | | public void publish(final ReplicationMsg msg) throws IOException |
| | | { |
| | | final byte[] buffer = msg.getBytes(protocolVersion); |
| | | if (buffer == null) |
| | | { |
| | | // skip anything that cannot be encoded for this peer. |
| | | return; |
| | | } |
| | | if (isRunning.get()) |
| | | { |
| | | while (!closeInitiated) |