Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.storage.sql.net
Class BinaryManagerClient

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.net.BinaryManagerClient
All Implemented Interfaces:
BinaryManager

public class BinaryManagerClient
extends Object
implements BinaryManager

A Binary Manager that uses a local BinaryManager as a cache but also passes calls to a remote BinaryManagerServlet for writes and cache misses.


Constructor Summary
BinaryManagerClient(BinaryManager binaryManager, HttpClient httpClient)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryManagerClient

public BinaryManagerClient(BinaryManager binaryManager,
                           HttpClient httpClient)
Method Detail

initialize

public void initialize(RepositoryDescriptor repositoryDescriptor)
                throws IOException
Description copied from interface: BinaryManager
Initializer.

Specified by:
initialize in interface BinaryManager
Throws:
IOException

getGarbageCollector

public BinaryGarbageCollector getGarbageCollector()
Description copied from interface: BinaryManager
Returns the Binary Garbage Collector that can be used for this binary manager.

Several calls to this method will return the same GC, so that its status can be monitored using BinaryGarbageCollector.isInProgress().

Specified by:
getGarbageCollector in interface BinaryManager
Returns:
the binary GC

getBinary

public Binary getBinary(InputStream in)
                 throws IOException
Description copied from interface: BinaryManager
Saves the given input stream into a 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.

Specified by:
getBinary in interface BinaryManager
Parameters:
in - the input stream
Returns:
the corresponding binary
Throws:
IOException

getBinary

public Binary getBinary(String digest)
Description copied from interface: BinaryManager
Returns a Binary corresponding to the given digest.

A null is returned if the digest could not be found.

Specified by:
getBinary in interface BinaryManager
Parameters:
digest - the digest, or null
Returns:
the corresponding binary

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.