OpenMRSConfigService

public interface OpenMRSConfigService

Service responsible for managing configurations for the OpenMRS servers.

Methods

addConfig

void addConfig(Config config)

Saves the given configuration. If configuration with the same name already exists ConfigurationAlreadyExistsException will be thrown.

Parameters:
  • config – the configuration to be saved

deleteAllConfigs

void deleteAllConfigs()

Deletes all configurations.

deleteConfig

void deleteConfig(String name)

Deletes configuration with the given name. If configuration with the name does not exist a ConfigurationNotFoundException exception will be thrown.

Parameters:
  • name – the name of the configuration to be deleted

getConfigByName

Config getConfigByName(String name)

Returns configuration by its name.

Parameters:
  • name – the name of the configuration
Returns:

the configuration with the given name

getConfigs

Configs getConfigs()

Returns the list of all configurations.

Returns:the list of all configurations

getDefaultConfig

Config getDefaultConfig()

Returns the default configuration.

Returns:the default configuration

markConfigAsDefault

void markConfigAsDefault(String name)

Marks configuration with the given name as a default one. If configuration with the name does not exist a ConfigurationNotFoundException exception will be thrown.

Parameters:
  • name – the name of the configuration to be set as default

saveAllConfigs

void saveAllConfigs(Configs configs)

Saves the given list of configurations.

Parameters:
  • configs – list of configurations to be saved

updateConfig

void updateConfig(Config config)

Updates configuration with the same name with the passed data. If configuration with the name does not exist a ConfigurationNotFoundException exception will be thrown.

Parameters:
  • config – the configuration to serve as an update source

verifyConfig

boolean verifyConfig(Config config)

Verifies OpenMRS connection with the given configuration.

Parameters:
  • config – the configuration to be verified
Returns:

true if connection was successful