Merge branch 'master' of ../controller
[yangtools.git] / common / util / src / main / java / org / opendaylight / yangtools / util / concurrent / ListenerNotificationQueueStats.java
1 /*
2  * Copyright (c) 2014 Brocade Communications 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.yangtools.util.concurrent;
9
10 import static java.util.Objects.requireNonNull;
11
12 import javax.management.ConstructorParameters;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14
15 /**
16  * Class used by the {@link QueuedNotificationManager} that contains a snapshot of notification
17  * queue statistics for a listener.
18  *
19  * @author Thomas Pantelis
20  * @see QueuedNotificationManager
21  */
22 @NonNullByDefault
23 public class ListenerNotificationQueueStats {
24     private final String listenerClassName;
25     private final int currentQueueSize;
26
27     @ConstructorParameters({ "listenerClassName", "currentQueueSize" })
28     public ListenerNotificationQueueStats(final String listenerClassName, final int currentQueueSize) {
29         this.listenerClassName = requireNonNull(listenerClassName);
30         this.currentQueueSize = currentQueueSize;
31     }
32
33     /**
34      * Returns the name of the listener class.
35      */
36     public String getListenerClassName() {
37         return listenerClassName;
38     }
39
40     /**
41      * Returns the current notification queue size.
42      */
43     public int getCurrentQueueSize() {
44         return currentQueueSize;
45     }
46 }