public class BinaryManagerClient extends Object implements BinaryManager
BinaryManager
as a cache but also
passes calls to a remote BinaryManagerServlet
for writes and cache
misses.Constructor and Description |
---|
BinaryManagerClient(BinaryManager binaryManager,
HttpClient httpClient) |
Modifier and Type | Method and Description |
---|---|
Binary |
getBinary(InputStream in)
Saves the given input stream into a
Binary . |
Binary |
getBinary(String digest)
Returns a
Binary corresponding to the given digest. |
BinaryGarbageCollector |
getGarbageCollector()
Returns the Binary Garbage Collector that can be used for this binary
manager.
|
void |
initialize(RepositoryDescriptor repositoryDescriptor)
Initializer.
|
public BinaryManagerClient(BinaryManager binaryManager, HttpClient httpClient)
public void initialize(RepositoryDescriptor repositoryDescriptor) throws IOException
BinaryManager
initialize
in interface BinaryManager
IOException
public BinaryGarbageCollector getGarbageCollector()
BinaryManager
Several calls to this method will return the same GC, so that its status
can be monitored using BinaryGarbageCollector.isInProgress()
.
getGarbageCollector
in interface BinaryManager
public Binary getBinary(InputStream in) throws IOException
BinaryManager
Binary
.
Returns a Binary
representing the stream. The Binary
includes a digest that is a sufficient representation to persist it.
The stream is closed after use.
getBinary
in interface BinaryManager
in
- the input streamIOException
public Binary getBinary(String digest)
BinaryManager
Binary
corresponding to the given digest.
A null
is returned if the digest could not be found.
getBinary
in interface BinaryManager
digest
- the digest, or null
Copyright © 2013 Nuxeo SA. All Rights Reserved.