/* * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * 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.controller.frm.group import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler import org.opendaylight.controller.sal.binding.api.data.DataProviderService import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node import org.opendaylight.yangtools.concepts.Registration import org.opendaylight.yangtools.yang.binding.DataObject import org.opendaylight.yangtools.yang.binding.InstanceIdentifier import org.slf4j.LoggerFactory class GroupProvider implements AutoCloseable { @Property DataProviderService dataService; @Property SalGroupService salGroupService; GroupCommitHandler commitHandler Registration,DataObject>> commitHandlerRegistration; static val LOG = LoggerFactory.getLogger(GroupProvider); def void start() { commitHandler = new GroupCommitHandler(salGroupService) val InstanceIdentifier path = InstanceIdentifier.builder(Nodes) .child(Node) .augmentation(FlowCapableNode) .child(Group) .toInstance(); commitHandlerRegistration = dataService.registerCommitHandler(path,commitHandler); LOG.info("Group Config Provider started."); } protected def startChange() { return dataService.beginTransaction; } override close() throws Exception { throw new UnsupportedOperationException("TODO: auto-generated method stub") } }