Package africa.absa.inception.reference
Class ReferenceApi
- java.lang.Object
-
- africa.absa.inception.api.SecureApi
-
- africa.absa.inception.reference.ReferenceApi
-
@RestController @RequestMapping("/api/reference") @CrossOrigin public class ReferenceApi extends SecureApiThe ReferenceApi class.- Author:
- Marcus Portmann
-
-
Constructor Summary
Constructors Constructor Description ReferenceApi(org.springframework.context.ApplicationContext applicationContext, IReferenceService referenceService)Constructs a new ReferenceRestController.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Country>getCountries(String localeId)Retrieve the country reference data for a specific locale.List<Language>getLanguages(String localeId)Retrieve the language reference data for a specific locale.List<MeasurementSystem>getMeasurementSystems(String localeId)Retrieve the measurement system reference data for a specific locale.List<MeasurementUnit>getMeasurementUnits(String localeId)Retrieve the measurement unit reference data for a specific locale.List<MeasurementUnitType>getMeasurementUnitTypes(String localeId)Retrieve the measurement unit type reference data for a specific locale.List<Region>getRegions(String localeId)Retrieve the region reference data for a specific locale.List<TimeZone>getTimeZones(String localeId)Retrieve the time zone reference data for a specific locale.-
Methods inherited from class africa.absa.inception.api.SecureApi
getLongValuesForAuthoritiesWithPrefix, getUUIDValuesForAuthoritiesWithPrefix, getValueForAuthorityWithPrefix, getValuesForAuthoritiesWithPrefix, hasAccessToFunction, hasAccessToTenant, hasAuthority, hasRole, inDebugMode, isSecurityDisabled, isSecurityEnabled
-
-
-
-
Constructor Detail
-
ReferenceApi
public ReferenceApi(org.springframework.context.ApplicationContext applicationContext, IReferenceService referenceService)Constructs a new ReferenceRestController.- Parameters:
applicationContext- the Spring application contextreferenceService- the Reference Service
-
-
Method Detail
-
getCountries
@RequestMapping(value="/countries", method=GET, produces="application/json") @ResponseStatus(OK) @PreAuthorize("isSecurityDisabled() or isAuthenticated()") public List<Country> getCountries(@RequestParam(value="localeId",required=false,defaultValue="en-US") String localeId) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableExceptionRetrieve the country reference data for a specific locale.- Parameters:
localeId- the Unicode locale identifier for the locale to retrieve the country reference data for- Returns:
- the country reference data
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the country reference data could not be retrieved
-
getLanguages
@RequestMapping(value="/languages", method=GET, produces="application/json") @ResponseStatus(OK) @PreAuthorize("isSecurityDisabled() or isAuthenticated()") public List<Language> getLanguages(@RequestParam(value="localeId",required=false,defaultValue="en-US") String localeId) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableExceptionRetrieve the language reference data for a specific locale.- Parameters:
localeId- the Unicode locale identifier for the locale to retrieve the language reference data for- Returns:
- the language reference data
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the language reference data could not be retrieved
-
getMeasurementSystems
@RequestMapping(value="/measurement-systems", method=GET, produces="application/json") @ResponseStatus(OK) @PreAuthorize("isSecurityDisabled() or isAuthenticated()") public List<MeasurementSystem> getMeasurementSystems(@RequestParam(value="localeId",required=false,defaultValue="en-US") String localeId) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableExceptionRetrieve the measurement system reference data for a specific locale.- Parameters:
localeId- the Unicode locale identifier for the locale to retrieve the measurement system reference data for- Returns:
- the measurement system reference data
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the measurement system reference data could not be retrieved
-
getMeasurementUnitTypes
@RequestMapping(value="/measurement-unit-types", method=GET, produces="application/json") @ResponseStatus(OK) @PreAuthorize("isSecurityDisabled() or isAuthenticated()") public List<MeasurementUnitType> getMeasurementUnitTypes(@RequestParam(value="localeId",required=false,defaultValue="en-US") String localeId) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableExceptionRetrieve the measurement unit type reference data for a specific locale.- Parameters:
localeId- the Unicode locale identifier for the locale to retrieve the measurement unit type reference data for- Returns:
- the measurement unit type reference data
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the measurement unit type reference data could not be retrieved
-
getMeasurementUnits
@RequestMapping(value="/measurement-units", method=GET, produces="application/json") @ResponseStatus(OK) @PreAuthorize("isSecurityDisabled() or isAuthenticated()") public List<MeasurementUnit> getMeasurementUnits(@RequestParam(value="localeId",required=false,defaultValue="en-US") String localeId) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableExceptionRetrieve the measurement unit reference data for a specific locale.- Parameters:
localeId- the Unicode locale identifier for the locale to retrieve the measurement unit reference data- Returns:
- the measurement unit reference data
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the measurement unit reference data could not be retrieved
-
getRegions
@RequestMapping(value="/regions", method=GET, produces="application/json") @ResponseStatus(OK) @PreAuthorize("isSecurityDisabled() or isAuthenticated()") public List<Region> getRegions(@RequestParam(value="localeId",required=false,defaultValue="en-US") String localeId) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableExceptionRetrieve the region reference data for a specific locale.- Parameters:
localeId- the Unicode locale identifier for the locale to retrieve the region reference data for- Returns:
- the region reference data
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the region reference data could not be retrieved
-
getTimeZones
@RequestMapping(value="/time-zones", method=GET, produces="application/json") @ResponseStatus(OK) @PreAuthorize("isSecurityDisabled() or isAuthenticated()") public List<TimeZone> getTimeZones(@RequestParam(value="localeId",required=false,defaultValue="en-US") String localeId) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableExceptionRetrieve the time zone reference data for a specific locale.- Parameters:
localeId- the Unicode locale identifier for the locale to retrieve the time zone reference data for- Returns:
- the time zone reference data
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the time zones reference data could not be retrieved
-
-