SalFlowServiceImpl - implementing methods
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / SalGroupServiceImpl.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.services;
9
10 import java.util.concurrent.Future;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutput;
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.group.service.rev130918.UpdateGroupOutput;
18 import org.opendaylight.yangtools.yang.common.RpcResult;
19 import org.slf4j.Logger;
20
21 /**
22  * @author joe
23  */
24 public class SalGroupServiceImpl extends CommonService implements SalGroupService {
25
26     private static final Logger LOG = org.slf4j.LoggerFactory.getLogger(SalGroupServiceImpl.class);
27
28     @Override
29     public Future<RpcResult<AddGroupOutput>> addGroup(final AddGroupInput input) {
30         // LOG.debug("Calling the GroupMod RPC method on MessageDispatchService");
31         //
32         // ListenableFuture<RpcResult<UpdateGroupOutput>> result = SettableFuture.create();
33         //
34         // // Convert the AddGroupInput to GroupModInput
35         // final GroupModInputBuilder ofGroupModInput = GroupConvertor.toGroupModInput(input, version, datapathId);
36         // final Xid xId = deviceContext.getNextXid();
37         // ofGroupModInput.setXid(xId.getValue());
38         //
39         // final Future<RpcResult<UpdateGroupOutput>> resultFromOFLib = messageService.groupMod(ofGroupModInput.build(),
40         // cookie);
41         // result = JdkFutureAdapters.listenInPoolThread(resultFromOFLib);
42         //
43         // result = chainFutureBarrier(result);
44         // hookFutureNotification(result, notificationProviderService, createGroupAddedNotification(input));
45         //
46         // return Futures.transform(result, OFRpcFutureResultTransformFactory.createForAddGroupOutput());
47         return null;
48     }
49
50     @Override
51     public Future<RpcResult<UpdateGroupOutput>> updateGroup(final UpdateGroupInput input) {
52         // LOG.debug("Calling the update Group Mod RPC method on MessageDispatchService");
53         //
54         // // use primary connection
55         //
56         // ListenableFuture<RpcResult<UpdateGroupOutput>> result = null;
57         //
58         // // Convert the UpdateGroupInput to GroupModInput
59         // final GroupModInputBuilder ofGroupModInput = GroupConvertor.toGroupModInput(input.getUpdatedGroup(), version,
60         // datapathId);
61         // final Xid xId = deviceContext.getNextXid();
62         // ofGroupModInput.setXid(xId.getValue());
63         //
64         // final Future<RpcResult<UpdateGroupOutput>> resultFromOFLib = messageService.groupMod(ofGroupModInput.build(),
65         // cookie);
66         // result = JdkFutureAdapters.listenInPoolThread(resultFromOFLib);
67         //
68         // result = chainFutureBarrier(result);
69         // hookFutureNotification(result, notificationProviderService, createGroupUpdatedNotification(input));
70         //
71         // return result;
72         return null;
73     }
74
75     @Override
76     public Future<RpcResult<RemoveGroupOutput>> removeGroup(final RemoveGroupInput input) {
77         // LOG.debug("Calling the Remove Group RPC method on MessageDispatchService");
78         //
79         // ListenableFuture<RpcResult<UpdateGroupOutput>> result = SettableFuture.create();
80         //
81         // // Convert the AddGroupInput to GroupModInput
82         // final GroupModInputBuilder ofGroupModInput = GroupConvertor.toGroupModInput(input, version, datapathId);
83         // final Xid xId = deviceContext.getNextXid();
84         // ofGroupModInput.setXid(xId.getValue());
85         //
86         // final Future<RpcResult<UpdateGroupOutput>> resultFromOFLib = messageService.groupMod(ofGroupModInput.build(),
87         // cookie);
88         // result = JdkFutureAdapters.listenInPoolThread(resultFromOFLib);
89         //
90         // result = chainFutureBarrier(result);
91         // hookFutureNotification(result, notificationProviderService, createGroupRemovedNotification(input));
92         //
93         // return Futures.transform(result, OFRpcFutureResultTransformFactory.createForRemoveGroupOutput());
94         return null;
95     }
96
97 }