- java.lang.Object
-
- org.snmp4j.util.SnmpBuilder
-
public class SnmpBuilder extends java.lang.Object
Builds aSnmp
instance through step-by-step configuration.- Since:
- 3.5.0
- Author:
- Frank Fock
-
-
Constructor Summary
Constructors Constructor Description SnmpBuilder()
SnmpBuilder(Snmp snmp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Snmp
build()
SnmpBuilder
counterSupport(CounterSupport counterSupport)
SnmpBuilder
dtls()
SnmpBuilder
dtls(TlsTmSecurityCallback<java.security.cert.X509Certificate> securityCallback, java.lang.String[] dtlsProtocolVersions, DtlsAddress... listenAddresses)
SnmpBuilder
dtls(TlsTmSecurityCallback<java.security.cert.X509Certificate> securityCallback, DtlsAddress... listenAddresses)
SnmpBuilder
securityProtocols(SecurityProtocols.SecurityProtocolSet securityProtocolSet)
SnmpBuilder
tcp()
SnmpBuilder
tcp(TcpAddress... listenAddresses)
SnmpBuilder
tls()
SnmpBuilder
tls(TlsTmSecurityCallback<java.security.cert.X509Certificate> securityCallback, java.lang.String[] tlsProtocolVersions, TlsAddress... listenAddresses)
SnmpBuilder
tls(TlsTmSecurityCallback<java.security.cert.X509Certificate> securityCallback, TlsAddress... listenAddresses)
SnmpBuilder
tsm(OctetString localEngineID, boolean usePrefix)
Creates a Transport Security Model as defined by RFC 5591 and adds it to the builtSnmp
instance.SnmpBuilder
udp()
SnmpBuilder
udp(UdpAddress... listenAddresses)
SnmpBuilder
usm(OctetString localEngineID, int engineBoots)
Creates a USM for the specified engine ID and engine boots counter.SnmpBuilder
v1()
SnmpBuilder
v2c()
SnmpBuilder
v3(OctetString localEngineID)
-
-
-
Constructor Detail
-
SnmpBuilder
public SnmpBuilder()
-
SnmpBuilder
public SnmpBuilder(Snmp snmp)
-
-
Method Detail
-
counterSupport
public SnmpBuilder counterSupport(CounterSupport counterSupport)
-
v1
public SnmpBuilder v1()
-
v2c
public SnmpBuilder v2c()
-
v3
public SnmpBuilder v3(OctetString localEngineID)
-
usm
public SnmpBuilder usm(OctetString localEngineID, int engineBoots)
Creates a USM for the specified engine ID and engine boots counter.- Parameters:
localEngineID
- the local engine ID.engineBoots
- the number of engine boots.
-
tsm
public SnmpBuilder tsm(OctetString localEngineID, boolean usePrefix)
Creates a Transport Security Model as defined by RFC 5591 and adds it to the builtSnmp
instance.- Parameters:
localEngineID
- the engine ID of the SNMP entity using this transport security model. The local engine ID must be globally unique.usePrefix
- the snmpTsmConfigurationUsePrefix flag as defined in RFC 5591.
-
udp
public SnmpBuilder udp() throws java.io.IOException
- Throws:
java.io.IOException
-
udp
public SnmpBuilder udp(UdpAddress... listenAddresses) throws java.io.IOException
- Throws:
java.io.IOException
-
tcp
public SnmpBuilder tcp() throws java.io.IOException
- Throws:
java.io.IOException
-
tcp
public SnmpBuilder tcp(TcpAddress... listenAddresses) throws java.io.IOException
- Throws:
java.io.IOException
-
dtls
public SnmpBuilder dtls() throws java.io.IOException
- Throws:
java.io.IOException
-
dtls
public SnmpBuilder dtls(TlsTmSecurityCallback<java.security.cert.X509Certificate> securityCallback, DtlsAddress... listenAddresses) throws java.io.IOException
- Throws:
java.io.IOException
-
dtls
public SnmpBuilder dtls(TlsTmSecurityCallback<java.security.cert.X509Certificate> securityCallback, java.lang.String[] dtlsProtocolVersions, DtlsAddress... listenAddresses) throws java.io.IOException
- Throws:
java.io.IOException
-
tls
public SnmpBuilder tls() throws java.io.IOException
- Throws:
java.io.IOException
-
tls
public SnmpBuilder tls(TlsTmSecurityCallback<java.security.cert.X509Certificate> securityCallback, TlsAddress... listenAddresses) throws java.io.IOException
- Throws:
java.io.IOException
-
tls
public SnmpBuilder tls(TlsTmSecurityCallback<java.security.cert.X509Certificate> securityCallback, java.lang.String[] tlsProtocolVersions, TlsAddress... listenAddresses) throws java.io.IOException
- Throws:
java.io.IOException
-
securityProtocols
public SnmpBuilder securityProtocols(SecurityProtocols.SecurityProtocolSet securityProtocolSet)
-
build
public Snmp build() throws java.io.IOException
- Throws:
java.io.IOException
-
-