Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / commands / OutOfSequenceEnvelopeException.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.access.commands;
9
10 import org.opendaylight.controller.cluster.access.concepts.RequestException;
11
12 /**
13  * A {@link RequestException} indicating that the backend has received a RequestEnvelope whose sequence does not match
14  * the next expected sequence. This can happen during leader transitions, when a part of the stream is rejected because
15  * the backend is not the leader and it transitions to being a leader with old stream messages still being present.
16  */
17 public final class OutOfSequenceEnvelopeException extends RequestException {
18     @java.io.Serial
19     private static final long serialVersionUID = 1L;
20
21     public OutOfSequenceEnvelopeException(final long expectedEnvelope) {
22         super("Expecting envelope " + Long.toUnsignedString(expectedEnvelope));
23     }
24
25     @Override
26     public boolean isRetriable() {
27         return true;
28     }
29 }