BUG 3054 : Check readiness status of datastore when receiving MemberUp.
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / PrimaryFound.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.Serializable;
12
13 public class PrimaryFound implements Serializable {
14     private static final long serialVersionUID = 1L;
15
16     private final String primaryPath;
17
18     public PrimaryFound(final String primaryPath) {
19         this.primaryPath = primaryPath;
20     }
21
22     public String getPrimaryPath() {
23         return primaryPath;
24     }
25
26     @Override
27     public boolean equals(final Object o) {
28         if (this == o) {
29             return true;
30         }
31         if (o == null || getClass() != o.getClass()) {
32             return false;
33         }
34
35         PrimaryFound that = (PrimaryFound) o;
36
37         if (!primaryPath.equals(that.primaryPath)) {
38             return false;
39         }
40
41         return true;
42     }
43
44     @Override
45     public int hashCode() {
46         return primaryPath.hashCode();
47     }
48
49     @Override
50     public String toString() {
51         StringBuilder builder = new StringBuilder();
52         builder.append("PrimaryFound [primaryPath=").append(primaryPath).append("]");
53         return builder.toString();
54     }
55 }