Improve NETCONF session ID handling
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / rpc / SimulatedCommit.java
1 /*
2  * Copyright (c) 2014 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 package org.opendaylight.netconf.test.tool.rpc;
9
10 import org.opendaylight.netconf.api.xml.XmlElement;
11 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
12 import org.opendaylight.netconf.server.api.operations.AbstractLastNetconfOperation;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.SessionIdType;
14 import org.w3c.dom.Document;
15 import org.w3c.dom.Element;
16
17 public class SimulatedCommit extends AbstractLastNetconfOperation {
18     public SimulatedCommit(final SessionIdType sessionId) {
19         super(sessionId);
20     }
21
22     @Override
23     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
24         return document.createElement(XmlNetconfConstants.OK);
25     }
26
27     @Override
28     protected String getOperationName() {
29         return XmlNetconfConstants.COMMIT;
30     }
31 }