Class MibObjectResourceTemplate

java.lang.Object
org.snmp4j.mcp.resource.mib.object.MibObjectResourceTemplate

public class MibObjectResourceTemplate extends Object
Provides MCP McpServerFeatures.SyncResourceTemplateSpecification and McpServerFeatures.SyncCompletionSpecification instances for querying SmiObject definitions by two addressing schemes:
  • mib/object/{moduleName}/{objectName} — fully-qualified module + object name pair
  • mib/object/{oid} — globally unique dotted-decimal OID
Both parameter sets support MCP completion so clients can interactively discover valid values.
Since:
0.1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    MibObjectResourceTemplate(Supplier<com.snmp4j.smi.SmiManager> smiManagerSupplier, IntSupplier completionLimitSupplier)
    Creates a resource template backed by the given SmiManager supplier.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.modelcontextprotocol.server.McpServerFeatures.SyncCompletionSpecification
    Returns the completion specification for mib/object/{moduleName}/{objectName}.
    io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecification
    Returns the resource template specification for mib/object/{moduleName}/{objectName}.
    io.modelcontextprotocol.server.McpServerFeatures.SyncCompletionSpecification
    Returns the completion specification for mib/object/{oid}.
    io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecification
    Returns the resource template specification for mib/object/{oid}.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MibObjectResourceTemplate

      public MibObjectResourceTemplate(Supplier<com.snmp4j.smi.SmiManager> smiManagerSupplier, IntSupplier completionLimitSupplier)
      Creates a resource template backed by the given SmiManager supplier. Both suppliers are resolved lazily at request time, allowing the template to be constructed before the SmiManager and configuration are initialized.
      Parameters:
      smiManagerSupplier - provides the SmiManager instance to query
      completionLimitSupplier - provides the maximum number of completion entries to return; a value <= 0 disables the upper limit
  • Method Details

    • moduleObjectTemplateSpec

      public io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecification moduleObjectTemplateSpec()
      Returns the resource template specification for mib/object/{moduleName}/{objectName}.
      Returns:
      sync resource template specification for module/name-based MIB object lookup
    • oidTemplateSpec

      public io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecification oidTemplateSpec()
      Returns the resource template specification for mib/object/{oid}.
      Returns:
      sync resource template specification for OID-based MIB object lookup
    • moduleObjectCompletionSpec

      public io.modelcontextprotocol.server.McpServerFeatures.SyncCompletionSpecification moduleObjectCompletionSpec()
      Returns the completion specification for mib/object/{moduleName}/{objectName}. Completes moduleName against all loaded module names and objectName against all object names in the module supplied via the completion context.
      Returns:
      sync completion specification for the module/name template
    • oidCompletionSpec

      public io.modelcontextprotocol.server.McpServerFeatures.SyncCompletionSpecification oidCompletionSpec()
      Returns the completion specification for mib/object/{oid}. Completes against dotted-decimal OID strings of all objects in loaded modules.
      Returns:
      sync completion specification for the OID template