Fix raw references to Iterator
[controller.git] / opendaylight / netconf / netconf-api / src / main / java / org / opendaylight / controller / netconf / api / jmx / CommitJMXNotification.java
1 /*
2  * Copyright (c) 2013 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
9 package org.opendaylight.controller.netconf.api.jmx;
10
11 import org.w3c.dom.Element;
12
13 import javax.management.NotificationBroadcasterSupport;
14 import java.util.Set;
15
16 public class CommitJMXNotification extends NetconfJMXNotification {
17
18     private final Element configSnapshot;
19
20     private static final String AFTER_COMMIT_MESSAGE_TEMPLATE = "Commit successful: %s";
21     private final Set<String> capabilities;
22
23     CommitJMXNotification(NotificationBroadcasterSupport source, String message, Element cfgSnapshot,
24             Set<String> capabilities) {
25         super(TransactionProviderJMXNotificationType.commit, source, String.format(AFTER_COMMIT_MESSAGE_TEMPLATE, message));
26         this.configSnapshot = cfgSnapshot;
27         this.capabilities = capabilities;
28     }
29
30     public Element getConfigSnapshot() {
31         return configSnapshot;
32     }
33
34     public Set<String> getCapabilities() {
35         return capabilities;
36     }
37
38     @Override
39     public String toString() {
40         final StringBuffer sb = new StringBuffer("CommitJMXNotification{");
41         sb.append("configSnapshot=").append(configSnapshot);
42         sb.append(", capabilities=").append(getCapabilities());
43         sb.append('}');
44         return sb.toString();
45     }
46
47     /**
48      *
49      */
50     private static final long serialVersionUID = -8587623362011695514L;
51
52 }