More cds-access-api cleanup
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / commands / LocalHistoryFailureProxyV1.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. 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 java.io.DataInput;
11 import java.io.IOException;
12 import java.io.Serial;
13 import org.opendaylight.controller.cluster.access.concepts.AbstractRequestFailureProxy;
14 import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
15 import org.opendaylight.controller.cluster.access.concepts.RequestException;
16
17 /**
18  * Externalizable proxy for use with {@link LocalHistoryFailure}. It implements the initial (Boron) serialization
19  * format.
20  *
21  * @author Robert Varga
22  */
23 final class LocalHistoryFailureProxyV1 extends
24         AbstractRequestFailureProxy<LocalHistoryIdentifier, LocalHistoryFailure> {
25     @Serial
26     private static final long serialVersionUID = 1L;
27
28     // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
29     // be able to create instances via reflection.
30     @SuppressWarnings("checkstyle:RedundantModifier")
31     public LocalHistoryFailureProxyV1() {
32         // For Externalizable
33     }
34
35     LocalHistoryFailureProxyV1(final LocalHistoryFailure failure) {
36         super(failure);
37     }
38
39     @Override
40     protected LocalHistoryFailure createFailure(final LocalHistoryIdentifier target, final long sequence,
41             final RequestException cause) {
42         return new LocalHistoryFailure(target, sequence, cause);
43     }
44
45     @Override
46     protected LocalHistoryIdentifier readTarget(final DataInput in) throws IOException {
47         return LocalHistoryIdentifier.readFrom(in);
48     }
49 }