Bug 9060: TracingBroker printOpenTransactions
[controller.git] / opendaylight / md-sal / mdsal-trace / dom-impl / src / main / java / org / opendaylight / controller / md / sal / trace / closetracker / impl / CloseTrackedRegistryReportEntry.java
1 /*
2  * Copyright (c) 2017 Red Hat, 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.md.sal.trace.closetracker.impl;
9
10 import static java.util.Objects.requireNonNull;
11
12 import java.util.List;
13
14 /**
15  * Element of a "report" created by a {@link CloseTrackedRegistry}.
16  *
17  * @author Michael Vorburger.ch
18  */
19 public class CloseTrackedRegistryReportEntry<T extends CloseTracked<T>> {
20
21     private final CloseTracked<T> exampleCloseTracked;
22     private final long numberAddedNotRemoved;
23     private final List<StackTraceElement> stackTraceElements;
24
25     public CloseTrackedRegistryReportEntry(CloseTracked<T> exampleCloseTracked, long numberAddedNotRemoved,
26             List<StackTraceElement> stackTraceElements) {
27         super();
28         this.exampleCloseTracked = requireNonNull(exampleCloseTracked, "closeTracked");
29         this.numberAddedNotRemoved = requireNonNull(numberAddedNotRemoved, "numberAddedNotRemoved");
30         this.stackTraceElements = requireNonNull(stackTraceElements, "stackTraceElements");
31     }
32
33     public long getNumberAddedNotRemoved() {
34         return numberAddedNotRemoved;
35     }
36
37     public CloseTracked<T> getExampleCloseTracked() {
38         return exampleCloseTracked;
39     }
40
41     public List<StackTraceElement> getStackTraceElements() {
42         return stackTraceElements;
43     }
44
45     @Override
46     public String toString() {
47         return "CloseTrackedRegistryReportEntry [numberAddedNotRemoved=" + numberAddedNotRemoved + ", closeTracked="
48                 + exampleCloseTracked + ", stackTraceElements.size=" + stackTraceElements.size() + "]";
49     }
50
51
52 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.