Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
BUG-5280: handle NotLeaderException
[controller.git]
/
opendaylight
/
md-sal
/
cds-access-client
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
access
/
client
/
BackendInfo.java
diff --git
a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/BackendInfo.java
b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/BackendInfo.java
index efdfa04b1613feec35894f9899a13445c206ea40..85d9f14e1710dcf6220f84d0514f56df75cd2d3c 100644
(file)
--- a/
opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/BackendInfo.java
+++ b/
opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/BackendInfo.java
@@
-17,19
+17,25
@@
import org.opendaylight.controller.cluster.access.ABIVersion;
* Basic information about how to talk to the backend. ClientActorBehavior uses this information to dispatch requests
* to the backend.
*
* Basic information about how to talk to the backend. ClientActorBehavior uses this information to dispatch requests
* to the backend.
*
+ * <p>
* This class is not final so concrete actor behavior implementations may subclass it and track more information about
* the backend. The {@link #hashCode()} and {@link #equals(Object)} methods are made final to ensure subclasses compare
* This class is not final so concrete actor behavior implementations may subclass it and track more information about
* the backend. The {@link #hashCode()} and {@link #equals(Object)} methods are made final to ensure subclasses compare
- * on identity.
+ * on
object
identity.
*
* @author Robert Varga
*/
public class BackendInfo {
private final ABIVersion version;
private final ActorRef actor;
*
* @author Robert Varga
*/
public class BackendInfo {
private final ABIVersion version;
private final ActorRef actor;
+ private final int maxMessages;
+ private final long sessionId;
- protected BackendInfo(final ActorRef actor, final
ABIVersion version
) {
+ protected BackendInfo(final ActorRef actor, final
long sessionId, final ABIVersion version, final int maxMessages
) {
this.version = Preconditions.checkNotNull(version);
this.actor = Preconditions.checkNotNull(actor);
this.version = Preconditions.checkNotNull(version);
this.actor = Preconditions.checkNotNull(actor);
+ Preconditions.checkArgument(maxMessages > 0, "Maximum messages has to be positive, not %s", maxMessages);
+ this.maxMessages = maxMessages;
+ this.sessionId = sessionId;
}
public final ActorRef getActor() {
}
public final ActorRef getActor() {
@@
-40,6
+46,14
@@
public class BackendInfo {
return version;
}
return version;
}
+ public final int getMaxMessages() {
+ return maxMessages;
+ }
+
+ public final long getSessionId() {
+ return sessionId;
+ }
+
@Override
public final int hashCode() {
return super.hashCode();
@Override
public final int hashCode() {
return super.hashCode();
@@
-56,6
+70,7
@@
public class BackendInfo {
}
protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
}
protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
- return toStringHelper.add("actor", actor).add("version", version);
+ return toStringHelper.add("actor", actor).add("sessionId", sessionId).add("version", version)
+ .add("maxMessages", maxMessages);
}
}
}
}