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
8 package org.opendaylight.openflowplugin.applications.frm;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
13 import org.opendaylight.yangtools.yang.binding.DataObject;
14 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
15 import org.opendaylight.yangtools.yang.common.RpcResult;
18 * forwardingrules-manager org.opendaylight.openflowplugin.applications.frm
21 * ForwardingRulesCommiter It represent a contract between DataStore
22 * DataTreeModification and relevant SalRpcService for device. Every
23 * implementation has to be registered for Configurational/DS tree path.
25 public interface ForwardingRulesCommiter<D extends DataObject> extends DataTreeChangeListener<D>, AutoCloseable {
27 * Method removes DataObject which is identified by InstanceIdentifier from
31 * - the whole path to DataObject
33 * - DataObject for removing
35 * Node InstanceIdentifier
37 void remove(InstanceIdentifier<D> identifier, D del, InstanceIdentifier<FlowCapableNode> nodeIdent);
40 * Method updates the original DataObject to the update DataObject in device.
41 * Both are identified by same InstanceIdentifier
44 * - the whole path to DataObject
46 * - original DataObject (for update)
48 * - changed DataObject (contain updates)
50 * Node InstanceIdentifier
52 void update(InstanceIdentifier<D> identifier, D original, D update, InstanceIdentifier<FlowCapableNode> nodeIdent);
55 * Method adds the DataObject which is identified by InstanceIdentifier to
59 * - the whole path to new DataObject
63 * Node InstanceIdentifier
64 * @return A future associated with RPC task. {@code null} is set to the future
65 * if this method does not invoke RPC.
67 ListenableFuture<? extends RpcResult<?>> add(InstanceIdentifier<D> identifier, D add,
68 InstanceIdentifier<FlowCapableNode> nodeIdent);
71 * Method creates stale-marked DataObject which is identified by
72 * InstanceIdentifier from device.
75 * - the whole path to DataObject
77 * - DataObject removed. Stale-Mark object to be created from this
80 * Node InstanceIdentifier
82 void createStaleMarkEntity(InstanceIdentifier<D> identifier, D del, InstanceIdentifier<FlowCapableNode> nodeIdent);
84 ListenableFuture<? extends RpcResult<?>> removeWithResult(InstanceIdentifier<D> identifier, D del,
85 InstanceIdentifier<FlowCapableNode> nodeIdent);