Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / commands / ExistsTransactionRequest.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.commands;
9
10 import akka.actor.ActorRef;
11 import java.io.IOException;
12 import java.io.ObjectInput;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.controller.cluster.access.ABIVersion;
15 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
17
18 /**
19  * A transaction request to query if a particular path exists in the current view of a particular transaction.
20  */
21 public final class ExistsTransactionRequest extends AbstractReadPathTransactionRequest<ExistsTransactionRequest> {
22     interface SerialForm extends AbstractReadPathTransactionRequest.SerialForm<ExistsTransactionRequest> {
23         @Override
24         default ExistsTransactionRequest readExternal(final ObjectInput in, final TransactionIdentifier target,
25             final long sequence, final ActorRef replyTo, final boolean snapshotOnly, final YangInstanceIdentifier path)
26                 throws IOException {
27             return new ExistsTransactionRequest(target, sequence, replyTo, path, snapshotOnly);
28         }
29     }
30
31     @java.io.Serial
32     private static final long serialVersionUID = 1L;
33
34     public ExistsTransactionRequest(final @NonNull TransactionIdentifier identifier, final long sequence,
35             final @NonNull ActorRef replyTo, final @NonNull YangInstanceIdentifier path, final boolean snapshotOnly) {
36         super(identifier, sequence, replyTo, path, snapshotOnly);
37     }
38
39     private ExistsTransactionRequest(final ExistsTransactionRequest request, final ABIVersion version) {
40         super(request, version);
41     }
42
43     @Override
44     protected ExistsTransactionRequest cloneAsVersion(final ABIVersion version) {
45         return new ExistsTransactionRequest(this, version);
46     }
47
48     @Override
49     protected SerialForm externalizableProxy(final ABIVersion version) {
50         return new ETR(this);
51     }
52 }