public class SelfContainedContentRepository extends Object implements ContentRepository, org.jboss.msc.service.Service<ContentRepository>
ContentProviderContentRepository.FactoryDELETED_CONTENT, MARKED_CONTENT, OBSOLETE_CONTENT_TIMEOUT, SERVICE_NAME| Constructor and Description |
|---|
SelfContainedContentRepository() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
addContent(InputStream stream)
Add the given content to the repository along with a reference tracked by
name. |
void |
addContentReference(ContentReference reference)
Adds a reference to the content.
|
static void |
addService(org.jboss.msc.service.ServiceTarget serviceTarget)
Install the service.
|
Map<String,Set<String>> |
cleanObsoleteContent()
Clean content that is not referenced from the repository.
|
org.jboss.vfs.VirtualFile |
getContent(byte[] hash)
Get the content as a virtual file.
|
org.jboss.msc.inject.Injector<ContentProvider> |
getContentProviderInjector() |
ContentRepository |
getValue() |
boolean |
hasContent(byte[] hash)
Gets whether content with the given hash is stored in the repository.
|
void |
removeContent(ContentReference reference)
Remove the given content from the repository.
|
void |
start(org.jboss.msc.service.StartContext startContext) |
void |
stop(org.jboss.msc.service.StopContext stopContext) |
boolean |
syncContent(ContentReference reference)
Synchronize content with the given reference.
|
public static void addService(org.jboss.msc.service.ServiceTarget serviceTarget)
public org.jboss.msc.inject.Injector<ContentProvider> getContentProviderInjector()
public byte[] addContent(InputStream stream) throws IOException
ContentRepositoryname.addContent in interface ContentRepositorystream - stream from which the content can be read. Cannot be nullnullIOException - if there is a problem reading the streampublic void addContentReference(ContentReference reference)
ContentRepositoryaddContentReference in interface ContentRepositoryreference - a reference to the content to be referenced. This is also used in
ContentRepository.removeContent(ContentReference reference)public org.jboss.vfs.VirtualFile getContent(byte[] hash)
ContentRepositorygetContent in interface ContentRepositoryhash - the hash. Cannot be nullpublic boolean hasContent(byte[] hash)
ContentRepositoryhasContent in interface ContentRepositoryhash - the hash. Cannot be nulltrue if the repository has content with the given hash.public boolean syncContent(ContentReference reference)
ContentRepositorysyncContent in interface ContentRepositoryreference - the reference to be synchronized. Cannot be nulltrue if the repository has content with the given referencepublic void removeContent(ContentReference reference)
ContentRepositoryremoveContent in interface ContentRepositoryreference - a reference to the content to be unreferenced. This is also used in
ContentRepository.addContentReference(ContentReference reference)public Map<String,Set<String>> cleanObsoleteContent()
ContentRepositorycleanObsoleteContent in interface ContentRepositorypublic void start(org.jboss.msc.service.StartContext startContext)
throws org.jboss.msc.service.StartException
start in interface org.jboss.msc.service.Service<ContentRepository>org.jboss.msc.service.StartExceptionpublic void stop(org.jboss.msc.service.StopContext stopContext)
stop in interface org.jboss.msc.service.Service<ContentRepository>public ContentRepository getValue() throws IllegalStateException, IllegalArgumentException
getValue in interface org.jboss.msc.value.Value<ContentRepository>IllegalStateExceptionIllegalArgumentExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.