Bump odlparent to 5.0.0
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / sal / SalGroupServiceImpl.java
old mode 100644 (file)
new mode 100755 (executable)
index 042e5a8..7c14b0d
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -11,7 +11,6 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
-import java.util.concurrent.Future;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.impl.services.multilayer.MultiLayerGroupService;
@@ -66,7 +65,7 @@ public class SalGroupServiceImpl implements SalGroupService {
     }
 
     @Override
-    public Future<RpcResult<AddGroupOutput>> addGroup(final AddGroupInput input) {
+    public ListenableFuture<RpcResult<AddGroupOutput>> addGroup(final AddGroupInput input) {
         final ListenableFuture<RpcResult<AddGroupOutput>> resultFuture =
             addGroupMessage.canUseSingleLayerSerialization()
             ? addGroupMessage.handleServiceCall(input)
@@ -76,10 +75,7 @@ public class SalGroupServiceImpl implements SalGroupService {
             @Override
             public void onSuccess(RpcResult<AddGroupOutput> result) {
                 if (result.isSuccessful()) {
-                    if (LOG.isDebugEnabled()) {
-                        LOG.debug("Group add with id={} finished without error", input.getGroupId().getValue());
-                    }
-                    deviceContext.getDeviceGroupRegistry().store(input.getGroupId());
+                    LOG.debug("adding group successful {}", input.getGroupId().getValue());
                 } else {
                     if (LOG.isDebugEnabled()) {
                         LOG.debug("Group add with id={} failed, errors={}", input.getGroupId().getValue(),
@@ -90,7 +86,7 @@ public class SalGroupServiceImpl implements SalGroupService {
 
             @Override
             public void onFailure(Throwable throwable) {
-                LOG.warn("Service call for adding group={} failed, reason: {}",
+                LOG.warn("Service call for adding group={} failed",
                           input.getGroupId().getValue(),
                           throwable);
             }
@@ -100,7 +96,7 @@ public class SalGroupServiceImpl implements SalGroupService {
 
 
     @Override
-    public Future<RpcResult<UpdateGroupOutput>> updateGroup(final UpdateGroupInput input) {
+    public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(final UpdateGroupInput input) {
         final ListenableFuture<RpcResult<UpdateGroupOutput>> resultFuture =
             updateGroupMessage.canUseSingleLayerSerialization()
             ? updateGroupMessage.handleServiceCall(input.getUpdatedGroup())
@@ -123,7 +119,7 @@ public class SalGroupServiceImpl implements SalGroupService {
 
             @Override
             public void onFailure(Throwable throwable) {
-                LOG.warn("Service call for updating group={} failed, reason: {}",
+                LOG.warn("Service call for updating group={} failed",
                         input.getOriginalGroup().getGroupId(), throwable);
             }
         }, MoreExecutors.directExecutor());
@@ -131,7 +127,7 @@ public class SalGroupServiceImpl implements SalGroupService {
     }
 
     @Override
-    public Future<RpcResult<RemoveGroupOutput>> removeGroup(final RemoveGroupInput input) {
+    public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(final RemoveGroupInput input) {
         final ListenableFuture<RpcResult<RemoveGroupOutput>> resultFuture =
             removeGroupMessage.canUseSingleLayerSerialization()
             ? removeGroupMessage.handleServiceCall(input)
@@ -144,7 +140,6 @@ public class SalGroupServiceImpl implements SalGroupService {
                     if (LOG.isDebugEnabled()) {
                         LOG.debug("Group remove with id={} finished without error", input.getGroupId().getValue());
                     }
-                    removeGroup.getDeviceRegistry().getDeviceGroupRegistry().addMark(input.getGroupId());
                 } else {
                     LOG.warn("Group remove with id={} failed, errors={}", input.getGroupId().getValue(),
                         ErrorUtil.errorsToString(result.getErrors()));
@@ -154,7 +149,7 @@ public class SalGroupServiceImpl implements SalGroupService {
 
             @Override
             public void onFailure(Throwable throwable) {
-                LOG.warn("Service call for removing group={} failed, reason: {}",
+                LOG.warn("Service call for removing group={} failed",
                         input.getGroupId().getValue(), throwable);
             }
         }, MoreExecutors.directExecutor());