Class SnmpMcpServer.ServerConfiguration
java.lang.Object
org.snmp4j.mcp.SnmpMcpServer.ServerConfiguration
- Enclosing class:
SnmpMcpServer
The ServerConfiguration class provides configuration settings for a server application.
It includes properties for network port, configuration files, licensing, repository paths,
and protocol-specific configurations such as SNMP and TLS. It can also store additional
custom properties as key-value pairs.
This class contains nested records that represent structured configurations for different
components:
-
LicenseConfig: Configuration for licensing.
- MibConfig: Configuration related to Management Information Base (MIB) repositories.
- SnmpV3Config: Configuration for SNMPv3 security parameters.
- TlsConfig: Configuration for Transport Layer Security.
- SnmpTargetConfig: Named SNMP target configuration combining general SNMP and security settings.
- McpConfig: Consolidated configuration for licensing, MIB, and SNMP.
Methods are provided to retrieve and update various configurations and to manage additional
properties.- Since:
- 0.0.1
- Version:
- 0.1.0
- Author:
- SNMP4J.org
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents the configuration for a license.static final recordConfiguration record for the MCP (Management Control Protocol) system.static final recordRepresents the configuration for managing MIB (Management Information Base) settings.static final recordRepresents the configuration settings for a named SNMP target.static final recordRepresents the configuration for SNMPv3 (Simple Network Management Protocol version 3).static final recordA record representing the configuration for (D)TLS (Datagram Transport Layer Security) as defined by RFC 6353 (TLSTM) and RFC 7296/RFC 5953 (DTLSTM). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the path to the configuration file.Retrieves the current configuration for the Management Control Protocol (MCP) system.intgetPort()Retrieves the port number configured for the server.getProperty(String key) Retrieves the value associated with the specified key from the properties.voidsetConfigFile(String configFile) Sets the path to the configuration file.voidsetLicenseKey(String licenseKey) Sets the license key for the SMI manager.voidConfigures the Management Control Protocol (MCP) settings for the server.voidsetPort(int port) Sets the port number for the server configuration.voidsetRepositoryPath(String repositoryPath) Sets the file-system path to the MIB repository directory.
-
Constructor Details
-
ServerConfiguration
public ServerConfiguration()Creates a ServerConfiguration with all defaults.
-
-
Method Details
-
setLicenseKey
Sets the license key for the SMI manager.- Parameters:
licenseKey- the license key string
-
setRepositoryPath
Sets the file-system path to the MIB repository directory.- Parameters:
repositoryPath- absolute or relative path to the repository
-
getPort
public int getPort()Retrieves the port number configured for the server.- Returns:
- the port number
-
getConfigFile
Retrieves the path to the configuration file.- Returns:
- the path to the configuration file as a String
-
setPort
public void setPort(int port) Sets the port number for the server configuration.- Parameters:
port- the port number to set
-
setConfigFile
Sets the path to the configuration file.- Parameters:
configFile- the file path of the configuration file to set
-
getProperty
-
getMcpConfig
Retrieves the current configuration for the Management Control Protocol (MCP) system. TheMcpConfigobject contains details about licensing, MIB (Management Information Base), and SNMP (Simple Network Management Protocol) settings, encapsulated within dedicated configuration records.- Returns:
- the configured
McpConfigobject, which holds the combined configuration details for MCP, including licensing, MIB, and SNMP parameters.
-
setMcpConfig
Configures the Management Control Protocol (MCP) settings for the server. The method updates themcpConfigfield with the provided configuration or dynamically modifies it based on the currently setlicenseKeyorrepositoryPath. It ensures that the new configuration accurately reflects the current state of the license and repository path.- Parameters:
mcpConfig- theMcpConfigobject containing the desired MCP configuration, which includes settings for licensing, MIB (Management Information Base), and SNMP (Simple Network Management Protocol).
-