Class MetadataExtracterRegistry
java.lang.Object
org.alfresco.repo.content.metadata.MetadataExtracterRegistry
Holds and provides the most appropriate metadate extracter for a particular mimetype.
The extracters themselves know how well they are able to extract metadata.
- Author:
- Jesper Steen Møller
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEmbedder(String sourceMimetype) Gets the best metadata embedder.getEmbedder(String sourceMimetype, long sourceSizeInBytes) Returns theAsynchronousExtractorif it is able to perform the embedding and is enabled.getExtracter(String sourceMimetype) Gets the best metadata extracter.getExtractor(String sourceMimetype, long sourceSizeInBytes) Returns theAsynchronousExtractorif it is able to perform the extraction and is enabled.voidregister(MetadataExtracter extracter) Register an instance of an extracter for usevoidForce the registry to drop its cache of extractors.voidsetAsyncEmbedEnabled(boolean asyncEmbedEnabled) voidsetAsyncExtractEnabled(boolean asyncExtractEnabled)
-
Constructor Details
-
MetadataExtracterRegistry
public MetadataExtracterRegistry()
-
-
Method Details
-
resetCache
public void resetCache()Force the registry to drop its cache of extractors. This is useful for the case where an extractor becomes available only after the registry has initialized the cache. -
register
Register an instance of an extracter for use- Parameters:
extracter- an extracter
-
setAsyncExtractEnabled
public void setAsyncExtractEnabled(boolean asyncExtractEnabled) -
setAsyncEmbedEnabled
public void setAsyncEmbedEnabled(boolean asyncEmbedEnabled) -
getExtractor
Returns theAsynchronousExtractorif it is able to perform the extraction and is enabled. Failing that it callsgetExtracter(String).- Parameters:
sourceSizeInBytes- size of the source content.sourceMimetype- the source MIMETYPE of the extraction- Returns:
- Returns a metadata extractor that can extract metadata from the chosen MIME type.
-
getExtracter
Gets the best metadata extracter. This is a combination of the most reliable and the most performant extracter.The result is cached for quicker access next time.
- Parameters:
sourceMimetype- the source MIME of the extraction- Returns:
- Returns a metadata extracter that can extract metadata from the chosen MIME type.
-
getEmbedder
Returns theAsynchronousExtractorif it is able to perform the embedding and is enabled. Failing that it callsgetEmbedder(String).- Parameters:
sourceSizeInBytes- size of the source content.sourceMimetype- the source MIMETYPE of the extraction- Returns:
- Returns a metadata extractor that can extract metadata from the chosen MIME type.
-
getEmbedder
Gets the best metadata embedder. This is a combination of the most reliable and the most performant embedder.The result is cached for quicker access next time.
- Parameters:
sourceMimetype- the source MIME of the extraction- Returns:
- Returns a metadata embedder that can embed metadata in the chosen MIME type.
-