Package fr.gouv.vitam.common.server.application.resources

# Class VitamServiceRegistry

java.lang.Object
fr.gouv.vitam.common.server.application.resources.VitamServiceRegistry

public class VitamServiceRegistry extends Object
VItam Service Registry that contains all dependencies for the current Application

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VitamServiceRegistry()`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `checkDependencies(int retry, long retryDelay)`
  Check all the registered dependencies, except optional
  `com.fasterxml.jackson.databind.node.ObjectNode`
  `getAutotestStatus()`
  Get full Autotest status, including optional services return the overall status of this component with the constraint delay of less than 10ms and shall return by default empty JsonNode.
  `int`
  `getRegisteredServices()`
  `boolean`
  `getResourcesStatus()`
  Get the resource overall status, except optional services return the overall status of this component with the constraint delay of less than 10ms.
  `VitamServiceRegistry`
  `register(VitamClientFactoryInterface<?> factory)`
  Register one Client factory
  `VitamServiceRegistry`
  `register(DatabaseConnection database)`
  Register one Database
  `VitamServiceRegistry`
  `register(VitamStatusService service)`
  Register the Status service of this application (unique)
  `VitamServiceRegistry`
  `registerOptional(VitamClientFactoryInterface<?> factory)`
  Register one Optional Client factory

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

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

- ## Constructor Details

  - ### VitamServiceRegistry

    public VitamServiceRegistry()
    Constructor

- ## Method Details

  - ### register

    public VitamServiceRegistry register(VitamClientFactoryInterface<?> factory)
    Register one Client factory
    Parameters:
      `factory` - Http Client Factory
    Returns:
      this

  - ### registerOptional

    public VitamServiceRegistry registerOptional(VitamClientFactoryInterface<?> factory)
    Register one Optional Client factory
    Parameters:
      `factory` - optional Http Client Factory
    Returns:
      this

  - ### register

    public VitamServiceRegistry register(DatabaseConnection database)
    Register one Database
    Parameters:
      `database` - database connection
    Returns:
      this

  - ### register

    public VitamServiceRegistry register(VitamStatusService service)
    Register the Status service of this application (unique)
    Parameters:
      `service` -
    Returns:
      this

  - ### getRegisteredServices

    public int getRegisteredServices()
    Returns:
      the number of registered services, including itself

  - ### getResourcesStatus

    public boolean getResourcesStatus()
    Get the resource overall status, except optional services return the overall status of this component with the constraint delay of less than 10ms.
    Returns:
      boolean

  - ### checkDependencies

    public void checkDependencies(int retry, long retryDelay) throws VitamApplicationServerException, InterruptedException
    Check all the registered dependencies, except optional
    Parameters:
      `retry` - the number retry in case of unavailability
      `retryDelay` - the delay in ms between each retry
    Throws:
      `VitamApplicationServerException` - if any of the dependencies are unavailable
      `InterruptedException`

  - ### getAutotestStatus

    public com.fasterxml.jackson.databind.node.ObjectNode getAutotestStatus()
    Get full Autotest status, including optional services return the overall status of this component with the constraint delay of less than 10ms and shall return by default empty JsonNode.
    Returns:
      ServerIdentity