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