0f3e533ba2a766a48a52c4ece0ab52dd439ec6ac
[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 org.opendaylight.controller.cluster.access.concepts.AbstractRequestFailureProxy;
13 import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
14 import org.opendaylight.controller.cluster.access.concepts.RequestException;
15
16 /**
17  * Externalizable proxy for use with {@link LocalHistoryFailure}. It implements the initial (Boron) serialization
18  * format.
19  *
20  * @author Robert Varga
21  */
22 final class LocalHistoryFailureProxyV1 extends AbstractRequestFailureProxy<LocalHistoryIdentifier, LocalHistoryFailure> {
23     private static final long serialVersionUID = 1L;
24
25     public LocalHistoryFailureProxyV1() {
26         // For Externalizable
27     }
28
29     LocalHistoryFailureProxyV1(final LocalHistoryFailure failure) {
30         super(failure);
31     }
32
33     @Override
34     protected LocalHistoryFailure createFailure(final LocalHistoryIdentifier target, final long sequence,
35             final RequestException cause) {
36         return new LocalHistoryFailure(target, sequence, cause);
37     }
38
39     @Override
40     protected LocalHistoryIdentifier readTarget(final DataInput in) throws IOException {
41         return LocalHistoryIdentifier.readFrom(in);
42     }
43 }