public class SnapshotJTransactionHttpMessageConverter extends AbstractHttpMessageConverter<SnapshotJTransaction>
HttpMessageConverter
capable of
encoding and decoding a graph of JObject
s contained in a SnapshotJTransaction
that is
backed by a NavigableMapKVStore
.
The MIME type used is application/x-permazen-transaction
.
Validation of all incoming objects is supported; see setValidationGroups()
.
Modifier and Type | Field and Description |
---|---|
static MediaType |
MIME_TYPE
MIME type supported by this class:
application/x-permazen-transaction . |
logger
Constructor and Description |
---|
SnapshotJTransactionHttpMessageConverter(Permazen jdb)
Constructor.
|
SnapshotJTransactionHttpMessageConverter(Permazen jdb,
MediaType... supportedMediaTypes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Long |
getContentLength(SnapshotJTransaction jtx,
MediaType contentType) |
protected SnapshotJTransaction |
readInternal(Class<? extends SnapshotJTransaction> clazz,
HttpInputMessage input) |
void |
setValidationGroups(Class<?>... groups)
Set validation groups used to validate all incoming objects.
|
protected boolean |
supports(Class<?> clazz) |
protected void |
writeInternal(SnapshotJTransaction jtx,
HttpOutputMessage output) |
addDefaultHeaders, canRead, canRead, canWrite, canWrite, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSupportedMediaTypes
public static final MediaType MIME_TYPE
application/x-permazen-transaction
.
Can be overridden in the constructor.
public SnapshotJTransactionHttpMessageConverter(Permazen jdb)
jdb
- Permazen
instance defining the convertible typespublic void setValidationGroups(Class<?>... groups)
If set to null, no validation is performed. Otherwise, all incoming objects in the transaction are validated,
using the specified validation groups, or Default
if an empty is specified.
By default, this is null.
groups
- validation group(s) to use for validation; if empty, Default
is assumed;
if null, no validation is performedprotected Long getContentLength(SnapshotJTransaction jtx, MediaType contentType)
getContentLength
in class AbstractHttpMessageConverter<SnapshotJTransaction>
protected boolean supports(Class<?> clazz)
supports
in class AbstractHttpMessageConverter<SnapshotJTransaction>
protected SnapshotJTransaction readInternal(Class<? extends SnapshotJTransaction> clazz, HttpInputMessage input) throws IOException
readInternal
in class AbstractHttpMessageConverter<SnapshotJTransaction>
IOException
protected void writeInternal(SnapshotJTransaction jtx, HttpOutputMessage output) throws IOException
writeInternal
in class AbstractHttpMessageConverter<SnapshotJTransaction>
IOException
Copyright © 2022. All rights reserved.