java.lang.Object
net.i2p.i2pcontrol.servlets.jsonrpc2handlers.NetworkSettingHandler
All Implemented Interfaces:
RequestHandler

public class NetworkSettingHandlerextends Object implements RequestHandler
JSON-RPC2 handler for the NetworkSetting method. Manages router network configuration including transport ports, hostnames, bandwidth settings, and UPnP.
  • Field Details

    • BW_BURST_PCT

      private static final int BW_BURST_PCT
      Percent of the limit the burst allowance gives.
      See Also:
    • BW_BURST_TIME

      private static final int BW_BURST_TIME
      Burst allowance window, in seconds.
      See Also:
    • _helper

      private final JSONRPC2Helper _helper
      Reads the request's arguments.
    • _context

      private final RouterContext _context
      The router being configured.
  • Constructor Details

    • NetworkSettingHandler

      public NetworkSettingHandler(RouterContext ctx, JSONRPC2Helper helper)
      Retains the router context and helper used to manage the settings.
      Parameters:
      ctx - the router context supplying the network configuration to manage
      helper - the shared helper used to build JSONRPC2 responses and access settings
  • Method Details

    • handledRequests

      public String[] handledRequests()
      Method names this handler services.
      Specified by:
      handledRequests in interface RequestHandler
      Returns:
      method names handled by this handler
    • process

      public JSONRPC2Response process(JSONRPC2Request req, MessageContext ctx)
      Process a NetworkSetting request
      Specified by:
      process in interface RequestHandler
      Parameters:
      req - A valid JSON-RPC 2.0 request instance. Must not be null.
      ctx - Context information about the request message, may be null if undefined.
      Returns:
      The resulting JSON-RPC 2.0 response. It indicates success or an error, such as METHOD_NOT_FOUND.
    • process

      private JSONRPC2Response process(JSONRPC2Request req)
      Applies or reports the network settings.
      Parameters:
      req - the request to answer
      Returns:
      the reply to send