2 * Copyright (c) 2017 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.groupbasedpolicy.neutron.vpp.mapper.processors;
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.Subnets;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.subnets.Subnet;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
20 * Created by Shakib Ahmed on 4/3/17.
22 public class SubnetAware implements MappingProvider<Subnet>{
23 private static final Logger LOG = LoggerFactory.getLogger(SubnetAware.class);
25 private SubnetHandler subnetHandler;
27 public SubnetAware(DataBroker dataBroker) {
28 subnetHandler = new SubnetHandler(dataBroker);
32 public InstanceIdentifier<Subnet> getNeutronDtoIid() {
33 return InstanceIdentifier.builder(Neutron.class).child(Subnets.class).child(Subnet.class).build();
37 public void processCreatedNeutronDto(Subnet subnet) {
38 LOG.debug("Got create for subnet: {}", subnet.getUuid().getValue());
39 subnetHandler.processCreatedNeutronDto(subnet);
43 public void processUpdatedNeutronDto(Subnet original, Subnet delta) {
44 LOG.debug("Got update of subnet: {}", original.getUuid().getValue());
45 subnetHandler.processUpdatedNeutronDto(original, delta);
49 public void processDeletedNeutronDto(Subnet subnet) {
50 LOG.debug("Got delete of subnet: {}", subnet.getUuid().getValue());
51 subnetHandler.processDeletedNeutronDto(subnet);