public AddFlowInputBuilder(AddFlowInput base) { this._bufferId = base.getBufferId(); this._containerName = base.getContainerName(); this._cookie = base.getCookie(); this._cookieMask = base.getCookieMask(); this._flags = base.getFlags(); this._flowName = base.getFlowName(); this._flowRef = base.getFlowRef(); this._flowTable = base.getFlowTable(); this._hardTimeout = base.getHardTimeout(); this._idleTimeout = base.getIdleTimeout(); this._instructions = base.getInstructions(); this._match = base.getMatch(); this._node = base.getNode(); this._outGroup = base.getOutGroup(); this._outPort = base.getOutPort(); this._priority = base.getPriority(); this._tableId = base.getTableId(); this._transactionUri = base.getTransactionUri(); this._barrier = base.isBarrier(); this._installHw = base.isInstallHw(); this._strict = base.isStrict(); if (base instanceof AddFlowInputImpl) { AddFlowInputImpl impl = (AddFlowInputImpl) base;
/** * Verify the specified table miss flow entry. * * @param input An add-flow input to be verified. * @throws IllegalArgumentException * The specified table miss flow entry is invalid. */ private void verifyTableMissFlowEntry(AddFlowInput input) { if (!isOpenflow13(ofVersion)) { String bad = (ofVersion == null) ? "unknown" : "OF 1.0"; throw new IllegalArgumentException( "No table miss flow entry is needed for " + bad + " switch."); } verify(MISS_TIMEOUT, input.getIdleTimeout(), "Invalid idle-timeout"); verify(MISS_TIMEOUT, input.getHardTimeout(), "Invalid hard-timeout"); verify(MISS_PRIORITY, input.getPriority(), "Invalid priority"); verify(EMPTY_MATCH, input.getMatch(), "Invalid match"); Instructions insts = input.getInstructions(); String dst = OutputPortValues.CONTROLLER.toString(); if (!isOutput(insts, dst)) { throw new IllegalArgumentException( "Invalid instructions: " + insts); } }
/** * Issue an add-flow RPC request. * * @param w The node RPC watcher. * @param sfs MD-SAL flow service. * @param in The RPC input. * @param discon Determine whether an error caused by disconnection of * OpenFlow secure channel should be logged or not. */ public AddFlowRpc(NodeRpcWatcher w, SalFlowService sfs, AddFlowInput in, boolean discon) { super(w, in, in.getNode(), sfs.addFlow(in), discon); }
@Override public FlowAdded compose(TransactionId tXid) { FlowAddedBuilder newFlow = new FlowAddedBuilder((Flow) input); newFlow.setTransactionId(tXid); newFlow.setFlowRef(input.getFlowRef()); return newFlow.build(); } };
/** * Issue an add-flow RPC request. * * <p> * A barrier request will be sent in background after issueing add-flow * RPC request. * </p> * * @param w The flow RPC watcher. * @param sfs MD-SAL flow service. * @param in The RPC input. * @param discon Determine whether an error caused by disconnection of * OpenFlow secure channel should be logged or not. * @return An {@link AddFlowRpc} instance associated with an add-flow * RPC invocation. */ public static AddFlowRpc create(FlowRpcWatcher w, SalFlowService sfs, AddFlowInput in, boolean discon) { AddFlowRpc rpc = new AddFlowRpc(w, sfs, in, discon); w.asyncBarrier(in.getNode()); return rpc; }
FlowRef fref = input.getFlowRef(); String id; if (fref != null) {
if (!Objects.equals(_bufferId, other.getBufferId())) { return false; if (!Objects.equals(_containerName, other.getContainerName())) { return false; if (!Objects.equals(_cookie, other.getCookie())) { return false; if (!Objects.equals(_cookieMask, other.getCookieMask())) { return false; if (!Objects.equals(_flags, other.getFlags())) { return false; if (!Objects.equals(_flowName, other.getFlowName())) { return false; if (!Objects.equals(_flowRef, other.getFlowRef())) { return false; if (!Objects.equals(_flowTable, other.getFlowTable())) { return false; if (!Objects.equals(_hardTimeout, other.getHardTimeout())) { return false; if (!Objects.equals(_idleTimeout, other.getIdleTimeout())) { return false;
@Override public ListenableFuture<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) { Flow flow = ToSalConversionsUtils.toFlow(input, null); @SuppressWarnings("unchecked") org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input .getNode().getValue()); Status status = delegate.addFlowAsync(node, flow); AddFlowOutputBuilder builder = new AddFlowOutputBuilder(); builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId()))); AddFlowOutput rpcResultType = builder.build(); return Futures.immediateFuture(RpcResultBuilder.<AddFlowOutput>status(status.isSuccess()) .withResult(rpcResultType).build()); }