Class MibObjectResourceTemplate
java.lang.Object
org.snmp4j.mcp.resource.mib.object.MibObjectResourceTemplate
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 pairmib/object/{oid}— globally unique dotted-decimal OID
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionMibObjectResourceTemplate(Supplier<com.snmp4j.smi.SmiManager> smiManagerSupplier, IntSupplier completionLimitSupplier) Creates a resource template backed by the givenSmiManagersupplier. -
Method Summary
Modifier and TypeMethodDescriptionio.modelcontextprotocol.server.McpServerFeatures.SyncCompletionSpecificationReturns the completion specification formib/object/{moduleName}/{objectName}.io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecificationReturns the resource template specification formib/object/{moduleName}/{objectName}.io.modelcontextprotocol.server.McpServerFeatures.SyncCompletionSpecificationReturns the completion specification formib/object/{oid}.io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecificationReturns the resource template specification formib/object/{oid}.
-
Constructor Details
-
MibObjectResourceTemplate
public MibObjectResourceTemplate(Supplier<com.snmp4j.smi.SmiManager> smiManagerSupplier, IntSupplier completionLimitSupplier) Creates a resource template backed by the givenSmiManagersupplier. Both suppliers are resolved lazily at request time, allowing the template to be constructed before theSmiManagerand configuration are initialized.- Parameters:
smiManagerSupplier- provides theSmiManagerinstance to querycompletionLimitSupplier- provides the maximum number of completion entries to return; a value<= 0disables the upper limit
-
-
Method Details
-
moduleObjectTemplateSpec
public io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecification moduleObjectTemplateSpec()Returns the resource template specification formib/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 formib/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 formib/object/{moduleName}/{objectName}. CompletesmoduleNameagainst all loaded module names andobjectNameagainst 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 formib/object/{oid}. Completes against dotted-decimal OID strings of all objects in loaded modules.- Returns:
- sync completion specification for the OID template
-