* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.applications.notification.supplier.impl.item;
import com.google.common.base.Preconditions;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAdded;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAddedBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupUpdatedBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
* Implementation define a contract between {@link Group} data object
* and {@link GroupAdded}, {@link GroupUpdated} and {@link GroupRemoved} notifications.
*/
-public class GroupNotificationSupplierImpl extends
- AbstractNotificationSupplierForItem<Group, GroupAdded, GroupUpdated, GroupRemoved> {
+public class GroupNotificationSupplierImpl extends AbstractNotificationSupplierForItem<Group, GroupAdded,
+ GroupUpdated, GroupRemoved> {
- private static final InstanceIdentifier<Group> wildCardedInstanceIdent = getNodeWildII().augmentation(FlowCapableNode.class).child(Group.class);
+ private static final InstanceIdentifier<Group> GROUP_INSTANCE_IDENTIFIER = getNodeWildII()
+ .augmentation(FlowCapableNode.class).child(Group.class);
/**
- * Constructor register supplier as DataChangeLister and create wildCarded InstanceIdentifier.
+ * Constructor register supplier as DataTreeChangeListener and create wildCarded InstanceIdentifier.
*
- * @param notifProviderService - {@link NotificationProviderService}
- * @param db - {@link DataBroker}
+ * @param notifProviderService - {@link NotificationPublishService}
+ * @param db - {@link DataBroker}
*/
- public GroupNotificationSupplierImpl(final NotificationProviderService notifProviderService, final DataBroker db) {
+ public GroupNotificationSupplierImpl(final NotificationPublishService notifProviderService, final DataBroker db) {
super(notifProviderService, db, Group.class);
}
@Override
public InstanceIdentifier<Group> getWildCardPath() {
- return wildCardedInstanceIdent;
+ return GROUP_INSTANCE_IDENTIFIER;
}
@Override
- public GroupAdded createNotification(final Group o, final InstanceIdentifier<Group> path) {
- Preconditions.checkArgument(o != null);
+ public GroupAdded createNotification(final Group dataTreeItemObject, final InstanceIdentifier<Group> path) {
+ Preconditions.checkArgument(dataTreeItemObject != null);
Preconditions.checkArgument(path != null);
- final GroupAddedBuilder builder = new GroupAddedBuilder(o);
+ final GroupAddedBuilder builder = new GroupAddedBuilder(dataTreeItemObject);
builder.setGroupRef(new GroupRef(path));
builder.setNode(createNodeRef(path));
return builder.build();
}
@Override
- public GroupUpdated updateNotification(final Group o, final InstanceIdentifier<Group> path) {
- Preconditions.checkArgument(o != null);
+ public GroupUpdated updateNotification(final Group group, final InstanceIdentifier<Group> path) {
+ Preconditions.checkArgument(group != null);
Preconditions.checkArgument(path != null);
- final GroupUpdatedBuilder builder = new GroupUpdatedBuilder(o);
+ final GroupUpdatedBuilder builder = new GroupUpdatedBuilder(group);
builder.setGroupRef(new GroupRef(path));
builder.setNode(createNodeRef(path));
return builder.build();
public GroupRemoved deleteNotification(final InstanceIdentifier<Group> path) {
Preconditions.checkArgument(path != null);
final GroupRemovedBuilder builder = new GroupRemovedBuilder();
- builder.setGroupId(path.firstKeyOf(Group.class, GroupKey.class).getGroupId());
+ builder.setGroupId(path.firstKeyOf(Group.class).getGroupId());
builder.setGroupRef(new GroupRef(path));
builder.setNode(createNodeRef(path));
return builder.build();