Class AsyncApiControlPlaneImpl

java.lang.Object
org.mockserver.async.controlplane.AsyncApiControlPlaneImpl
All Implemented Interfaces:
org.mockserver.async.AsyncApiControlPlane

public class AsyncApiControlPlaneImpl extends Object implements org.mockserver.async.AsyncApiControlPlane
Implementation of AsyncApiControlPlane that lives in the mockserver-async module and is registered into the core's AsyncApiControlPlaneRegistry at server startup.

Handles:

  • Loading AsyncAPI specs via the REST control-plane
  • Creating publishers and subscribers for each channel
  • Schema validation of generated and consumed messages
  • Returning status including recorded messages
  • Resetting all state on server reset
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a control-plane with no Configuration instance, falling back entirely to the static ConfigurationProperties store for async broker defaults.
    AsyncApiControlPlaneImpl(org.mockserver.configuration.Configuration configuration)
    Create a control-plane bound to the server's Configuration instance so that instance-set async broker defaults are honoured.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    com.fasterxml.jackson.databind.JsonNode
    load(String requestBody)
     
    static void
    Register this implementation into the core registry, without a Configuration instance.
    static void
    registerIfAvailable(org.mockserver.configuration.Configuration configuration)
    Register this implementation into the core registry.
    void
     
    com.fasterxml.jackson.databind.JsonNode
     
    verify(String verificationJson)
     

    Methods inherited from class java.lang.Object

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

    • AsyncApiControlPlaneImpl

      public AsyncApiControlPlaneImpl()
      Create a control-plane with no Configuration instance, falling back entirely to the static ConfigurationProperties store for async broker defaults.
    • AsyncApiControlPlaneImpl

      public AsyncApiControlPlaneImpl(org.mockserver.configuration.Configuration configuration)
      Create a control-plane bound to the server's Configuration instance so that instance-set async broker defaults are honoured.
      Parameters:
      configuration - the server configuration, or null to use only the static store
  • Method Details

    • registerIfAvailable

      public static void registerIfAvailable()
      Register this implementation into the core registry, without a Configuration instance. Prefer registerIfAvailable(Configuration) so that instance-set configuration is honoured.
    • registerIfAvailable

      public static void registerIfAvailable(org.mockserver.configuration.Configuration configuration)
      Register this implementation into the core registry. Call at server startup (e.g. from MockServerLifeCycle or Main).
      Parameters:
      configuration - the server configuration, or null to use only the static store
    • load

      public com.fasterxml.jackson.databind.JsonNode load(String requestBody)
      Specified by:
      load in interface org.mockserver.async.AsyncApiControlPlane
    • status

      public com.fasterxml.jackson.databind.JsonNode status()
      Specified by:
      status in interface org.mockserver.async.AsyncApiControlPlane
    • verify

      public String verify(String verificationJson)
      Specified by:
      verify in interface org.mockserver.async.AsyncApiControlPlane
    • generateHttpExpectations

      public String generateHttpExpectations(String requestBody)
      Specified by:
      generateHttpExpectations in interface org.mockserver.async.AsyncApiControlPlane
    • reset

      public void reset()
      Specified by:
      reset in interface org.mockserver.async.AsyncApiControlPlane