Renamed artifacts to reflect the project's name.
[unimgr.git] / impl / src / main / java / org / opendaylight / unimgr / command / UniDeleteCommand.java
1 /*
2  * Copyright (c) 2015 CableLabs 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 package org.opendaylight.unimgr.command;
9
10 import java.util.Map;
11 import java.util.Set;
12
13 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
14 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
15 import org.opendaylight.unimgr.impl.UnimgrUtils;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.unimgr.rev150622.Uni;
17 import org.opendaylight.yangtools.yang.binding.DataObject;
18 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21
22 public class UniDeleteCommand extends AbstractDeleteCommand {
23
24     private static final Logger LOG = LoggerFactory.getLogger(UniDeleteCommand.class);
25
26     public UniDeleteCommand(DataBroker dataBroker,
27             AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes) {
28         super.changes = changes;
29         super.dataBroker = dataBroker;
30     }
31
32     @Override
33     public void execute() {
34         Map<InstanceIdentifier<Uni>, Uni> originalUnis = UnimgrUtils.extractOriginal(changes, Uni.class);
35         Set<InstanceIdentifier<Uni>> removedUnis = UnimgrUtils.extractRemoved(changes, Uni.class);
36         if (!removedUnis.isEmpty()) {
37             for (InstanceIdentifier<Uni> removedUniIid: removedUnis) {
38                 LOG.info("Received a request to remove an UNI ", removedUniIid);
39             }
40         }
41     }
42
43 }