public abstract class BlobStoreFormat<T extends ToXContent>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
blobNameFormat |
protected NamedXContentRegistry |
namedXContentRegistry |
protected CheckedFunction<XContentParser,T,java.io.IOException> |
reader |
protected static ToXContent.Params |
SNAPSHOT_ONLY_FORMAT_PARAMS |
Modifier | Constructor and Description |
---|---|
protected |
BlobStoreFormat(java.lang.String blobNameFormat,
CheckedFunction<XContentParser,T,java.io.IOException> reader,
NamedXContentRegistry namedXContentRegistry) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
blobName(java.lang.String name) |
void |
delete(BlobContainer blobContainer,
java.lang.String name)
Deletes obj in the blob container
|
boolean |
exists(BlobContainer blobContainer,
java.lang.String name)
Checks obj in the blob container
|
T |
read(BlobContainer blobContainer,
java.lang.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,
java.lang.String blobName)
Reads and parses the blob with given blob name.
|
protected final java.lang.String blobNameFormat
protected final CheckedFunction<XContentParser,T extends ToXContent,java.io.IOException> reader
protected final NamedXContentRegistry namedXContentRegistry
protected static final ToXContent.Params SNAPSHOT_ONLY_FORMAT_PARAMS
protected BlobStoreFormat(java.lang.String blobNameFormat, CheckedFunction<XContentParser,T,java.io.IOException> reader, NamedXContentRegistry namedXContentRegistry)
blobNameFormat
- format of the blobname in String.format(Locale, String, Object...)
formatreader
- the prototype object that can deserialize objects with type Tpublic abstract T readBlob(BlobContainer blobContainer, java.lang.String blobName) throws java.io.IOException
blobContainer
- blob containerblobName
- blob namejava.io.IOException
public T read(BlobContainer blobContainer, java.lang.String name) throws java.io.IOException
blobContainer
- blob containername
- name to be translated intojava.io.IOException
public void delete(BlobContainer blobContainer, java.lang.String name) throws java.io.IOException
java.io.IOException
public boolean exists(BlobContainer blobContainer, java.lang.String name) throws java.io.IOException
java.io.IOException
protected java.lang.String blobName(java.lang.String name)
protected T read(BytesReference bytes) throws java.io.IOException
java.io.IOException