public OutputActionBuilder(OutputAction base) { this._maxLength = base.getMaxLength(); this._outputNodeConnector = base.getOutputNodeConnector(); if (base instanceof OutputActionImpl) { OutputActionImpl _impl = (OutputActionImpl) base; this.augmentation = new HashMap<>(_impl.augmentation); } }
/** * {@inheritDoc} */ @Override public String getDescription(Action act) throws RpcException { OutputActionCase ac = cast(OutputActionCase.class, act); OutputAction action = ac.getOutputAction(); String port = null; Integer len = null; if (action != null) { len = action.getMaxLength(); Uri uri = action.getOutputNodeConnector(); if (uri != null) { port = uri.getValue(); } } return new StringBuilder("OUTPUT(port="). append(port).append(", len=").append(len).append(')').toString(); }
if (other.getMaxLength() != null) { return false; } else if(!_maxLength.equals(other.getMaxLength())) { return false;
@Nonnull @Override public Optional<Action> process(@Nonnull final OutputActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) { final OutputAction outputAction = source.getOutputAction(); final OutputActionBuilder outputBuilder = new OutputActionBuilder(); if (outputAction.getMaxLength() != null) { outputBuilder.setMaxLength(outputAction.getMaxLength()); } else { outputBuilder.setMaxLength(0); } final OpenflowVersion version = OpenflowVersion.get(data.getVersion()); final String nodeConnectorId = outputAction.getOutputNodeConnector().getValue(); final Long portNumber = InventoryDataServiceUtil.portNumberfromNodeConnectorId(version, nodeConnectorId); if (OpenflowPortsUtil.checkPortValidity(version, portNumber)) { outputBuilder.setPort(new PortNumber(portNumber)); } else { LOG.error("Invalid Port specified {} for Output Action for OF version: {}", portNumber, version); } return Optional.of(new ActionBuilder() .setActionChoice(new OutputActionCaseBuilder() .setOutputAction(outputBuilder.build()) .build()) .build()); } }