public class MuleExtensionUtils extends Object
extensions| Constructor and Description |
|---|
MuleExtensionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addInterceptorFactory(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration,
org.mule.runtime.extension.api.runtime.InterceptorFactory interceptorFactory)
Adds the given
interceptorFactory to the declaration as the last interceptor in the list |
static void |
addInterceptorFactory(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration,
org.mule.runtime.extension.api.runtime.InterceptorFactory interceptorFactory,
int position)
Adds the given
interceptorFactory to the declaration at the given position |
static List<org.mule.runtime.extension.api.runtime.operation.Interceptor> |
createInterceptors(org.mule.runtime.api.meta.model.EnrichableModel model)
Creates a new
List of interceptors using the factories returned by
InterceptorsModelProperty (if present). |
static List<org.mule.runtime.extension.api.runtime.operation.Interceptor> |
createInterceptors(List<org.mule.runtime.extension.api.runtime.InterceptorFactory> interceptorFactories)
|
static List<org.mule.runtime.api.meta.model.connection.ConnectionProviderModel> |
getAllConnectionProviders(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel)
Returns all the
ConnectionProviderModel instances available for the given configurationModel plus the ones
globally defined at the extensionModel. |
static ClassLoader |
getClassLoader(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
If the
extensionModel contains a ClassLoaderModelProperty, then it returns the ClassLoader associated
to such property. |
static org.mule.runtime.extension.api.runtime.config.ConfigurationFactory |
getConfigurationFactory(org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel)
Tests the
configurationModel for a ConfigurationFactoryModelProperty and returns the contained
ConfigurationFactory. |
static org.mule.runtime.extension.api.runtime.connectivity.ConnectionProviderFactory |
getConnectionProviderFactory(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel connectionProviderModel)
Tests the given
connectionProviderModel for a ConnectionProviderFactoryModelProperty and if present it
returns the enclosed ConnectionProviderFactory. |
static Type |
getConnectionType(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel connectionProviderModel)
Tests the given
connectionProviderModel for a ConnectionTypeModelProperty and if present it returns the
enclosed connection type. |
static String |
getExtensionsNamespace(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration extensionDeclaration) |
static String |
getExtensionsNamespace(org.mule.runtime.api.meta.model.ExtensionModel extensionModel) |
static String |
getImplicitConfigurationProviderName(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.config.ConfigurationModel implicitConfigurationModel) |
static org.mule.runtime.extension.api.metadata.MetadataResolverFactory |
getMetadataResolverFactory(org.mule.runtime.api.meta.model.EnrichableModel model)
Tests the given
model for a MetadataResolverFactoryModelProperty and if present it returns the contained
MetadataResolverFactory. |
static <T extends org.mule.runtime.api.meta.model.ComponentModel> |
getOperationExecutorFactory(T operationModel)
Tests the given
operationModel for a ComponentExecutorModelProperty and if present it returns the enclosed
ComponentExecutorFactory. |
static org.mule.runtime.extension.api.runtime.source.SourceFactory |
getSourceFactory(org.mule.runtime.api.meta.model.source.SourceModel sourceModel)
Tests the given
sourceModel for a SourceFactoryModelProperty and if present it returns the enclosed
SourceFactory. |
static <T> boolean |
hasAnyDynamic(Iterable<ValueResolver<T>> resolvers)
|
static boolean |
isExpression(Object value)
TODO MULE-14603 - This should not exist after MULE-14603 is fixed
Indicates if the given value is considered as an expression
|
static boolean |
isNullSafe(org.mule.runtime.api.meta.model.parameter.ParameterModel parameterModel) |
static org.mule.runtime.api.meta.model.ExtensionModel |
loadExtension(Class<?> clazz) |
static org.mule.runtime.api.meta.model.ExtensionModel |
loadExtension(Class<?> clazz,
Map<String,Object> params) |
static boolean |
returnsListOfMessages(org.mule.runtime.api.meta.model.HasOutputModel componentModel) |
static boolean |
supportsOAuth(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
Whether at least one
ConnectionProviderModel in the given supports OAuth authentication |
static byte |
toActionCode(org.mule.runtime.extension.api.tx.OperationTransactionalAction action)
Converts the given
action to its equivalent transactional action as defined in TransactionConfig |
static byte |
toActionCode(org.mule.runtime.extension.api.tx.SourceTransactionalAction action)
Converts the given
action to its equivalent transactional action as defined in TransactionConfig |
static Optional<org.mule.runtime.extension.api.runtime.source.BackPressureAction> |
toBackPressureAction(MessageSource.BackPressureStrategy backPressureStrategy) |
static MessageSource.BackPressureStrategy |
toBackPressureStrategy(org.mule.runtime.extension.api.runtime.source.BackPressureMode mode) |
static MessageSource.BackPressureStrategy |
toBackPressureStrategy(String backPressureModeName) |
static Map<String,Object> |
toMap(ResolverSet resolverSet,
CoreEvent event) |
static Map<String,Object> |
toMap(ResolverSet resolverSet,
ValueResolvingContext ctx) |
static <T> T |
withExtensionClassLoader(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
Callable<T> callable)
|
public static boolean returnsListOfMessages(org.mule.runtime.api.meta.model.HasOutputModel componentModel)
componentModel - a ComponentModelcomponentModel returns a list of messagespublic static <T> boolean hasAnyDynamic(Iterable<ValueResolver<T>> resolvers)
T - the generic type of the ValueResolver itemsresolvers - a Iterable with instances of ValueResolvertrue if at least one ValueResolver is dynamic, false otherwisepublic static Map<String,Object> toMap(ResolverSet resolverSet, CoreEvent event) throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionpublic static Map<String,Object> toMap(ResolverSet resolverSet, ValueResolvingContext ctx) throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionpublic static boolean isNullSafe(org.mule.runtime.api.meta.model.parameter.ParameterModel parameterModel)
parameterModel - a ParameterModelpublic static List<org.mule.runtime.api.meta.model.connection.ConnectionProviderModel> getAllConnectionProviders(org.mule.runtime.api.meta.model.ExtensionModel extensionModel, org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel)
ConnectionProviderModel instances available for the given configurationModel plus the ones
globally defined at the extensionModel. The List will first contain those defined at a
HasConnectionProviderModels.getConnectionProviders() level and finally the ones at
ExtensionModel.getConnectionProviders()extensionModel - the ExtensionModel which owns the configurationModelconfigurationModel - a ConfigurationModelList. Might be empty but will never be nullpublic static boolean supportsOAuth(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
ConnectionProviderModel in the given supports OAuth authenticationextensionModel - a ExtensionModeltrue if a ConnectionProviderModel exist which is OAuth enabledpublic static List<org.mule.runtime.extension.api.runtime.operation.Interceptor> createInterceptors(org.mule.runtime.api.meta.model.EnrichableModel model)
List of interceptors using the factories returned by
InterceptorsModelProperty (if present).model - the model on which InterceptorsModelProperty is to be invokedList with instances of Interceptorpublic static void addInterceptorFactory(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration,
org.mule.runtime.extension.api.runtime.InterceptorFactory interceptorFactory)
interceptorFactory to the declaration as the last interceptor in the listdeclaration - a BaseDeclarationinterceptorFactory - a InterceptorFactorypublic static void addInterceptorFactory(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration,
org.mule.runtime.extension.api.runtime.InterceptorFactory interceptorFactory,
int position)
interceptorFactory to the declaration at the given positiondeclaration - a BaseDeclarationinterceptorFactory - a InterceptorFactoryposition - a valid list indexpublic static List<org.mule.runtime.extension.api.runtime.operation.Interceptor> createInterceptors(List<org.mule.runtime.extension.api.runtime.InterceptorFactory> interceptorFactories)
public static ClassLoader getClassLoader(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
extensionModel contains a ClassLoaderModelProperty, then it returns the ClassLoader associated
to such property. Otherwise, it returns the current TCCLextensionModel - a ExtensionModelClassLoaderpublic static <T> T withExtensionClassLoader(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
Callable<T> callable)
throws Exception
public static byte toActionCode(org.mule.runtime.extension.api.tx.OperationTransactionalAction action)
action to its equivalent transactional action as defined in TransactionConfigaction - a OperationTransactionalActionpublic static byte toActionCode(org.mule.runtime.extension.api.tx.SourceTransactionalAction action)
action to its equivalent transactional action as defined in TransactionConfigaction - a SourceTransactionalActionpublic static MessageSource.BackPressureStrategy toBackPressureStrategy(org.mule.runtime.extension.api.runtime.source.BackPressureMode mode)
mode - a BackPressureModeMessageSource.BackPressureStrategypublic static MessageSource.BackPressureStrategy toBackPressureStrategy(String backPressureModeName)
backPressureModeName - the name of a BackPressureModeMessageSource.BackPressureStrategypublic static Optional<org.mule.runtime.extension.api.runtime.source.BackPressureAction> toBackPressureAction(MessageSource.BackPressureStrategy backPressureStrategy)
public static org.mule.runtime.extension.api.runtime.config.ConfigurationFactory getConfigurationFactory(org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel)
configurationModel for a ConfigurationFactoryModelProperty and returns the contained
ConfigurationFactory.configurationModel - a ConfigurationModelConfigurationFactoryorg.mule.runtime.extension.api.exception.IllegalConfigurationModelDefinitionException - if the configurationModel doesn't contain such model propertypublic static org.mule.runtime.extension.api.metadata.MetadataResolverFactory getMetadataResolverFactory(org.mule.runtime.api.meta.model.EnrichableModel model)
model for a MetadataResolverFactoryModelProperty and if present it returns the contained
MetadataResolverFactory. If no such property is found, then a NullMetadataResolverFactory is returnedmodel - an enriched modelMetadataResolverFactorypublic static <T extends org.mule.runtime.api.meta.model.ComponentModel> org.mule.runtime.extension.api.runtime.operation.ComponentExecutorFactory<T> getOperationExecutorFactory(T operationModel)
operationModel for a ComponentExecutorModelProperty and if present it returns the enclosed
ComponentExecutorFactory. If no such property is found, then a IllegalOperationModelDefinitionException is
thrown.operationModel - an OperationModelComponentExecutorFactoryorg.mule.runtime.extension.api.exception.IllegalOperationModelDefinitionException - if the operation is not properly enrichedpublic static org.mule.runtime.extension.api.runtime.source.SourceFactory getSourceFactory(org.mule.runtime.api.meta.model.source.SourceModel sourceModel)
sourceModel for a SourceFactoryModelProperty and if present it returns the enclosed
SourceFactory. If no such property is found, then a IllegalSourceModelDefinitionException is thrownsourceModel - a SourceModelSourceFactoryorg.mule.runtime.extension.api.exception.IllegalSourceModelDefinitionException - if the source is not properly enrichedpublic static org.mule.runtime.extension.api.runtime.connectivity.ConnectionProviderFactory getConnectionProviderFactory(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel connectionProviderModel)
connectionProviderModel for a ConnectionProviderFactoryModelProperty and if present it
returns the enclosed ConnectionProviderFactory. If no such property is found, then a
IllegalConnectionProviderModelDefinitionException is thrownconnectionProviderModel - a ConnectionProviderModelSourceFactoryorg.mule.runtime.extension.api.exception.IllegalConnectionProviderModelDefinitionException - if the connection provider is not properly enrichedpublic static Type getConnectionType(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel connectionProviderModel)
connectionProviderModel for a ConnectionTypeModelProperty and if present it returns the
enclosed connection type. If no such property is found, then a IllegalConnectionProviderModelDefinitionException is
thrownconnectionProviderModel - a ConnectionProviderModelClassorg.mule.runtime.extension.api.exception.IllegalConnectionProviderModelDefinitionException - if the connection provider is not properly enrichedpublic static String getExtensionsNamespace(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
ExtensionModelpublic static String getExtensionsNamespace(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration extensionDeclaration)
ExtensionDeclarationpublic static org.mule.runtime.api.meta.model.ExtensionModel loadExtension(Class<?> clazz)
public static org.mule.runtime.api.meta.model.ExtensionModel loadExtension(Class<?> clazz, Map<String,Object> params)
public static String getImplicitConfigurationProviderName(org.mule.runtime.api.meta.model.ExtensionModel extensionModel, org.mule.runtime.api.meta.model.config.ConfigurationModel implicitConfigurationModel)
public static boolean isExpression(Object value)
value - Value to checkCopyright © 2003–2024 MuleSoft, Inc.. All rights reserved.