2 * Copyright (c) 2015 Inocybe Technologies 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.renderer.iovisor.endpoint;
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
13 import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
14 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
15 import org.opendaylight.groupbasedpolicy.util.DataTreeChangeHandler;
16 import org.opendaylight.groupbasedpolicy.util.IidFactory;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3;
18 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
20 public class EndpointListener extends DataTreeChangeHandler<EndpointL3> {
22 private final EndpointManager endpointManager;
24 public EndpointListener(DataBroker dataProvider, EndpointManager endpointManager) {
26 new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, IidFactory.l3EndpointsIidWildcard()));
27 this.endpointManager = endpointManager;
31 protected void onWrite(DataObjectModification<EndpointL3> rootNode, InstanceIdentifier<EndpointL3> rootIdentifier) {
32 onSubtreeModified(rootNode, rootIdentifier);
36 protected void onDelete(DataObjectModification<EndpointL3> rootNode,
37 InstanceIdentifier<EndpointL3> rootIdentifier) {
38 throw new UnsupportedOperationException("Not implemented yet.");
42 protected void onSubtreeModified(DataObjectModification<EndpointL3> rootNode,
43 InstanceIdentifier<EndpointL3> rootIdentifier) {
44 endpointManager.processEndpoint(rootNode.getDataAfter());