Class BlobHolderAdapterComponent
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.core.api.blobholder.BlobHolderAdapterComponent
-
- All Implemented Interfaces:
BlobHolderAdapterService,Adaptable,Component,Extensible,TimestampedService
public class BlobHolderAdapterComponent extends DefaultComponent implements BlobHolderAdapterService
Runtime component to manage the pluggable factory forDocumentAdapterFactory.Also provides the service interface
BlobHolderAdapterService- Author:
- tiry
-
-
Field Summary
Fields Modifier and Type Field Description static StringBLOBHOLDERFACTORY_EPstatic StringEXTERNALBLOB_ADAPTER_EPprotected static Map<String,ExternalBlobAdapter>externalBlobAdaptersprotected Map<String,BlobHolderFactory>factoriesprotected Map<String,BlobHolderFactory>factoriesByFacetsprotected Map<String,BlobHolderFactory>factoriesByName-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description BlobHolderAdapterComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BlobHoldergetBlobHolderAdapter(DocumentModel doc)BlobHoldergetBlobHolderAdapter(DocumentModel doc, String factoryName)Get a blob holder adapter instantiated by given factory name.ExternalBlobAdaptergetExternalBlobAdapterForPrefix(String prefix)Returns the external blob adapter registered for given prefix.ExternalBlobAdaptergetExternalBlobAdapterForUri(String uri)Returns the external blob adapter parsed from given URI.BlobgetExternalBlobForUri(String uri)Returns an external blob from given uri.static Set<String>getFactoryNames()voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
BLOBHOLDERFACTORY_EP
public static final String BLOBHOLDERFACTORY_EP
- See Also:
- Constant Field Values
-
EXTERNALBLOB_ADAPTER_EP
public static final String EXTERNALBLOB_ADAPTER_EP
- See Also:
- Constant Field Values
-
factories
protected final Map<String,BlobHolderFactory> factories
-
factoriesByFacets
protected Map<String,BlobHolderFactory> factoriesByFacets
-
factoriesByName
protected Map<String,BlobHolderFactory> factoriesByName
-
externalBlobAdapters
protected static final Map<String,ExternalBlobAdapter> externalBlobAdapters
-
-
Method Detail
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContributionin classDefaultComponent
-
getExternalBlobAdapterForPrefix
public ExternalBlobAdapter getExternalBlobAdapterForPrefix(String prefix)
Description copied from interface:BlobHolderAdapterServiceReturns the external blob adapter registered for given prefix.- Specified by:
getExternalBlobAdapterForPrefixin interfaceBlobHolderAdapterService- See Also:
ExternalBlobAdapter
-
getExternalBlobAdapterForUri
public ExternalBlobAdapter getExternalBlobAdapterForUri(String uri)
Description copied from interface:BlobHolderAdapterServiceReturns the external blob adapter parsed from given URI.- Specified by:
getExternalBlobAdapterForUriin interfaceBlobHolderAdapterService- See Also:
ExternalBlobAdapter
-
getExternalBlobForUri
public Blob getExternalBlobForUri(String uri) throws PropertyException, IOException
Description copied from interface:BlobHolderAdapterServiceReturns an external blob from given uri.- Specified by:
getExternalBlobForUriin interfaceBlobHolderAdapterService- Parameters:
uri- the uri describing what adapter handles the file and the needed info to retrieve it.- Returns:
- the resolved blob.
- Throws:
PropertyException- if the blob cannot be retrieved (if adapter cannot retrieve it or if file is not found for instance)IOException- See Also:
ExternalBlobAdapter
-
getBlobHolderAdapter
public BlobHolder getBlobHolderAdapter(DocumentModel doc, String factoryName)
Description copied from interface:BlobHolderAdapterServiceGet a blob holder adapter instantiated by given factory name.- Specified by:
getBlobHolderAdapterin interfaceBlobHolderAdapterServicefactoryName- the factory name- Returns:
- a blob holder adapter
-
getBlobHolderAdapter
public BlobHolder getBlobHolderAdapter(DocumentModel doc)
- Specified by:
getBlobHolderAdapterin interfaceBlobHolderAdapterService
-
-