Class HTTPContext

java.lang.Object
septogeddon.pluginquery.http.HTTPContext

public class HTTPContext extends Object
Basically a HTTP Protocol Manager for PluginQuery
Author:
Thito Yalasatria Sunarya
  • Constructor Details

    • HTTPContext

      public HTTPContext()
  • Method Details

    • getContext

      public static HTTPContext getContext()
      Get the default HTTP context
      Returns:
      HTTPContext instance
    • registerMethod

      public void registerMethod(ProtocolMethod method)
      Register a method
      Parameters:
      method - method type
      Throws:
      IllegalArgumentException - if the ProtocolMethod has different context
      See Also:
    • getMethod

      public ProtocolMethod getMethod(String name)
      Get method by name
      Parameters:
      name - the method name
      Returns:
      the method instance
    • registerListener

      public void registerListener(ListenerPriority priority, ProtocolListener listener)
      Register a listener
      Parameters:
      priority - the listener priority
      listener - the listener
    • unregisterListener

      public void unregisterListener(ProtocolListener listener)
      Unregister a listener
      Parameters:
      listener - the listener
    • dispatchRequest

      public void dispatchRequest(ProtocolRequest request, ProtocolClient client)
      Dispatch the request to all listeners
      Parameters:
      request - the request
      client - the client