Class AbstractMiddlewareVersion

java.lang.Object
com.kingsrook.qqq.middleware.javalin.specs.AbstractMiddlewareVersion
Direct Known Subclasses:
MiddlewareVersionV1

public abstract class AbstractMiddlewareVersion extends Object
Baseclass that combines multiple specs together into a single "version" of the full qqq middleware.
  • Field Details

    • LOG

      public static final QLogger LOG
  • Constructor Details

    • AbstractMiddlewareVersion

      public AbstractMiddlewareVersion()
  • Method Details

    • getSemanticVersion

      public String getSemanticVersion()
      The semantic version (MAJOR.MINOR.PATCH) of this version of the API, as published in the OpenAPI info.version. MAJOR matches the URL version. See docs/UI-API-CHANGELOG.md for the rules. The default (for versions that predate semver) is the URL version itself.
    • getFeatures

      public List<String> getFeatures()
      Core feature names this version supports, published by the version endpoint, so clients can toggle optional areas without probing.
    • getAllEndpointSpecs

      public List<AbstractEndpointSpec<?,?,?>> getAllEndpointSpecs()
      The core specs plus the specs registered by extensions, in route order.
    • getExtensions

      public Map<String,MiddlewareSpecExtension> getExtensions()
      The extensions whose specs this version serves.
    • loadExtensions

      public void loadExtensions(QInstance qInstance)
      Load the extension specs registered in a QInstance (replacing any loaded before). Called by setQInstance until routes are defined.
    • getVersion

      public abstract String getVersion()
    • getEndpointSpecs

      public abstract List<AbstractEndpointSpec<?,?,?>> getEndpointSpecs()
      hey - don't re-construct the endpoint-spec objects inside this method...
    • getJavalinEndpointGroup

      public io.javalin.apibuilder.EndpointGroup getJavalinEndpointGroup(QInstance qInstance)
    • getVersionBasePath

      public String getVersionBasePath()
    • getDocumentationBasePaths

      public List<String> getDocumentationBasePaths()
      Paths that serve documentation. Versions with parameterized execution routes can provide concrete paths to avoid shadowing other providers.
    • setQInstance

      public void setQInstance(QInstance qInstance)
      For initial setup when server boots, set the qInstance - but also, e.g., for development, to do a hot-swap.
    • generateOpenAPIModel

      public OpenAPI generateOpenAPIModel(String basePath) throws QException
      Throws:
      QException
    • generateExtensionOpenAPIModel

      public OpenAPI generateExtensionOpenAPIModel(String basePath, MiddlewareSpecExtension extension) throws QException
      The OpenAPI document of one extension alone (its paths and the component schemas its specs define) - what a qbit commits and contract-tests.
      Throws:
      QException
    • warnIfPathMethodAlreadyUsed

      public void warnIfPathMethodAlreadyUsed(Method existing, CompleteOperation completeOperation, AbstractEndpointSpec<?,?,?> spec)
    • preExecute

      public void preExecute(io.javalin.http.Context context) throws QException
      Throws:
      QException