* 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.services.sal;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
-import java.util.Objects;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerGetAsyncConfigService;
public SalAsyncConfigServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
setAsyncConfigService = new SingleLayerSetAsyncConfigService(requestContextStack, deviceContext);
- this.getAsyncConfigService = new SingleLayerGetAsyncConfigService(requestContextStack, deviceContext);
+ getAsyncConfigService = new SingleLayerGetAsyncConfigService(requestContextStack, deviceContext);
}
@Override
- public ListenableFuture<RpcResult<SetAsyncOutput>> setAsync(SetAsyncInput input) {
+ public ListenableFuture<RpcResult<SetAsyncOutput>> setAsync(final SetAsyncInput input) {
return setAsyncConfigService.handleServiceCall(input);
}
@Override
- public ListenableFuture<RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input) {
+ public ListenableFuture<RpcResult<GetAsyncOutput>> getAsync(final GetAsyncInput input) {
return Futures.transform(getAsyncConfigService.handleServiceCall(input), result ->
- Objects.nonNull(result) && result.isSuccessful()
- ? RpcResultBuilder.success(new GetAsyncOutputBuilder(result.getResult())).build()
+ result != null && result.isSuccessful()
+ ? RpcResultBuilder.success(new GetAsyncOutputBuilder(result.getResult()).build()).build()
: RpcResultBuilder.<GetAsyncOutput>failed().build(),
MoreExecutors.directExecutor());
}