Merge "Added a signum to the SetMetaDataMask BigInt constructor"
[openflowplugin.git] / test-provider / src / main / java / org / opendaylight / openflowplugin / test / OpenflowpluginGroupTestServiceProvider.xtend
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  * 
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
7  */
8 package org.opendaylight.openflowplugin.test
9
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
25
26 class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, SalGroupService {
27
28
29     static val LOG = LoggerFactory.getLogger(OpenflowpluginGroupTestServiceProvider);
30     
31     @Property
32     RoutedRpcRegistration<SalGroupService> groupRegistration;
33         
34
35     @Property
36     NotificationProviderService notificationService;
37
38
39     def void start() {
40         LOG.info("SalGroupServiceProvider Started.");
41         
42     }
43
44
45     override close() {
46        LOG.info("SalGroupServiceProvide stopped.");
47         groupRegistration.close;
48     }
49     
50     override addGroup(AddGroupInput input) {
51         LOG.info("addGroup - " + input);
52         return null;
53         
54     }
55     
56     override removeGroup(RemoveGroupInput input) {
57         LOG.info("removeGroup - " + input);
58         return null;
59     }
60     
61     override updateGroup(UpdateGroupInput input) {
62         LOG.info("updateGroup - " + input);
63         return null;
64     }
65     
66     
67     def CompositeObjectRegistration<OpenflowpluginGroupTestServiceProvider> register(ProviderContext ctx) {
68         val builder = CompositeObjectRegistration
69                 .<OpenflowpluginGroupTestServiceProvider> builderFor(this);
70
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);
75
76         return builder.toInstance();
77     }
78     
79 }
80
81