2 * Copyright (c) 2013 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
8 package org.opendaylight.openflowplugin.test
10 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
11 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration
12 import org.opendaylight.controller.sal.binding.api.NotificationProviderService
13 import org.opendaylight.controller.sal.binding.api.data.DataProviderService
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService
16 //import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalTableService
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
23 import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
24 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
25 import org.slf4j.LoggerFactory
28 class OpenflowpluginTableFeaturesTestServiceProvider implements AutoCloseable, SalTableService {
31 static val LOG = LoggerFactory.getLogger(OpenflowpluginTableFeaturesTestServiceProvider);
34 RoutedRpcRegistration<SalTableService> tableRegistration;
38 NotificationProviderService notificationService;
42 LOG.info("SalTableServiceProvider Started.");
48 LOG.info("SalTableServiceProvider stopped.");
49 tableRegistration.close;
53 override updateTable(UpdateTableInput input) {
54 LOG.info("updateTable - " + input);
59 def CompositeObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider> register(ProviderContext ctx) {
60 val builder = CompositeObjectRegistration
61 .<OpenflowpluginTableFeaturesTestServiceProvider> builderFor(this);
63 tableRegistration = ctx.addRoutedRpcImplementation(SalTableService, this);
64 val nodeIndentifier = InstanceIdentifier.builder(Nodes).child(Node, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)));
65 tableRegistration.registerPath(NodeContext, nodeIndentifier.toInstance());
66 builder.add(tableRegistration);
68 return builder.toInstance();