X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-mapping-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fmapping%2Fapi%2FNetconfOperation.java;h=00b3124e7f19076b96ddadae22c0599228c75783;hb=refs%2Fchanges%2F13%2F23413%2F26;hp=58857b4438fef15e208f397b9e61167230867b70;hpb=a92d9d6a21a0f6ca8d2153795721f500eaf29ee9;p=controller.git diff --git a/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperation.java b/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperation.java index 58857b4438..00b3124e7f 100644 --- a/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperation.java +++ b/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperation.java @@ -8,13 +8,46 @@ package org.opendaylight.controller.netconf.mapping.api; -import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfOperationRouter; +import org.opendaylight.controller.config.util.xml.DocumentedException; import org.w3c.dom.Document; +/** + * NetconfOperation handles netconf requests. Multiple operations might be + * capable of handling one request at the same time. In such case, these + * operations are chained (ordered by HandlingPriority returned by canHandle + * method) and executed. + * + * Operation can be declared as singleton or last in chain (see abstract + * implementations in netconf-util). If the operation is not singleton or last, + * it is responsible for the execution of subsequent operation and for merging + * the results. + * + */ public interface NetconfOperation { - HandlingPriority canHandle(Document message); + /** + * Singleton operations should return + * HandlingPriority.HANDLE_WITH_MAX_PRIORITY, last operations + * HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY. + * + * @param requestMessage + * @return + */ + HandlingPriority canHandle(Document message) throws DocumentedException; - Document handle(Document message, NetconfOperationRouter operationRouter) throws NetconfDocumentedException; + /** + * Execute current netconf operation and trigger execution of subsequent + * operations. subsequentOperation parameter will provide information, if + * current operation is the termination point in execution. In case of + * last/singleton operation, subsequentOperation must indicate termination + * point. + * + * @param requestMessage + * @param subsequentOperation + * execution of subsequent netconf operation + * @return + * @throws DocumentedException + */ + Document handle(Document requestMessage, NetconfOperationChainedExecution subsequentOperation) + throws DocumentedException; }