Record Class SnmpMcpServer.ServerConfiguration.SnmpTargetConfig
java.lang.Object
java.lang.Record
org.snmp4j.mcp.SnmpMcpServer.ServerConfiguration.SnmpTargetConfig
- Record Components:
targetName- A unique name identifying this SNMP target configuration.address- The specific network address to which the SNMP command responder binds.community- The community string used for SNMP communication in SNMPv1 and SNMPv2c, null for SNMPv3.retries- The number of retries attempted if an SNMP request fails.timeout- The timeout duration (in milliseconds) for SNMP requests.version- The version of the SNMP protocol (e.g., v1, v2c, v3) to be used.maxSizeResponsePdu- The maximum allowable size of the SNMP response PDU (Protocol Data Unit).snmpV3- The configuration specific to SNMPv3, including security settings.tls- The configuration for secure communication using Transport Layer Security (TLS).allowAdhocParameterOverwrite- Whentrue, tools that support aparameterOverridesargument may overwrite this target's security and transport parameters on a per-call basis (e.g. community, version, retries, timeout, and anySNMPv3/TLSfield). Theaddress(which embeds the transport type and port) can never be overridden. Intended for security-negative and robustness testing against a fixed agent endpoint. Defaults tofalse(absent in JSON) for safety.
- Enclosing class:
SnmpMcpServer.ServerConfiguration
public static record SnmpMcpServer.ServerConfiguration.SnmpTargetConfig(String targetName, String address, String community, int retries, int timeout, String version, int maxSizeResponsePdu, SnmpMcpServer.ServerConfiguration.SnmpV3Config snmpV3, SnmpMcpServer.ServerConfiguration.TlsConfig tls, boolean allowAdhocParameterOverwrite)
extends Record
Represents the configuration settings for a named SNMP target.
This record contains various parameters necessary to define how SNMP communication
is configured, including protocol version, community string, retries, and timeout.
Additional configurations for SNMPv3 and TLS can be specified for enhanced security.
- Since:
- 0.0.1
- Version:
- 0.1.0
- Author:
- SNMP4J.org
-
Constructor Summary
ConstructorsConstructorDescriptionSnmpTargetConfig(String targetName, String address, String community, int retries, int timeout, String version, int maxSizeResponsePdu, SnmpMcpServer.ServerConfiguration.SnmpV3Config snmpV3, SnmpMcpServer.ServerConfiguration.TlsConfig tls, boolean allowAdhocParameterOverwrite) Creates an instance of aSnmpTargetConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaddress()Returns the value of theaddressrecord component.booleanReturns the value of theallowAdhocParameterOverwriterecord component.Returns the value of thecommunityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxSizeResponsePdurecord component.intretries()Returns the value of theretriesrecord component.snmpV3()Returns the value of thesnmpV3record component.Returns the value of thetargetNamerecord component.inttimeout()Returns the value of thetimeoutrecord component.tls()Returns the value of thetlsrecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
SnmpTargetConfig
public SnmpTargetConfig(String targetName, String address, String community, int retries, int timeout, String version, int maxSizeResponsePdu, SnmpMcpServer.ServerConfiguration.SnmpV3Config snmpV3, SnmpMcpServer.ServerConfiguration.TlsConfig tls, boolean allowAdhocParameterOverwrite) Creates an instance of aSnmpTargetConfigrecord class.- Parameters:
targetName- the value for thetargetNamerecord componentaddress- the value for theaddressrecord componentcommunity- the value for thecommunityrecord componentretries- the value for theretriesrecord componenttimeout- the value for thetimeoutrecord componentversion- the value for theversionrecord componentmaxSizeResponsePdu- the value for themaxSizeResponsePdurecord componentsnmpV3- the value for thesnmpV3record componenttls- the value for thetlsrecord componentallowAdhocParameterOverwrite- the value for theallowAdhocParameterOverwriterecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
targetName
Returns the value of thetargetNamerecord component.- Returns:
- the value of the
targetNamerecord component
-
address
-
community
-
retries
-
timeout
-
version
-
maxSizeResponsePdu
public int maxSizeResponsePdu()Returns the value of themaxSizeResponsePdurecord component.- Returns:
- the value of the
maxSizeResponsePdurecord component
-
snmpV3
-
tls
-
allowAdhocParameterOverwrite
public boolean allowAdhocParameterOverwrite()Returns the value of theallowAdhocParameterOverwriterecord component.- Returns:
- the value of the
allowAdhocParameterOverwriterecord component
-