Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / persisted / FrontendShardDataTreeSnapshotMetadata.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.datastore.persisted;
9
10 import com.google.common.base.MoreObjects;
11 import com.google.common.collect.ImmutableList;
12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
13 import java.io.Externalizable;
14 import java.util.Collection;
15 import java.util.List;
16
17 public final class FrontendShardDataTreeSnapshotMetadata
18         extends ShardDataTreeSnapshotMetadata<FrontendShardDataTreeSnapshotMetadata> {
19     @java.io.Serial
20     private static final long serialVersionUID = 1L;
21
22     @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "This field is not Serializable but this class "
23             + "implements writeReplace to delegate serialization to a Proxy class and thus instances of this class "
24             + "aren't serialized. FindBugs does not recognize this.")
25     private final List<FrontendClientMetadata> clients;
26
27     public FrontendShardDataTreeSnapshotMetadata(final Collection<FrontendClientMetadata> clients) {
28         this.clients = ImmutableList.copyOf(clients);
29     }
30
31     public List<FrontendClientMetadata> getClients() {
32         return clients;
33     }
34
35     @Override
36     protected Externalizable externalizableProxy() {
37         return new FM(this);
38     }
39
40     @Override
41     public Class<FrontendShardDataTreeSnapshotMetadata> getType() {
42         return FrontendShardDataTreeSnapshotMetadata.class;
43     }
44
45     @Override
46     public String toString() {
47         return MoreObjects.toStringHelper(FrontendShardDataTreeSnapshotMetadata.class)
48             .add("clients", clients)
49             .toString();
50     }
51 }