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 String
BLOBHOLDERFACTORY_EP
static String
EXTERNALBLOB_ADAPTER_EP
protected static Map<String,ExternalBlobAdapter>
externalBlobAdapters
protected Map<String,BlobHolderFactory>
factories
protected Map<String,BlobHolderFactory>
factoriesByFacets
protected 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 BlobHolder
getBlobHolderAdapter(DocumentModel doc)
BlobHolder
getBlobHolderAdapter(DocumentModel doc, String factoryName)
Get a blob holder adapter instantiated by given factory name.ExternalBlobAdapter
getExternalBlobAdapterForPrefix(String prefix)
Returns the external blob adapter registered for given prefix.ExternalBlobAdapter
getExternalBlobAdapterForUri(String uri)
Returns the external blob adapter parsed from given URI.Blob
getExternalBlobForUri(String uri)
Returns an external blob from given uri.static Set<String>
getFactoryNames()
void
registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
void
unregisterContribution(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:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContribution
in classDefaultComponent
-
getExternalBlobAdapterForPrefix
public ExternalBlobAdapter getExternalBlobAdapterForPrefix(String prefix)
Description copied from interface:BlobHolderAdapterService
Returns the external blob adapter registered for given prefix.- Specified by:
getExternalBlobAdapterForPrefix
in interfaceBlobHolderAdapterService
- See Also:
ExternalBlobAdapter
-
getExternalBlobAdapterForUri
public ExternalBlobAdapter getExternalBlobAdapterForUri(String uri)
Description copied from interface:BlobHolderAdapterService
Returns the external blob adapter parsed from given URI.- Specified by:
getExternalBlobAdapterForUri
in interfaceBlobHolderAdapterService
- See Also:
ExternalBlobAdapter
-
getExternalBlobForUri
public Blob getExternalBlobForUri(String uri) throws PropertyException, IOException
Description copied from interface:BlobHolderAdapterService
Returns an external blob from given uri.- Specified by:
getExternalBlobForUri
in 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:BlobHolderAdapterService
Get a blob holder adapter instantiated by given factory name.- Specified by:
getBlobHolderAdapter
in interfaceBlobHolderAdapterService
factoryName
- the factory name- Returns:
- a blob holder adapter
-
getBlobHolderAdapter
public BlobHolder getBlobHolderAdapter(DocumentModel doc)
- Specified by:
getBlobHolderAdapter
in interfaceBlobHolderAdapterService
-
-