2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.openflowplugin.impl.callback;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
12 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
13 import org.opendaylight.yangtools.yang.common.RpcResult;
15 public abstract class SuccessCallback<I, O> extends BaseCallback<I, O> {
17 public SuccessCallback(final DeviceContext deviceContext, final RequestContext<O> requestContext,
18 final ListenableFuture<RpcResult<I>> futureResultFromOfLib) {
19 super(deviceContext, requestContext, futureResultFromOfLib);
23 protected void processSuccess(final RpcResult<I> rpcResult) {
24 getRequestContext().setResult(transform(rpcResult));
27 abstract public RpcResult<O> transform(RpcResult<I> rpcResult);