/* * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * 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.applications.frm.impl; import com.google.common.util.concurrent.ListenableFuture; import java.util.ArrayList; import java.util.List; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutputBuilder; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; public class SalFlowServiceMock implements SalFlowService { private final List addFlowCalls = new ArrayList<>(); private final List removeFlowCalls = new ArrayList<>(); private final List updateFlowCalls = new ArrayList<>(); @Override public ListenableFuture> addFlow(AddFlowInput input) { addFlowCalls.add(input); return RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture(); } @Override public ListenableFuture> removeFlow(RemoveFlowInput input) { removeFlowCalls.add(input); return RpcResultBuilder.success(new RemoveFlowOutputBuilder().build()).buildFuture(); } @Override public ListenableFuture> updateFlow(UpdateFlowInput input) { updateFlowCalls.add(input); return RpcResultBuilder.success(new UpdateFlowOutputBuilder().build()).buildFuture(); } public List getAddFlowCalls() { return addFlowCalls; } public List getRemoveFlowCalls() { return removeFlowCalls; } public List getUpdateFlowCalls() { return updateFlowCalls; } }