-/**
+/*
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
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;
}
@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)
@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(),
@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);
}
@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())
@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());
}
@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)
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()));
@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());