public class ConversionServiceImpl extends DefaultComponent implements ConversionService
ConversionService
.Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_EP |
static String |
CONVERTER_EP |
Constructor and Description |
---|
ConversionServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
void |
applicationStarted(ComponentContext context)
Notify the component that Nuxeo Framework finished starting all Nuxeo bundles.
|
BlobHolder |
convert(String converterName,
BlobHolder blobHolder,
Map<String,Serializable> parameters)
Converts a Blob given a converter name.
|
BlobHolder |
convertToMimeType(String destinationMimeType,
BlobHolder blobHolder,
Map<String,Serializable> parameters)
Converts a Blob given a target destination MimeType.
|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
void |
endGC() |
<T> T |
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class associated with this object.
|
static String |
getCacheBasePath() |
static Converter |
getConverter(String converterName) |
static ConverterDescriptor |
getConverterDescriptor(String converterName) |
String |
getConverterName(String sourceMimeType,
String destinationMimeType)
Gets the convertName given a source and destination MimeType.
|
List<String> |
getConverterNames(String sourceMimeType,
String destinationMimeType)
Gets the available convertNames given a source and destination MimeType.
|
static long |
getGCIntervalInMinutes() |
static int |
getMaxCacheSizeInKB() |
List<String> |
getRegistredConverters()
Returns the names of the registered converters.
|
static boolean |
isCacheEnabled() |
ConverterCheckResult |
isConverterAvailable(String converterName)
Checks for converter availability.
|
ConverterCheckResult |
isConverterAvailable(String converterName,
boolean refresh)
Checks for converter availability.
|
boolean |
isSourceMimeTypeSupported(String converterName,
String sourceMimeType)
Returns true if the converter supports the given
sourceMimeType , false otherwise. |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor)
Component implementation.
|
static void |
registerConverter(ConverterDescriptor desc) |
static void |
setGCIntervalInMinutes(long interval) |
static void |
setMaxCacheSizeInKB(int size) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterExtension
public static final String CONVERTER_EP
public static final String CONFIG_EP
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public static ConverterDescriptor getConverterDescriptor(String converterName)
public static long getGCIntervalInMinutes()
public static void setGCIntervalInMinutes(long interval)
public static void registerConverter(ConverterDescriptor desc)
public static int getMaxCacheSizeInKB()
public static void setMaxCacheSizeInKB(int size)
public static boolean isCacheEnabled()
public static String getCacheBasePath()
public List<String> getRegistredConverters()
ConversionService
getRegistredConverters
in interface ConversionService
public BlobHolder convert(String converterName, BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
ConversionService
convert
in interface ConversionService
ConversionException
public BlobHolder convertToMimeType(String destinationMimeType, BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
ConversionService
convertToMimeType
in interface ConversionService
ConversionException
public List<String> getConverterNames(String sourceMimeType, String destinationMimeType)
ConversionService
getConverterNames
in interface ConversionService
public String getConverterName(String sourceMimeType, String destinationMimeType)
ConversionService
getConverterName
in interface ConversionService
public ConverterCheckResult isConverterAvailable(String converterName) throws ConversionException
ConversionService
Result can be:
ConverterNotRegistered
if converter is not registered.
Result can be taken from an internal cache.
isConverterAvailable
in interface ConversionService
ConversionException
public ConverterCheckResult isConverterAvailable(String converterName, boolean refresh) throws ConverterNotRegistered
ConversionService
Result can be:
ConverterNotRegistered
if converter is not registered.
isConverterAvailable
in interface ConversionService
ConverterNotRegistered
public boolean isSourceMimeTypeSupported(String converterName, String sourceMimeType)
ConversionService
sourceMimeType
, false otherwise.isSourceMimeTypeSupported
in interface ConversionService
public <T> T getAdapter(Class<T> adapter)
Adaptable
null
if no such object can be found.getAdapter
in interface Adaptable
getAdapter
in class DefaultComponent
adapter
- the adapter class to look upnull
if this object does not have an adapter for
the given classpublic void applicationStarted(ComponentContext context)
Component
applicationStarted
in interface Component
applicationStarted
in class DefaultComponent
public void endGC()
Copyright © 2015 Nuxeo SA. All rights reserved.