Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.convert.service
Class ConversionServiceImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.core.convert.service.ConversionServiceImpl
All Implemented Interfaces:
ConversionService, Adaptable, Component, Extensible

public class ConversionServiceImpl
extends DefaultComponent
implements ConversionService

Runtime Component that also provides the POJO implementation of the ConversionService.

Author:
tiry

Field Summary
static String CONFIG_EP
           
static String CONVERTER_EP
           
 
Constructor Summary
ConversionServiceImpl()
           
 
Method Summary
 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.
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.
 void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
          Component implementation.
static void registerConverter(ConverterDescriptor desc)
           
 void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, applicationStarted, deactivate, getAdapter, registerExtension, unregisterExtension
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONVERTER_EP

public static final String CONVERTER_EP
See Also:
Constant Field Values

CONFIG_EP

public static final String CONFIG_EP
See Also:
Constant Field Values
Constructor Detail

ConversionServiceImpl

public ConversionServiceImpl()
Method Detail

registerContribution

public void registerContribution(Object contribution,
                                 String extensionPoint,
                                 ComponentInstance contributor)
                          throws Exception
Component implementation.

Overrides:
registerContribution in class DefaultComponent
Throws:
Exception

unregisterContribution

public void unregisterContribution(Object contribution,
                                   String extensionPoint,
                                   ComponentInstance contributor)
                            throws Exception
Overrides:
unregisterContribution in class DefaultComponent
Throws:
Exception

getConverter

public static Converter getConverter(String converterName)

getConverterDescriptor

public static ConverterDescriptor getConverterDescriptor(String converterName)

getGCIntervalInMinutes

public static long getGCIntervalInMinutes()

registerConverter

public static void registerConverter(ConverterDescriptor desc)

getMaxCacheSizeInKB

public static int getMaxCacheSizeInKB()

isCacheEnabled

public static boolean isCacheEnabled()

getCacheBasePath

public static String getCacheBasePath()

getRegistredConverters

public List<String> getRegistredConverters()
Description copied from interface: ConversionService
Returns the names of the registered converters.

Specified by:
getRegistredConverters in interface ConversionService

convert

public BlobHolder convert(String converterName,
                          BlobHolder blobHolder,
                          Map<String,Serializable> parameters)
                   throws ConversionException
Description copied from interface: ConversionService
Converts a Blob given a converter name.

Specified by:
convert in interface ConversionService
Throws:
ConversionException

convertToMimeType

public BlobHolder convertToMimeType(String destinationMimeType,
                                    BlobHolder blobHolder,
                                    Map<String,Serializable> parameters)
                             throws ConversionException
Description copied from interface: ConversionService
Converts a Blob given a target destination MimeType.

Specified by:
convertToMimeType in interface ConversionService
Throws:
ConversionException

getConverterNames

public List<String> getConverterNames(String sourceMimeType,
                                      String destinationMimeType)
Description copied from interface: ConversionService
Gets the available convertNames given a source and destination MimeType.

Specified by:
getConverterNames in interface ConversionService

getConverterName

public String getConverterName(String sourceMimeType,
                               String destinationMimeType)
Description copied from interface: ConversionService
Gets the convertName given a source and destination MimeType.

Specified by:
getConverterName in interface ConversionService

isConverterAvailable

public ConverterCheckResult isConverterAvailable(String converterName)
                                          throws ConversionException
Description copied from interface: ConversionService
Checks for converter availability.

Result can be:

Result can be taken from an internal cache.

Specified by:
isConverterAvailable in interface ConversionService
Throws:
ConversionException

isConverterAvailable

public ConverterCheckResult isConverterAvailable(String converterName,
                                                 boolean refresh)
                                          throws ConversionException
Description copied from interface: ConversionService
Checks for converter availability.

Result can be:

Specified by:
isConverterAvailable in interface ConversionService
Throws:
ConversionException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.