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
8 package org.opendaylight.controller.netconf.util.mapping;
10 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
11 import org.opendaylight.controller.netconf.mapping.api.HandlingPriority;
12 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution;
13 import org.opendaylight.controller.netconf.util.xml.XmlElement;
14 import org.w3c.dom.Document;
15 import org.w3c.dom.Element;
17 import com.google.common.base.Preconditions;
19 public abstract class AbstractLastNetconfOperation extends AbstractNetconfOperation {
21 protected AbstractLastNetconfOperation(String netconfSessionIdForReporting) {
22 super(netconfSessionIdForReporting);
26 protected Element handle(Document document, XmlElement operationElement,
27 NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
28 Preconditions.checkArgument(subsequentOperation.isExecutionTermination(),
29 "No netconf operation expected to be subsequent to %s, but is %s", this, subsequentOperation);
31 return handleWithNoSubsequentOperations(document, operationElement);
35 protected HandlingPriority getHandlingPriority() {
36 return HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY;
39 protected abstract Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException;