Refactor Register*ListenerReply classes
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / PersistAbortTransactionPayload.java
1 /*
2  * Copyright (c) 2017 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.datastore.messages;
9
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
12
13 /**
14  * A request sent from {@link org.opendaylight.controller.cluster.datastore.ShardTransaction} to
15  * {@link org.opendaylight.controller.cluster.datastore.Shard} to persist an
16  * {@link org.opendaylight.controller.cluster.datastore.persisted.AbortTransactionPayload} after the transaction has
17  * been closed by the frontend and internal backend state has been updated.
18  *
19  * <p>
20  * Since the two are actors, we cannot perform a direct upcall, as that breaks actor containment and wreaks havoc into
21  * Akka itself. This class does not need to be serializable, as both actors are guaranteed to be co-located.
22  *
23  * @author Robert Varga
24  */
25 public final class PersistAbortTransactionPayload {
26     private final TransactionIdentifier txId;
27
28     public PersistAbortTransactionPayload(final TransactionIdentifier txId) {
29         this.txId = Preconditions.checkNotNull(txId);
30     }
31
32     public TransactionIdentifier getTransactionId() {
33         return txId;
34     }
35 }