2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.netconf.api.jmx;
12 import javax.management.Notification;
13 import javax.management.NotificationBroadcasterSupport;
14 import org.w3c.dom.Element;
16 public abstract class NetconfJMXNotification extends Notification {
21 private static final long serialVersionUID = 6754474563863772845L;
23 private static long sequenceNumber = 1;
25 private final TransactionProviderJMXNotificationType type;
27 protected NetconfJMXNotification(TransactionProviderJMXNotificationType type,
28 NotificationBroadcasterSupport source, String message) {
29 super(type.toString(), source, sequenceNumber++, System.nanoTime(), message);
34 public String toString() {
35 return "TransactionProviderJMXNotification [type=" + type + "]";
39 * Sends this notification using source that created it
42 ((NotificationBroadcasterSupport) getSource()).sendNotification(this);
46 * Creates notification about successful commit execution.
48 * Intended for config-persister.
50 * @param transactionName
53 public static CommitJMXNotification afterCommit(NotificationBroadcasterSupport source, String message,
54 Element cfgSnapshot, Set<String> capabilities) {
55 return new CommitJMXNotification(source, message, cfgSnapshot, capabilities);
58 static enum TransactionProviderJMXNotificationType {