BUG-5280: add SimpleDataStoreClientBehavior
[controller.git] / opendaylight / md-sal / cds-access-client / src / main / java / org / opendaylight / controller / cluster / access / client / TransmittedConnectionEntry.java
1 /*
2  * Copyright (c) 2016 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 package org.opendaylight.controller.cluster.access.client;
9
10 import com.google.common.base.MoreObjects.ToStringHelper;
11
12 /**
13  * A {@link ConnectionEntry} which has been transmitted. It holds additional information about the last transmission.
14  *
15  * @author Robert Varga
16  */
17 final class TransmittedConnectionEntry extends ConnectionEntry {
18     private final long sessionId;
19     private final long txSequence;
20     private final long txTicks;
21
22     TransmittedConnectionEntry(final ConnectionEntry entry, final long sessionId, final long txSequence,
23         final long now) {
24         super(entry);
25         this.sessionId = sessionId;
26         this.txSequence = txSequence;
27         this.txTicks = now;
28     }
29
30     long getSessionId() {
31         return sessionId;
32     }
33
34     long getTxSequence() {
35         return txSequence;
36     }
37
38     long getTxTicks() {
39         return txTicks;
40     }
41
42     @Override
43     ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
44         return super.addToStringAttributes(toStringHelper).add("sessionId", sessionId).add("txSequence", txSequence);
45     }
46 }