DanielLeens commented on code in PR #12011: URL: https://github.com/apache/seatunnel/pull/12011#discussion_r3948929693
########## seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/config/SnmpSinkConfig.java: ########## @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.snmp.config; + +import org.apache.seatunnel.api.configuration.ReadonlyConfig; + +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; + +/** Validated runtime configuration for the SNMPv2c SET sink. */ +public final class SnmpSinkConfig implements Serializable, SnmpTargetConfig { + + private static final long serialVersionUID = 1L; + + private final String host; + private final int port; + private final String community; + private final long timeoutMillis; + private final int retries; + private final String oidField; + private final String valueField; + private final String valueTypeField; + + public SnmpSinkConfig(ReadonlyConfig config) { + String configuredHost = config.get(SnmpSinkOptions.HOST); Review Comment: Confirmed this landed in the latest commit (`f74a0d1609c`): `SnmpSinkFactory.optionRule()` now uses `Conditions.notBlank/greaterOrEqual/lessOrEqual/greaterThan` for host/community/port/timeout_millis/retries/oid_field/value_field/value_type_field, and it's covered by five new tests in `SnmpSinkFactoryTest` (boundaries, missing-required, blank strings, invalid numerics with a no-credential-leak assertion, and whitespace-preservation). Good suggestion, thanks for pointing at the STIP28 framework specifically. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
