public class HttpStore extends Object implements SegmentStore
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.
|
void |
gc()
Triggers removal of segments that are no longer referenceable.
|
BlobStore |
getBlobStore()
Returns the external BlobStore (if configured) with this store
|
SegmentNodeState |
getHead()
Returns the head state.
|
SegmentTracker |
getTracker() |
Blob |
readBlob(String reference)
Read a blob from external storage.
|
Segment |
readSegment(SegmentId id)
Reads the identified segment from this store.
|
boolean |
setHead(SegmentNodeState base,
SegmentNodeState head) |
void |
writeSegment(SegmentId id,
byte[] bytes,
int offset,
int length)
Writes the given segment to the segment store.
|
public HttpStore(URL base)
base
- make sure the url ends with a slash "/", otherwise the
requests will end up as absolute instead of relativepublic SegmentTracker getTracker()
getTracker
in interface SegmentStore
public SegmentNodeState getHead()
SegmentStore
getHead
in interface SegmentStore
public boolean setHead(SegmentNodeState base, SegmentNodeState head)
setHead
in interface SegmentStore
public boolean containsSegment(SegmentId id)
SegmentStore
containsSegment
in interface SegmentStore
id
- segment identifiertrue
if the segment exists, false
otherwisepublic Segment readSegment(SegmentId id)
SegmentStore
readSegment
in interface SegmentStore
id
- segment identifierSegmentNotFoundException
thrown if not foundpublic void writeSegment(SegmentId id, byte[] bytes, int offset, int length)
SegmentStore
writeSegment
in interface SegmentStore
id
- segment identifierbytes
- byte buffer that contains the raw contents of the segmentoffset
- start offset within the byte bufferlength
- length of the segmentpublic void close()
close
in interface SegmentStore
public Blob readBlob(String reference)
SegmentStore
readBlob
in interface SegmentStore
reference
- blob referencepublic BlobStore getBlobStore()
SegmentStore
getBlobStore
in interface SegmentStore
public void gc()
SegmentStore
gc
in interface SegmentStore
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"