Merge "Remove isCloseMsg check for each rpc"
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / BatchedModificationsReply.java
1 /*
2  * Copyright (c) 2015 Brocade Communications 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.datastore.messages;
9
10 import java.io.IOException;
11 import java.io.ObjectInput;
12 import java.io.ObjectOutput;
13
14 /**
15  * The reply for the BatchedModifications message.
16  *
17  * @author Thomas Pantelis
18  */
19 public class BatchedModificationsReply extends VersionedExternalizableMessage {
20     private static final long serialVersionUID = 1L;
21
22     private int numBatched;
23
24     public BatchedModificationsReply() {
25     }
26
27     public BatchedModificationsReply(int numBatched) {
28         this.numBatched = numBatched;
29     }
30
31     public int getNumBatched() {
32         return numBatched;
33     }
34
35     @Override
36     public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
37         super.readExternal(in);
38         numBatched = in.readInt();
39     }
40
41     @Override
42     public void writeExternal(ObjectOutput out) throws IOException {
43         super.writeExternal(out);
44         out.writeInt(numBatched);
45     }
46
47     @Override
48     public Object toSerializable() {
49         return this;
50     }
51
52     @Override
53     public String toString() {
54         StringBuilder builder = new StringBuilder();
55         builder.append("BatchedModificationsReply [numBatched=").append(numBatched).append("]");
56         return builder.toString();
57     }
58 }