2 * Copyright (c) 2014 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.openflowplugin.applications.frm;
11 import java.util.concurrent.Future;
12 import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
16 import org.opendaylight.yangtools.yang.common.RpcResult;
19 * forwardingrules-manager
20 * org.opendaylight.openflowplugin.applications.frm
22 * ForwardingRulesCommiter
23 * It represent a contract between DataStore DataTreeModification and relevant
24 * SalRpcService for device. Every implementation has to be registered for
25 * Configurational/DS tree path.
27 public interface ForwardingRulesCommiter<D extends DataObject> extends AutoCloseable,
28 ClusteredDataTreeChangeListener<D> {
31 * Method removes DataObject which is identified by InstanceIdentifier
34 * @param identifier - the whole path to DataObject
35 * @param del - DataObject for removing
36 * @param nodeIdent Node InstanceIdentifier
38 void remove(InstanceIdentifier<D> identifier, D del,
39 InstanceIdentifier<FlowCapableNode> nodeIdent);
42 * Method updates the original DataObject to the update DataObject
43 * in device. Both are identified by same InstanceIdentifier
45 * @param identifier - the whole path to DataObject
46 * @param original - original DataObject (for update)
47 * @param update - changed DataObject (contain updates)
48 * @param nodeIdent Node InstanceIdentifier
50 void update(InstanceIdentifier<D> identifier, D original, D update,
51 InstanceIdentifier<FlowCapableNode> nodeIdent);
54 * Method adds the DataObject which is identified by InstanceIdentifier
57 * @param identifier - the whole path to new DataObject
58 * @param add - new DataObject
59 * @param nodeIdent Node InstanceIdentifier
60 * @return A future associated with RPC task. {@code null} is set to the
61 * future if this method does not invoke RPC.
63 Future<? extends RpcResult<?>> add(InstanceIdentifier<D> identifier, D add,
64 InstanceIdentifier<FlowCapableNode> nodeIdent);
68 * Method creates stale-marked DataObject which is identified by InstanceIdentifier
71 * @param identifier - the whole path to DataObject
72 * @param del - DataObject removed. Stale-Mark object to be created from this object
73 * @param nodeIdent Node InstanceIdentifier
75 void createStaleMarkEntity(InstanceIdentifier<D> identifier, D del,
76 InstanceIdentifier<FlowCapableNode> nodeIdent);
80 Future<? extends RpcResult<?>> removeWithResult(InstanceIdentifier<D> identifier, D del,
81 InstanceIdentifier<FlowCapableNode> nodeIdent);