Class SnmpMcpServer.ServerConfiguration

java.lang.Object
org.snmp4j.mcp.SnmpMcpServer.ServerConfiguration
Enclosing class:
SnmpMcpServer

public static class SnmpMcpServer.ServerConfiguration extends Object
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
  • Constructor Details

    • ServerConfiguration

      public ServerConfiguration()
      Creates a ServerConfiguration with all defaults.
  • Method Details

    • setLicenseKey

      public void setLicenseKey(String licenseKey)
      Sets the license key for the SMI manager.
      Parameters:
      licenseKey - the license key string
    • setRepositoryPath

      public void setRepositoryPath(String repositoryPath)
      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

      public String 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

      public void setConfigFile(String configFile)
      Sets the path to the configuration file.
      Parameters:
      configFile - the file path of the configuration file to set
    • getProperty

      public String getProperty(String key)
      Retrieves the value associated with the specified key from the properties.
      Parameters:
      key - the key whose associated value is to be returned
      Returns:
      the value associated with the specified key, or null if the key does not exist
    • getMcpConfig

      Retrieves the current configuration for the Management Control Protocol (MCP) system. The McpConfig object contains details about licensing, MIB (Management Information Base), and SNMP (Simple Network Management Protocol) settings, encapsulated within dedicated configuration records.
      Returns:
      the configured McpConfig object, which holds the combined configuration details for MCP, including licensing, MIB, and SNMP parameters.
    • setMcpConfig

      public void setMcpConfig(SnmpMcpServer.ServerConfiguration.McpConfig mcpConfig)
      Configures the Management Control Protocol (MCP) settings for the server. The method updates the mcpConfig field with the provided configuration or dynamically modifies it based on the currently set licenseKey or repositoryPath. It ensures that the new configuration accurately reflects the current state of the license and repository path.
      Parameters:
      mcpConfig - the McpConfig object containing the desired MCP configuration, which includes settings for licensing, MIB (Management Information Base), and SNMP (Simple Network Management Protocol).