-/**
+/*
* Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.FutureCallback;
-import java.util.Arrays;
import java.util.Collection;
import javax.annotation.Nullable;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
/**
* Util methods for {@link com.google.common.util.concurrent.ListenableFuture} chaining.
*/
-public class FxChainUtil {
+public final class FxChainUtil {
private static final Logger LOG = LoggerFactory.getLogger(FxChainUtil.class);
public void onSuccess(@Nullable final RpcResult<Void> result) {
if (result != null) {
if (result.isSuccessful()) {
- LOG.debug(prefix + " finished successfully: {}", nodeId.getValue());
+ LOG.debug("{} finished successfully: {}", prefix, nodeId.getValue());
} else {
- final Collection<RpcError> errors = MoreObjects.firstNonNull(result.getErrors(), ImmutableList.<RpcError>of());
- LOG.debug(prefix + " failed: {} -> {}", nodeId.getValue(), Arrays.toString(errors.toArray()));
+ final Collection<RpcError> errors = MoreObjects.firstNonNull(result.getErrors(),
+ ImmutableList.of());
+ LOG.debug("{} failed: {} -> {}", prefix, nodeId.getValue(), errors);
}
} else {
- LOG.debug(prefix + " reconciliation failed: {} -> null result", nodeId.getValue());
+ LOG.debug("{} reconciliation failed: {} -> null result", prefix, nodeId.getValue());
}
}
@Override
- public void onFailure(final Throwable t) {
- LOG.debug(prefix + " reconciliation failed seriously: {}", nodeId.getValue(), t);
+ public void onFailure(final Throwable failure) {
+ LOG.debug("{} reconciliation failed seriously: {}", prefix, nodeId.getValue(), failure);
}
};
}