Package fr.gouv.vitam.common.serverv2

# Class VitamStarter

java.lang.Object
fr.gouv.vitam.common.serverv2.VitamStarter

public class VitamStarter extends Object
launch vitam server

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VitamStarter(Class<? extends VitamApplicationConfiguration> configurationType, String configurationFile, Class<? extends jakarta.ws.rs.core.Application> businessApplication, Class<? extends jakarta.ws.rs.core.Application> adminApplication)`
  Constructor
  `VitamStarter(Class<? extends VitamApplicationConfiguration> configurationType, String configurationFile, Class<? extends jakarta.ws.rs.core.Application> businessApplication, Class<? extends jakarta.ws.rs.core.Application> adminApplication, List<jakarta.servlet.ServletContextListener> customListeners, boolean deployStaticResources)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected org.eclipse.jetty.server.Handler`
  `buildAdminHandler(String configurationFile)`
  `protected org.eclipse.jetty.server.Handler`
  `buildApplicationHandler(String configurationFile, VitamApplicationConfiguration configuration)`
  `protected final void`
  `configure(String configurationFile)`
  `protected void`
  `configureVitamParameters()`
  Allow override Vitam parameters
  `final Class<? extends VitamApplicationConfiguration>`
  `getConfigurationType()`
  Get configuration Type
  `VitamServer`
  `getVitamServer()`
  Get the vitam server
  `boolean`
  `isStarted()`
  Check if server is started
  `boolean`
  `isStopped()`
  Check if server is stopped
  `final void`
  `run()`
  Run method, start and join the server
  `void`
  `start()`
  For Junit tests, starts only, not join
  `void`
  `stop()`
  For Junit tests, stops the server

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### VitamStarter

    public VitamStarter(Class<? extends VitamApplicationConfiguration> configurationType, String configurationFile, Class<? extends jakarta.ws.rs.core.Application> businessApplication, Class<? extends jakarta.ws.rs.core.Application> adminApplication)
    Constructor
    Parameters:
      `configurationType` - configuration type
      `configurationFile` - configuration file
      `businessApplication` - business application
      `adminApplication` - admin application

  - ### VitamStarter

    public VitamStarter(Class<? extends VitamApplicationConfiguration> configurationType, String configurationFile, Class<? extends jakarta.ws.rs.core.Application> businessApplication, Class<? extends jakarta.ws.rs.core.Application> adminApplication, List<jakarta.servlet.ServletContextListener> customListeners, boolean deployStaticResources)
    Constructor
    Parameters:
      `configurationType` - configuration type
      `configurationFile` - configuration file
      `businessApplication` - business application
      `adminApplication` - admin application
      `customListeners` - list of custom listeners

- ## Method Details

  - ### configure

    protected final void configure(String configurationFile)

  - ### configureVitamParameters

    protected void configureVitamParameters()
    Allow override Vitam parameters

  - ### getConfigurationType

    public final Class<? extends VitamApplicationConfiguration> getConfigurationType()
    Get configuration Type
    Returns:
      configuration type

  - ### buildApplicationHandler

    protected org.eclipse.jetty.server.Handler buildApplicationHandler(String configurationFile, VitamApplicationConfiguration configuration) throws VitamApplicationServerException
    Throws:
      `VitamApplicationServerException`

  - ### buildAdminHandler

    protected org.eclipse.jetty.server.Handler buildAdminHandler(String configurationFile)

  - ### run

    public final void run() throws VitamApplicationServerException
    Run method, start and join the server
    Throws:
      `VitamApplicationServerException`

  - ### start

    public void start() throws VitamApplicationServerException
    For Junit tests, starts only, not join
    Throws:
      `VitamApplicationServerException` - in case the server could not be started

  - ### stop

    public void stop() throws VitamApplicationServerException
    For Junit tests, stops the server
    Throws:
      `VitamApplicationServerException`

  - ### isStarted

    public boolean isStarted()
    Check if server is started
    Returns:
      true if started

  - ### getVitamServer

    public VitamServer getVitamServer()
    Get the vitam server
    Returns:
      the vitam server

  - ### isStopped

    public boolean isStopped()
    Check if server is stopped
    Returns:
      true if stopped