BUG-4117: Migrating notification-supplier from DCN to DTCN
[openflowplugin.git] / applications / notification-supplier / src / main / java / org / opendaylight / openflowplugin / applications / notification / supplier / NotificationSupplierForItem.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.openflowplugin.applications.notification.supplier;
10
11 import org.opendaylight.yangtools.yang.binding.DataObject;
12 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
13 import org.opendaylight.yangtools.yang.binding.Notification;
14
15 /**
16  * Supplier Item contracts definition for every Notification. All items are described
17  * by three notifications. Notification for Create, Update and Delete. So interface
18  * has to contain three methods for every Notification.
19  *
20  * @param <O> - data tree item Object
21  * @param <C> - Create notification
22  * @param <U> - Update notification
23  * @param <D> - Delete notification
24  */
25 public interface NotificationSupplierForItem<O extends DataObject,
26                                          C extends Notification,
27                                          U extends Notification,
28                                          D extends Notification>
29         extends NotificationSupplierDefinition<O> {
30
31     /**
32      * Method produces relevant addItem kind of {@link Notification} from
33      * data tree item identified by {@link InstanceIdentifier} path.
34      *
35      * @param o - Data Tree Item object
36      * @param path - Identifier of Data Tree Item
37      * @return {@link Notification} - relevant API contract Notification
38      */
39      C createNotification(O o, InstanceIdentifier<O> path);
40
41     /**
42      * Method produces relevant updateItem kind of {@link Notification} from
43      * data tree item identified by {@link InstanceIdentifier} path.
44      *
45      * @param o - Data Tree Item object
46      * @param path - Identifier of Data Tree Item
47      * @return {@link Notification} - relevant API contract Notification
48      */
49     U updateNotification(O o, InstanceIdentifier<O> path);
50
51     /**
52      * Method produces relevant deleteItem kind of {@link Notification} from
53      * path {@link InstanceIdentifier} to deleted item.
54      *
55      * @param path - Identifier of Data Tree Item
56      * @return {@link Notification} - relevant API contract Notification
57      */
58      D deleteNotification(InstanceIdentifier<O> path);
59 }
60