Merge "Cleanup root pom "name"."
[controller.git] / opendaylight / netconf / netconf-testtool / src / main / java / org / opendaylight / controller / netconf / test / tool / rpc / SimulatedLock.java
1 /*
2  * Copyright (c) 2015 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.test.tool.rpc;
10
11 import com.google.common.base.Optional;
12 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
13 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
14 import org.opendaylight.controller.netconf.confignetconfconnector.operations.AbstractConfigNetconfOperation;
15 import org.opendaylight.controller.netconf.util.xml.XmlElement;
16 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
17 import org.w3c.dom.Document;
18 import org.w3c.dom.Element;
19
20 public class SimulatedLock extends AbstractConfigNetconfOperation {
21
22     public SimulatedLock(final String netconfSessionIdForReporting) {
23         super(null, netconfSessionIdForReporting);
24     }
25
26     @Override
27     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) throws NetconfDocumentedException {
28         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
29     }
30
31     @Override
32     protected String getOperationName() {
33         return "lock";
34     }
35 }