Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / ReadyTransactionReply.java
1 /*
2  * Copyright (c) 2014 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
9 package org.opendaylight.controller.cluster.datastore.messages;
10
11 import java.io.IOException;
12 import java.io.ObjectInput;
13 import java.io.ObjectOutput;
14 import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
15
16 @Deprecated(since = "9.0.0", forRemoval = true)
17 public class ReadyTransactionReply extends VersionedExternalizableMessage {
18     private static final long serialVersionUID = 1L;
19
20     private String cohortPath;
21
22     public ReadyTransactionReply() {
23     }
24
25     public ReadyTransactionReply(final String cohortPath) {
26         this(cohortPath, DataStoreVersions.CURRENT_VERSION);
27     }
28
29     public ReadyTransactionReply(final String cohortPath, final short version) {
30         super(version);
31         this.cohortPath = cohortPath;
32     }
33
34     public String getCohortPath() {
35         return cohortPath;
36     }
37
38     @Override
39     public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
40         super.readExternal(in);
41         cohortPath = in.readUTF();
42     }
43
44     @Override
45     public void writeExternal(final ObjectOutput out) throws IOException {
46         super.writeExternal(out);
47         out.writeUTF(cohortPath);
48     }
49
50     public static ReadyTransactionReply fromSerializable(final Object serializable) {
51         return (ReadyTransactionReply)serializable;
52     }
53
54     public static boolean isSerializedType(final Object message) {
55         return message instanceof ReadyTransactionReply;
56     }
57 }