blob: 47c326fb96df450e7304c7a0bdc92c41be798a58 [file] [log] [blame]
David Bainbridge7526c452018-04-20 14:14:37 -07001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.drivers.netconf;
17
18import java.util.Map;
19
20import javax.xml.namespace.QName;
21
22import org.onosproject.netconf.NetconfException;
23import org.onosproject.netconf.NetconfSession;
24
25public interface TemplateRequestDriver {
26
27 /**
28 * Executes the named NETCONF template against the specified session, returning
29 * the referenced XML node as the specified type.
30 *
31 * @param session
32 * NETCONF serssion
33 * @param templateName
34 * name of NETCONF request template to execute
35 * @param templateContext
36 * variable to values substitutions to be used against templates
37 * @param baseXPath
38 * XPath expression to specify the returned document node
39 * @param returnType
40 * expected return type of the referenced node
41 * @return XML document node referenced by the {@code baseXPath}
42 * @throws NetconfException
43 * if any IO, XPath, or NETCONF exception occurs
44 */
45 public Object doRequest(NetconfSession session, String templateName, Map<String, Object> templateContext,
46 String baseXPath, QName returnType) throws NetconfException;
47}