Fixing + testing meter services
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / util / MdSalRegistratorUtils.java
1 /**
2  * Copyright (c) 2015 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.impl.util;
9
10 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
11 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext;
12 import org.opendaylight.openflowplugin.impl.services.NodeConfigServiceImpl;
13 import org.opendaylight.openflowplugin.impl.services.PacketProcessingServiceImpl;
14 import org.opendaylight.openflowplugin.impl.services.SalFlowServiceImpl;
15 import org.opendaylight.openflowplugin.impl.services.SalGroupServiceImpl;
16 import org.opendaylight.openflowplugin.impl.services.SalMeterServiceImpl;
17 import org.opendaylight.openflowplugin.impl.services.SalTableServiceImpl;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.NodeConfigService;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
24
25 /**
26  * @author joe
27  */
28 public class MdSalRegistratorUtils {
29
30     private MdSalRegistratorUtils() {
31         throw new IllegalStateException();
32     }
33
34     public static void registerServices(final RpcContext rpcContext, final DeviceContext deviceContext) {
35         rpcContext.registerRpcServiceImplementation(SalFlowService.class, new SalFlowServiceImpl(rpcContext, deviceContext));
36         //TODO: add constructors with rcpContext and deviceContext to meter, group, table constructors
37         rpcContext.registerRpcServiceImplementation(SalMeterService.class, new SalMeterServiceImpl(rpcContext, deviceContext));
38         rpcContext.registerRpcServiceImplementation(SalGroupService.class, new SalGroupServiceImpl(rpcContext, deviceContext));
39         rpcContext.registerRpcServiceImplementation(SalTableService.class, new SalTableServiceImpl());
40         rpcContext.registerRpcServiceImplementation(PacketProcessingService.class, new PacketProcessingServiceImpl(rpcContext, deviceContext));
41         rpcContext.registerRpcServiceImplementation(NodeConfigService.class, new NodeConfigServiceImpl());
42     }
43 }