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.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
22 import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
23 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
24 import org.slf4j.LoggerFactory
26 class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, SalGroupService {
29 static val LOG = LoggerFactory.getLogger(OpenflowpluginGroupTestServiceProvider);
32 RoutedRpcRegistration<SalGroupService> groupRegistration;
36 NotificationProviderService notificationService;
40 LOG.info("SalGroupServiceProvider Started.");
46 LOG.info("SalGroupServiceProvide stopped.");
47 groupRegistration.close;
50 override addGroup(AddGroupInput input) {
51 LOG.info("addGroup - " + input);
56 override removeGroup(RemoveGroupInput input) {
57 LOG.info("removeGroup - " + input);
61 override updateGroup(UpdateGroupInput input) {
62 LOG.info("updateGroup - " + input);
67 def CompositeObjectRegistration<OpenflowpluginGroupTestServiceProvider> register(ProviderContext ctx) {
68 val builder = CompositeObjectRegistration
69 .<OpenflowpluginGroupTestServiceProvider> builderFor(this);
71 groupRegistration = ctx.addRoutedRpcImplementation(SalGroupService, this);
72 val nodeIndentifier = InstanceIdentifier.builder(Nodes).child(Node, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)));
73 groupRegistration.registerPath(NodeContext, nodeIndentifier.toInstance());
74 builder.add(groupRegistration);
76 return builder.toInstance();