Remove unused exceptions
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / rpc / SimulatedDiscardChanges.java
1 /*
2  * Copyright (c) 2016 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.netconf.test.tool.rpc;
10
11 import com.google.common.base.Optional;
12 import org.opendaylight.netconf.api.xml.XmlElement;
13 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
14 import org.opendaylight.netconf.api.xml.XmlUtil;
15 import org.opendaylight.netconf.util.mapping.AbstractLastNetconfOperation;
16 import org.w3c.dom.Document;
17 import org.w3c.dom.Element;
18
19 public class SimulatedDiscardChanges extends AbstractLastNetconfOperation {
20
21     public SimulatedDiscardChanges(final String netconfSessionIdForReporting) {
22         super(netconfSessionIdForReporting);
23     }
24
25     @Override
26     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
27         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
28     }
29
30     @Override
31     protected String getOperationName() {
32         return "discard-changes";
33     }
34 }