Interface PreferencesApi


@FeignClient(name="preferences-service", qualifiers="preferencesApi") public interface PreferencesApi
A PreferencesApi defines the public REST API to manage preferences.
Author:
Heiko Scherrer
  • Field Details

  • Method Details

    • findAll

      @Cacheable("preferences") @GetMapping("/v1/preferences") List<PreferenceVO> findAll()
      Find and return all existing preferences.
      Returns:
      All existing Preferences
    • findByPKey

      @Cacheable("preferences") @GetMapping("/v1/preferences/{pKey}") PreferenceVO findByPKey(@PathVariable("pKey") String pKey)
      Find and return a Preference identified by its persistent key.
      Parameters:
      pKey - The persistent identifier
      Returns:
      The instance
    • findAllOfScope

      @Cacheable("preferences") @GetMapping(value="/v1/preferences", params="scope") List<PreferenceVO> findAllOfScope(@RequestParam("scope") String scope)
      Find and return all existing preferences with the given scope.
      Parameters:
      scope - The scope to search for
      Returns:
      All existing Preferences
    • findByOwnerScopeKey

      @Cacheable("preferences") @GetMapping(value="/v1/preferences", params={"scope","key"}) PreferenceVO findByOwnerScopeKey(@RequestParam(value="owner",required=false) String owner, @RequestParam("scope") @NotBlank @NotBlank String scope, @RequestParam("key") @NotBlank @NotBlank String key)
      Find and return a Preference with the given identifying attributes.
      Parameters:
      owner - The owner of the Preference (nullable)
      scope - The scope of the Preference (APPLICATION, MODULE, ROLE or USER)
      key - The key of the Preference
      Returns:
      The existing Preference
      Throws:
      org.ameba.exception.NotFoundException - If no Preference exists
    • findForOwnerAndScopeAndGroupName

      @Cacheable("preferences") @GetMapping(value="/preferences/groups", params={"scope","name"}, produces="application/json") List<PreferenceVO> findForOwnerAndScopeAndGroupName(@RequestParam(value="owner",required=false) String owner, @RequestParam("scope") @NotBlank @NotBlank String scope, @RequestParam("name") String groupName)
      Find and return all Preferences that belong to a group with the same groupName.
      Parameters:
      owner - The owner of the Preference
      scope - What kind of Preference it is
      groupName - The name of the group
      Returns:
      All instances, never null
    • create

      @PostMapping("/v1/preferences") void create(@RequestBody PreferenceVO preference)
      Create a new not-existing preference.
      Parameters:
      preference - The content to update the preference with
    • update

      @PutMapping("/v1/preferences/{pKey}") PreferenceVO update(@PathVariable("pKey") String pKey, @RequestBody PreferenceVO preference)
      Update the content of an existing preference identified by its persistent key.
      Parameters:
      pKey - The persistent key of the preference to update
      preference - The content to update the preference with
    • delete

      @DeleteMapping("/v1/preferences/{pKey}") void delete(@PathVariable("pKey") String pKey)
      Delete an existing preference identified by its persistent key.
      Parameters:
      pKey - The persistent key of the preference to update