public interface ContentRepository
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Performs any cleanup actions that may need to be taken upon system
restart.
|
ContentClaim |
clone(ContentClaim original,
boolean lossTolerant)
Clones the content for the given content claim and returns content claim
of the new object
|
ContentClaim |
create(boolean lossTolerant)
Creates a new content claim
|
int |
decrementClaimantCount(ContentClaim claim)
Reduces the number of claimants for the given claim.
|
long |
exportTo(ContentClaim claim,
OutputStream destination)
Exports the content of the given claim to the given destination.
|
long |
exportTo(ContentClaim claim,
OutputStream destination,
long offset,
long length)
Exports a subset of the content of the given claim, starting at offset
and copying length bytes, to the given destination.
|
long |
exportTo(ContentClaim claim,
Path destination,
boolean append)
Exports the content of the given claim to the given destination.
|
long |
exportTo(ContentClaim claim,
Path destination,
boolean append,
long offset,
long length)
Exports the content of the given claim to the given destination.
|
int |
getClaimantCount(ContentClaim claim)
Obtains the current number of claimants for the given claim
|
long |
getContainerCapacity(String containerName)
Returns the maximum number of bytes that can be stored in the storage
mechanism that backs the container with the given name
|
Set<String> |
getContainerNames()
Returns the names of all Containers that exist for this Content
Repository
|
long |
getContainerUsableSpace(String containerName)
Returns the number of bytes available to be used used by the storage
mechanism that backs the container with the given name
|
long |
importFrom(InputStream content,
ContentClaim claim)
Imports content from the given stream creating a new content object and
claim within the repository.
|
long |
importFrom(InputStream content,
ContentClaim claim,
boolean append)
Imports content from the given stream, appending or replacing the current
claim, according to the value of the appen dargument
|
long |
importFrom(Path content,
ContentClaim claim)
Imports content from the given path creating a new content object and
claim within the repository.
|
long |
importFrom(Path content,
ContentClaim claim,
boolean append)
Imports content from the given path to the specified claim, appending or
replacing the current claim, according to the value of the append
argument
|
int |
incrementClaimaintCount(ContentClaim claim)
Increments the number of claimants for the given claim
|
void |
initialize(ContentClaimManager claimManager)
Initializes the Content Repository, providing to it the
ContentClaimManager that is to be used for interacting with Content
Claims
|
boolean |
isAccessible(ContentClaim contentClaim)
Returns a boolean indicating whether or not the content specified by the
given claim can be read, regardless of whether the content has been
archived or not.
|
long |
merge(Collection<ContentClaim> claims,
ContentClaim destination,
byte[] header,
byte[] footer,
byte[] demarcator)
Creates a new content item that is the merger in iteration order of all
content for the given claims
|
void |
purge()
Purges the contents of the repository, as if the repository were newly
created.
|
InputStream |
read(ContentClaim claim)
Provides access to the input stream for the given claim
|
boolean |
remove(ContentClaim claim)
Removes the content indicated by the given claim
|
void |
shutdown()
Shuts down the Content Repository, freeing any resources that may be held.
|
long |
size(ContentClaim claim) |
OutputStream |
write(ContentClaim claim)
Obtains an OutputStream to the content for the given claim.
|
void initialize(ContentClaimManager claimManager) throws IOException
claimManager
- IOException
void shutdown()
Set<String> getContainerNames()
long getContainerCapacity(String containerName) throws IOException
containerName
- IOException
IllegalArgumentException
- if no container exists with the given
namelong getContainerUsableSpace(String containerName) throws IOException
containerName
- IOException
IllegalArgumentException
- if no container exists with the given
nameContentClaim create(boolean lossTolerant) throws IOException
lossTolerant
- indicates whether the content for the new claim is
loss tolerant. If true the repository might choose more volatile storage
options which could increase performance for a tradeoff with reliabilityIOException
int incrementClaimaintCount(ContentClaim claim)
claim
- int getClaimantCount(ContentClaim claim)
claim
- int decrementClaimantCount(ContentClaim claim)
claim
- boolean remove(ContentClaim claim)
claim
- ContentClaim clone(ContentClaim original, boolean lossTolerant) throws IOException
original
- lossTolerant
- IOException
- if an IO error occurs. Any content written to the new
destination prior to the error will be destroyedlong merge(Collection<ContentClaim> claims, ContentClaim destination, byte[] header, byte[] footer, byte[] demarcator) throws IOException
claims
- the claims to merge which will be combined in order of
collection iterationdestination
- the claim to write the merged content toheader
- if supplied will be prepended to the outputfooter
- if supplied will be appended to the outputdemarcator
- if supplied will be placed in between each merged
objectIOException
IllegalArgumentException
- if the given destination is included in
the given claimslong importFrom(Path content, ContentClaim claim) throws IOException
content
- claim
- the claim to write imported content toIOException
long importFrom(Path content, ContentClaim claim, boolean append) throws IOException
content
- claim
- the claim to write imported content toappend
- if true, the content will be appended to the claim; if
false, the content will replace the contents of the claimIOException
long importFrom(InputStream content, ContentClaim claim) throws IOException
content
- claim
- the claim to write imported content toIOException
long importFrom(InputStream content, ContentClaim claim, boolean append) throws IOException
content
- claim
- append
- IOException
long exportTo(ContentClaim claim, Path destination, boolean append) throws IOException
claim
- destination
- where to export dataappend
- if true appends to the destination; false overwritesIOException
- if an IO error occurs. The state of the content for
the given destination is unknown and callers should consider whether they
should clean up any partially created pathslong exportTo(ContentClaim claim, Path destination, boolean append, long offset, long length) throws IOException
claim
- destination
- where to export dataappend
- if true appends to the destination; false overwritesoffset
- the offset at which the claim should start being copiedlength
- the number of bytes to copyIOException
- if an IO error occurs. The state of the content for
the given destination is unknown and callers should consider whether they
should clean up any partially created pathslong exportTo(ContentClaim claim, OutputStream destination) throws IOException
claim
- destination
- where to export dataIOException
- if an IO error occurs.long exportTo(ContentClaim claim, OutputStream destination, long offset, long length) throws IOException
claim
- destination
- where to export dataoffset
- the offset into the claim at which the copy should beginlength
- the number of bytes to copyIOException
- if an IO error occurs.long size(ContentClaim claim) throws IOException
claim
- IOException
InputStream read(ContentClaim claim) throws IOException
claim
- IOException
OutputStream write(ContentClaim claim) throws IOException
claim
- IOException
void purge()
void cleanup()
boolean isAccessible(ContentClaim contentClaim) throws IOException
false
.contentClaim
- the Content Claim to checkIOException
Copyright © 2015 Apache NiFi(incubating) Project. All rights reserved.