* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.device.initialization;
import com.google.common.base.Function;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.ArrayList;
import java.util.List;
-import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.Future;
import java.util.stream.Collectors;
return Futures.transform(
switchFeaturesMandatory ? Futures.allAsList(futures) : Futures.successfulAsList(futures),
new Function<List<RpcResult<List<OfHeader>>>, Void>() {
- @Nullable
@Override
- public Void apply(@Nullable final List<RpcResult<List<OfHeader>>> input) {
+ public Void apply(final List<RpcResult<List<OfHeader>>> input) {
LOG.info("Static node {} successfully finished collecting",
deviceContext.getDeviceInfo());
return null;
@Nullable final ConvertorExecutor convertorExecutor) {
Futures.addCallback(future, new FutureCallback<RpcResult<List<OfHeader>>>() {
@Override
- public void onSuccess(@Nonnull final RpcResult<List<OfHeader>> result) {
- if (Objects.nonNull(result.getResult())) {
+ public void onSuccess(final RpcResult<List<OfHeader>> result) {
+ if (result.getResult() != null) {
LOG.info("Static node {} info: {} collected", deviceContext.getDeviceInfo(), type);
translateAndWriteResult(
type,
result.getErrors().forEach(rpcError -> {
LOG.warn("Failed to retrieve static node {} info: {}", type, rpcError.getMessage());
- if (LOG.isTraceEnabled() && Objects.nonNull(rpcError.getCause())) {
+ if (LOG.isTraceEnabled() && rpcError.getCause() != null) {
LOG.trace("Detailed error:", rpcError.getCause());
}
});
}
@Override
- public void onFailure(@Nonnull final Throwable throwable) {
+ public void onFailure(final Throwable throwable) {
LOG.warn("Request of type {} for static info of node {} failed.",
type, deviceContext.getDeviceInfo());
}
final DeviceContext deviceContext,
@Nullable final MultipartWriterProvider multipartWriterProvider,
@Nullable final ConvertorExecutor convertorExecutor) {
- if (Objects.nonNull(result)) {
+ if (result != null) {
try {
result.forEach(reply -> {
// First, translate collected data to proper openflowplugin representation
return Futures.transform(service.handleServiceCall(multipartType),
input -> {
- if (Objects.isNull(input.getResult()) && input.isSuccessful()) {
+ if (input.getResult() == null && input.isSuccessful()) {
return RpcResultBuilder.<List<OfHeader>>success(null).build();
}
new MultiLayerMultipartCollectorService(deviceContext, deviceContext);
return Futures.transform(service.handleServiceCall(multipartType), input -> {
- if (Objects.isNull(input.getResult()) && input.isSuccessful()) {
+ if (input.getResult() == null && input.isSuccessful()) {
return RpcResultBuilder.<List<OfHeader>>success(null).build();
}
: RpcResultBuilder.<List<OfHeader>>failed().withRpcErrors(input.getErrors()).build();
}, MoreExecutors.directExecutor());
}
-
}