java.lang.Object
com.smeup.kokos.sdk.entrypoint.restapi.RestApi

public class RestApi extends Object
Author:
mattia.bonardi
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addEndpoint(String path, org.eclipse.jetty.server.Handler handler)
     
    static void
    addEndpoint(org.eclipse.jetty.http.pathmap.PathSpec path, org.eclipse.jetty.server.Handler handler)
     
    static <T extends com.smeup.kokos.sdk.configuration.MicroExecutorConfiguration>
    void
    startServer(com.smeup.kokos.sdk.configuration.MicroExecutorStartupContext<T> startupContext)
     
    static <T extends com.smeup.kokos.sdk.configuration.MicroExecutorConfiguration>
    void
    startServer(String microExecutorId, Class<T> configurationClass)
    Deprecated.
    startServer(final MicroExecutorStartupContext invalid input: '<' T > startupContext)
    static <T extends com.smeup.kokos.sdk.configuration.MicroExecutorConfiguration>
    void
    startServer(String microExecutorId, Class<T> configurationClass, Consumer<T> callBackFunction)
    Deprecated.
    use startServer(final MicroExecutorStartupContext startupContext) instead
    static void
    Stops the server with the default shutdown timeout.
    static void
    stopServer(long timeout)
    Stops the server with a specified timeout.

    Methods inherited from class java.lang.Object

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

    • RestApi

      public RestApi()
  • Method Details

    • startServer

      public static <T extends com.smeup.kokos.sdk.configuration.MicroExecutorConfiguration> void startServer(com.smeup.kokos.sdk.configuration.MicroExecutorStartupContext<T> startupContext) throws Exception
      Throws:
      Exception
    • startServer

      @Deprecated public static <T extends com.smeup.kokos.sdk.configuration.MicroExecutorConfiguration> void startServer(String microExecutorId, Class<T> configurationClass) throws Exception
      Deprecated.
      startServer(final MicroExecutorStartupContext invalid input: '<' T > startupContext)
      Create and load configuration, start HTTP Jetty Server and initialize APIs
      Type Parameters:
      T - extends MicroExecutorConfiguration
      Parameters:
      microExecutorId - micro-executor id
      Throws:
      Exception - Exception
    • startServer

      @Deprecated public static <T extends com.smeup.kokos.sdk.configuration.MicroExecutorConfiguration> void startServer(String microExecutorId, Class<T> configurationClass, Consumer<T> callBackFunction) throws Exception
      Deprecated.
      use startServer(final MicroExecutorStartupContext startupContext) instead
      Create and load configuration, start HTTP Jetty Server and initialize APIs
      Type Parameters:
      T - extends MicroExecutorConfiguration
      Parameters:
      microExecutorId - micro-executor id
      callBackFunction - the function invoked before the server starts
      Throws:
      Exception - Exception
    • addEndpoint

      public static void addEndpoint(String path, org.eclipse.jetty.server.Handler handler)
    • addEndpoint

      public static void addEndpoint(org.eclipse.jetty.http.pathmap.PathSpec path, org.eclipse.jetty.server.Handler handler)
    • stopServer

      public static void stopServer(long timeout) throws Exception
      Stops the server with a specified timeout.
      Parameters:
      timeout - the timeout in milliseconds to wait for the server to stop
      Throws:
      Exception - if an error occurs while stopping the server
    • stopServer

      public static void stopServer() throws Exception
      Stops the server with the default shutdown timeout.
      Throws:
      Exception - if an error occurs while stopping the server