@RestController @RequestMapping(value="setting") public class SettingResource extends ProtectedResource
Although not required, this class is instantiated using the Jersey SpringServlet and dependencies are defined in the Sprint context XML file.
| Constructor and Description |
|---|
SettingResource()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<reactor.core.publisher.Mono<java.lang.Void>> |
addSetting(java.lang.String name,
java.lang.String value)
Adds a setting to the system.
|
org.springframework.http.ResponseEntity<reactor.core.publisher.Flux<org.nhindirect.config.model.Setting>> |
getAllSettings()
Gets all settings in the system.
|
org.springframework.http.ResponseEntity<reactor.core.publisher.Mono<org.nhindirect.config.model.Setting>> |
getSettingByName(java.lang.String name)
Gets a setting by name.
|
org.springframework.http.ResponseEntity<reactor.core.publisher.Mono<java.lang.Void>> |
removeSettingByName(java.lang.String name)
Deletes a setting in the system by name.
|
void |
setSettingRepository(org.nhindirect.config.repository.SettingRepository settingRepo)
Sets the settings repository.
|
org.springframework.http.ResponseEntity<reactor.core.publisher.Mono<java.lang.Void>> |
updateSetting(java.lang.String name,
java.lang.String value)
Updates the value of a setting.
|
@Autowired public void setSettingRepository(org.nhindirect.config.repository.SettingRepository settingRepo)
settingRepo - Settings repository@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<reactor.core.publisher.Flux<org.nhindirect.config.model.Setting>> getAllSettings()
@GetMapping(value="{name}",
produces="application/json")
public org.springframework.http.ResponseEntity<reactor.core.publisher.Mono<org.nhindirect.config.model.Setting>> getSettingByName(@PathVariable(value="name")
java.lang.String name)
name - The name of the setting to retrieve.@PutMapping(value="{name}/{value}")
public org.springframework.http.ResponseEntity<reactor.core.publisher.Mono<java.lang.Void>> addSetting(@PathVariable(value="name")
java.lang.String name,
@PathVariable(value="value")
java.lang.String value)
uriInfo - Injected URI context used for building the location URI.name - The name of the setting to add.value - The value of the setting.@PostMapping(value="{name}/{value}")
public org.springframework.http.ResponseEntity<reactor.core.publisher.Mono<java.lang.Void>> updateSetting(@PathVariable(value="name")
java.lang.String name,
@PathVariable(value="value")
java.lang.String value)
name - The name of the setting to update.value - The new value of the setting.@DeleteMapping(value="{name}")
public org.springframework.http.ResponseEntity<reactor.core.publisher.Mono<java.lang.Void>> removeSettingByName(@PathVariable(value="name")
java.lang.String name)
name - The name of the setting to delete.Copyright © 2019. All Rights Reserved.