BUG-5280: implement transaction dispatch
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / commands / LocalHistoryFailureProxyV1.java
diff --git a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/LocalHistoryFailureProxyV1.java b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/LocalHistoryFailureProxyV1.java
new file mode 100644 (file)
index 0000000..e8cdf6d
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.access.commands;
+
+import java.io.DataInput;
+import java.io.IOException;
+import org.opendaylight.controller.cluster.access.concepts.AbstractRequestFailureProxy;
+import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
+import org.opendaylight.controller.cluster.access.concepts.RequestException;
+
+/**
+ * Externalizable proxy for use with {@link LocalHistoryFailure}. It implements the initial (Boron) serialization
+ * format.
+ *
+ * @author Robert Varga
+ */
+final class LocalHistoryFailureProxyV1 extends AbstractRequestFailureProxy<LocalHistoryIdentifier, LocalHistoryFailure> {
+    private static final long serialVersionUID = 1L;
+
+    public LocalHistoryFailureProxyV1() {
+        // For Externalizable
+    }
+
+    LocalHistoryFailureProxyV1(final LocalHistoryFailure failure) {
+        super(failure);
+    }
+
+    @Override
+    protected LocalHistoryFailure createFailure(final LocalHistoryIdentifier target, final RequestException cause) {
+        return new LocalHistoryFailure(target, cause);
+    }
+
+    @Override
+    protected LocalHistoryIdentifier readTarget(final DataInput in) throws IOException {
+        return LocalHistoryIdentifier.readFrom(in);
+    }
+}