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;
13 import javax.management.Notification;
14 import javax.management.NotificationBroadcasterSupport;
16 import org.w3c.dom.Element;
18 public abstract class NetconfJMXNotification extends Notification {
23 private static final long serialVersionUID = 6754474563863772845L;
25 private static long sequenceNumber = 1;
27 private final TransactionProviderJMXNotificationType type;
29 protected NetconfJMXNotification(TransactionProviderJMXNotificationType type,
30 NotificationBroadcasterSupport source, String message) {
31 super(type.toString(), source, sequenceNumber++, System.nanoTime(), message);
36 public String toString() {
37 return "TransactionProviderJMXNotification [type=" + type + "]";
41 * Sends this notification using source that created it
44 ((NotificationBroadcasterSupport) getSource()).sendNotification(this);
48 * Creates notification about successful commit execution.
50 * Intended for config-persister.
52 * @param transactionName
55 public static CommitJMXNotification afterCommit(NotificationBroadcasterSupport source, String message,
56 Element cfgSnapshot, Set<String> capabilities) {
57 return new CommitJMXNotification(source, message, cfgSnapshot, capabilities);
60 static enum TransactionProviderJMXNotificationType {