Package org.openwms.core.preferences.api
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
create
(PreferenceVO preference) Create a new not-existing preference.void
Delete an existing preference identified by its persistent key.findAll()
Find and return all existing preferences.findAllOfScope
(String scope) Find and return all existing preferences with the givenscope
.findByOwnerScopeKey
(String owner, @NotBlank String scope, @NotBlank String key) Find and return a Preference with the given identifying attributes.findByPKey
(String pKey) Find and return a Preference identified by its persistent key.findForOwnerAndScopeAndGroupName
(String owner, @NotBlank String scope, String groupName) Find and return allPreference
s that belong to a group with the samegroupName
.update
(String pKey, PreferenceVO preference) Update the content of an existing preference identified by its persistent key.
-
Field Details
-
API_VERSION
API version.- See Also:
-
API_PREFERENCES
API root to hit Preferences (plural).- See Also:
-
-
Method Details
-
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 givenscope
.- 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 allPreference
s that belong to a group with the samegroupName
.- Parameters:
owner
- The owner of the Preferencescope
- What kind of Preference it isgroupName
- The name of the group- Returns:
- All instances, never null
-
create
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 updatepreference
- The content to update the preference with
-
delete
Delete an existing preference identified by its persistent key.- Parameters:
pKey
- The persistent key of the preference to update
-