@Controller
@ConditionalOnBean(value=de.otto.synapse.state.StateRepository.class)
@ConditionalOnProperty(prefix="synapse.edison.state.ui",
name="enabled",
havingValue="true",
matchIfMissing=true)
public class StateRepositoryRestController
extends java.lang.Object
| Constructor and Description |
|---|
StateRepositoryRestController(java.util.List<de.otto.synapse.state.StateRepository<?>> stateRepositories,
de.otto.synapse.journal.JournalRegistry journals,
EdisonStateRepositoryUiProperties properties,
java.lang.String managementBasePath) |
| Modifier and Type | Method and Description |
|---|---|
de.otto.edison.hal.HalRepresentation |
getEntityJson(java.lang.String repositoryName,
java.lang.String entityId,
org.springframework.web.util.UriComponentsBuilder uriComponentsBuilder)
Returns an application/hal+json representation of a single event-sourced entity stored in the
StateRepository with the specified repositoryName. |
de.otto.edison.hal.HalRepresentation |
getStateRepositories(javax.servlet.http.HttpServletRequest request)
Returns an application/hal+json representation of the container-resource containing all staterepositories that
are not
excluded from the state-repository UI. |
de.otto.edison.hal.HalRepresentation |
getStateRepository(java.lang.String repositoryName,
int page,
int pageSize,
org.springframework.web.util.UriComponentsBuilder uriComponentsBuilder)
Returns an application/hal+json representation of a
StateRepository, containing a pageable collection
resource with links to the event-sourced entities stored in the repository. |
public StateRepositoryRestController(java.util.List<de.otto.synapse.state.StateRepository<?>> stateRepositories,
de.otto.synapse.journal.JournalRegistry journals,
EdisonStateRepositoryUiProperties properties,
@Value(value="${edison.application.management.base-path:internal}")
java.lang.String managementBasePath)
@GetMapping(path="${edison.application.management.base-path:internal}/staterepositories",
produces={"application/hal+json","application/json"})
@ResponseBody
public de.otto.edison.hal.HalRepresentation getStateRepositories(javax.servlet.http.HttpServletRequest request)
excluded from the state-repository UI.request - current HttpServletRequest@GetMapping(path="${edison.application.management.base-path:internal}/staterepositories/{repositoryName}",
produces={"application/hal+json","application/json"})
@ResponseBody
public de.otto.edison.hal.HalRepresentation getStateRepository(@PathVariable
java.lang.String repositoryName,
@RequestParam(defaultValue="0")
int page,
@RequestParam(defaultValue="100")
int pageSize,
org.springframework.web.util.UriComponentsBuilder uriComponentsBuilder)
StateRepository, containing a pageable collection
resource with links to the event-sourced entities stored in the repository.repositoryName - the name of the StateRepositorypage - the zero-based page numberpageSize - the number of entities to returnuriComponentsBuilder - builder used to create hrefs@GetMapping(path="${edison.application.management.base-path:internal}/staterepositories/{repositoryName}/{entityId}",
produces={"application/hal+json","application/json"})
@ResponseBody
public de.otto.edison.hal.HalRepresentation getEntityJson(@PathVariable
java.lang.String repositoryName,
@PathVariable
java.lang.String entityId,
org.springframework.web.util.UriComponentsBuilder uriComponentsBuilder)
StateRepository with the specified repositoryName.
If the state repository has a Journal, the returned
entity representation will contain a link to the messages that where leading to the current state of the
entity.
repositoryName - the name of the StateRepositoryentityId - the id of the requested entityuriComponentsBuilder - builder used to create hrefs