Package fr.gouv.vitam.common.format.identification

# Class FormatIdentifierFactory

java.lang.Object
fr.gouv.vitam.common.format.identification.FormatIdentifierFactory

public class FormatIdentifierFactory extends Object
Format Identifier Factory : used to retrieve the FormatIdentifier implementations

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addFormatIdentifier(String formatIdentifierId, FormatIdentifierConfiguration configuration)`
  Add a format identifier configuration
  `final void`
  `changeConfigurationFile(String configurationPath)`
  Change client configuration from the Json file
  `FormatIdentifier`
  `getFormatIdentifierFor(String formatIdentifierId)`
  Instantiate the format identifier identified
  `static FormatIdentifierFactory`
  `getInstance()`
  Get the FormatIdentifierFactory instance
  `void`
  `removeFormatIdentifier(String formatIdentifierId)`
  Remove a format identifier configuration by its id

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

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

- ## Method Details

  - ### changeConfigurationFile

    public final void changeConfigurationFile(String configurationPath)
    Change client configuration from the Json file
    Parameters:
      `configurationPath` - the path to the configuration file

  - ### getInstance

    public static FormatIdentifierFactory getInstance()
    Get the FormatIdentifierFactory instance
    Returns:
      the instance

  - ### getFormatIdentifierFor

    public FormatIdentifier getFormatIdentifierFor(String formatIdentifierId) throws FormatIdentifierNotFoundException, FormatIdentifierFactoryException, FormatIdentifierTechnicalException
    Instantiate the format identifier identified
    Parameters:
      `formatIdentifierId` - format identifier id
    Returns:
      the Format Identifier implementation
    Throws:
      `FormatIdentifierNotFoundException` - if the configuration was not found
      `FormatIdentifierFactoryException` - if the implementation was not found
      `FormatIdentifierTechnicalException` - if any technical error occurs
      `IllegalArgumentException` - if formatIdentifierId parameter is null

  - ### addFormatIdentifier

    public void addFormatIdentifier(String formatIdentifierId, FormatIdentifierConfiguration configuration)
    Add a format identifier configuration
    Parameters:
      `formatIdentifierId` - format identifier id
      `configuration` - format identifier configuration
    Throws:
      `IllegalArgumentException` - if the parameters are null : formatIdentifierId, configuration, configuration.type

  - ### removeFormatIdentifier

    public void removeFormatIdentifier(String formatIdentifierId) throws FormatIdentifierNotFoundException
    Remove a format identifier configuration by its id
    Parameters:
      `formatIdentifierId` - format identifier id
    Throws:
      `FormatIdentifierNotFoundException` - if no configuration is registered for the given formatIdentifierId
      `IllegalArgumentException` - if the parameters are null : formatIdentifierId