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