public abstract class BlobStoreFormat<T extends ToXContent> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
blobNameFormat |
protected ParseFieldMatcher |
parseFieldMatcher |
protected FromXContentBuilder<T> |
reader |
protected static ToXContent.Params |
SNAPSHOT_ONLY_FORMAT_PARAMS |
| Modifier | Constructor and Description |
|---|---|
protected |
BlobStoreFormat(String blobNameFormat,
FromXContentBuilder<T> reader,
ParseFieldMatcher parseFieldMatcher) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
blobName(String name) |
void |
delete(BlobContainer blobContainer,
String name)
Deletes obj in the blob container
|
boolean |
exists(BlobContainer blobContainer,
String name)
Checks obj in the blob container
|
T |
read(BlobContainer blobContainer,
String name)
Reads and parses the blob with given name, applying name translation using the {link #blobName} method
|
protected T |
read(BytesReference bytes) |
abstract T |
readBlob(BlobContainer blobContainer,
String blobName)
Reads and parses the blob with given blob name.
|
protected final String blobNameFormat
protected final FromXContentBuilder<T extends ToXContent> reader
protected final ParseFieldMatcher parseFieldMatcher
protected static final ToXContent.Params SNAPSHOT_ONLY_FORMAT_PARAMS
protected BlobStoreFormat(String blobNameFormat, FromXContentBuilder<T> reader, ParseFieldMatcher parseFieldMatcher)
blobNameFormat - format of the blobname in String.format(Locale, String, Object...) formatreader - the prototype object that can deserialize objects with type TparseFieldMatcher - parse field matcherpublic abstract T readBlob(BlobContainer blobContainer, String blobName) throws IOException
blobContainer - blob containerblobName - blob nameIOExceptionpublic T read(BlobContainer blobContainer, String name) throws IOException
blobContainer - blob containername - name to be translated intoIOExceptionpublic void delete(BlobContainer blobContainer, String name) throws IOException
IOExceptionpublic boolean exists(BlobContainer blobContainer, String name) throws IOException
IOExceptionprotected T read(BytesReference bytes) throws IOException
IOExceptionCopyright © 2009–2017. All rights reserved.