2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.netconf.mapping.api;
11 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
12 import org.w3c.dom.Document;
15 * NetconfOperation handles netconf requests. Multiple operations might be
16 * capable of handling one request at the same time. In such case, these
17 * operations are chained (ordered by HandlingPriority returned by canHandle
18 * method) and executed.
20 * Operation can be declared as singleton or last in chain (see abstract
21 * implementations in netconf-util). If the operation is not singleton or last,
22 * it is responsible for the execution of subsequent operation and for merging
26 public interface NetconfOperation {
29 * Singleton operations should return
30 * HandlingPriority.HANDLE_WITH_MAX_PRIORITY, last operations
31 * HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY.
33 * @param requestMessage
36 HandlingPriority canHandle(Document message) throws NetconfDocumentedException;
39 * Execute current netconf operation and trigger execution of subsequent
40 * operations. subsequentOperation parameter will provide information, if
41 * current operation is the termination point in execution. In case of
42 * last/singleton operation, subsequentOperation must indicate termination
45 * @param requestMessage
46 * @param subsequentOperation
47 * execution of subsequent netconf operation
49 * @throws NetconfDocumentedException
51 Document handle(Document requestMessage, NetconfOperationChainedExecution subsequentOperation)
52 throws NetconfDocumentedException;