Package com.opencqrs.esdb.client
Interface Marshaller
- All Known Implementing Classes:
JacksonMarshaller
public interface Marshaller
Interface specifying operations for HTTP request/response marshalling.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Sealed interface representing a deserialized ND-JSON response line transformed viafromQueryResponseLine(String)
.static interface
Sealed interface representing a deserialized ND-JSON response line transformed viafromReadOrObserveResponseLine(String)
. -
Method Summary
Modifier and TypeMethodDescriptionfromHealthResponse
(String response) Used byEsdbClient.health()
to transform the HTTP response body to aHealth
.fromJsonResponse
(String response) Used byEsdbClient
operations to transform any generic HTTP JSON response.fromQueryResponseLine
(String line) Used byEsdbClient
to transform an ND-JSON line from the HTTP response stream to aMarshaller.QueryResponseElement
.Used byEsdbClient
to transform an ND-JSON line from the HTTP response stream to aMarshaller.ResponseElement
.fromWriteEventsResponse
(String response) Used byEsdbClient.write(List, List)
to transform the HTTP response body to a list ofEvent
s.toQueryRequest
(String query) Used byEsdbClient
to transform the given parameters into a valid HTTP request body to be sent to the event store for query operations.toReadOrObserveEventsRequest
(String subject, Set<Option> options) Used byEsdbClient
to transform the given parameters into a valid HTTP request body toe be sent to the event store for read or observe operations.toWriteEventsRequest
(List<EventCandidate> eventCandidates, List<Precondition> preconditions) Used byEsdbClient.write(List, List)
to transform the givenEventCandidate
s andPrecondition
s to a valid HTTP request body to be sent to the event store.
-
Method Details
-
fromJsonResponse
Used byEsdbClient
operations to transform any generic HTTP JSON response.- Parameters:
response
- the JSON HTTP response body as string- Returns:
- a map representing the JSON response content
-
fromHealthResponse
Used byEsdbClient.health()
to transform the HTTP response body to aHealth
.- Parameters:
response
- the JSON HTTP response body as string- Returns:
- the
Health
-
toWriteEventsRequest
Used byEsdbClient.write(List, List)
to transform the givenEventCandidate
s andPrecondition
s to a valid HTTP request body to be sent to the event store.- Parameters:
eventCandidates
- the list of event candidates to include within the request bodypreconditions
- the preconditions to include within the request body- Returns:
- the JSON HTTP request body as string
-
fromWriteEventsResponse
Used byEsdbClient.write(List, List)
to transform the HTTP response body to a list ofEvent
s.- Parameters:
response
- the JSON HTTP response body as string- Returns:
- the list of unmarshalled
Event
s
-
toReadOrObserveEventsRequest
Used byEsdbClient
to transform the given parameters into a valid HTTP request body toe be sent to the event store for read or observe operations.- Parameters:
subject
- the subject to include within the request bodyoptions
- the options to include within the request body- Returns:
- the JSON HTTP request body as string
- See Also:
-
fromReadOrObserveResponseLine
Used byEsdbClient
to transform an ND-JSON line from the HTTP response stream to aMarshaller.ResponseElement
.- Parameters:
line
- the ND-JSON element as string- Returns:
- an unmarshalled
Marshaller.ResponseElement
-
toQueryRequest
Used byEsdbClient
to transform the given parameters into a valid HTTP request body to be sent to the event store for query operations.- Parameters:
query
- the query- Returns:
- the JSON HTTP request body as string
- See Also:
-
fromQueryResponseLine
Used byEsdbClient
to transform an ND-JSON line from the HTTP response stream to aMarshaller.QueryResponseElement
.- Parameters:
line
- the ND-JSON element as string- Returns:
- an unmarshalled
Marshaller.QueryResponseElement
-