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