@NoImplement public interface DeclarationSession extends Disposable
Note that it consumes resources on the Runtime side so it has to be closed after the tooling has finished using it.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
DeclarationSession.Builder
Builder for
DeclarationSession. |
| Modifier and Type | Method and Description |
|---|---|
DeclarationSessionCacheService |
getCacheService()
Get the
DeclarationSessionCacheService from this DeclarationSession. |
default ValueResolverResult |
getFieldValues(org.mule.runtime.app.declaration.api.ParameterizedElementDeclaration elementDeclaration,
String parameterName,
String targetSelector)
Retrieve all
ResolvedValue that can be configured for a field in the given
parameter. |
ValueResolverResult |
getFieldValues(org.mule.runtime.app.declaration.api.ParameterizedElementDeclaration elementDeclaration,
String parameterName,
String targetSelector,
boolean ignoreCache)
Retrieve all
ResolvedValue that can be configured for a field in the given
parameter. |
ComponentSampleDataResult |
getSampleData(org.mule.runtime.app.declaration.api.ComponentElementDeclaration componentElementDeclaration)
Retrieve sample data for the component
|
default ValueResolverResult |
getValues(org.mule.runtime.app.declaration.api.ParameterizedElementDeclaration elementDeclaration,
String parameterName)
Retrieve all
ResolvedValue that can be configured for the given parameter. |
ValueResolverResult |
getValues(org.mule.runtime.app.declaration.api.ParameterizedElementDeclaration elementDeclaration,
String parameterName,
boolean ignoreCache)
Retrieve all
ResolvedValue that can be configured for the given parameter. |
default MetadataResult<ComponentMetadataTypesDescriptor> |
resolveComponentMetadata(org.mule.runtime.app.declaration.api.ComponentElementDeclaration componentElementDeclaration)
Retrieve the dynamic metadata associated to the component for the metadata key defined as part of the component declaration.
|
MetadataResult<ComponentMetadataTypesDescriptor> |
resolveComponentMetadata(org.mule.runtime.app.declaration.api.ComponentElementDeclaration componentElementDeclaration,
boolean ignoreCache)
Retrieve the dynamic metadata associated to the component for the metadata key defined as part of the component declaration.
|
ConnectionValidationResult |
testConnection(String configName)
Test connectivity for the connection associated to the configuration with the provided name.
|
disposeConnectionValidationResult testConnection(String configName)
configName - The name of the config for which to test connection.ConnectionValidationResult with the result of the connectivity testing.BundleNotFoundException - if any of the dependencies defined for the session could not be resolveddefault ValueResolverResult getValues(org.mule.runtime.app.declaration.api.ParameterizedElementDeclaration elementDeclaration, String parameterName)
ResolvedValue that can be configured for the given parameter.
If this DeclarationSession was created with a CacheStorage, ValueResolverResult returned may be from
the cache.elementDeclaration - a ParameterizedElementDeclaration for the Element (Configuration, Connection, Operation,
Source, etc) from which the available values can be used on the parameter .
In case the value provider requires any acting parameters to be able to resolve this values, those
parameters should be populated in this declaration. Also, if the Element requires values from a
Configuration, then its name should be specified in the declaration as configRef.parameterName - the name of the parameter for which to resolve the
ResolvedValuesValueResolverResult with the accepted parameter values to useBundleNotFoundException - if any of the dependencies defined for the session could not be resolvedValueResolverResult getValues(org.mule.runtime.app.declaration.api.ParameterizedElementDeclaration elementDeclaration, String parameterName, boolean ignoreCache)
ResolvedValue that can be configured for the given parameter.
Specify if cache should be searched for a previously obtained
ResolvedValues or the resolution should be forced again. If that is the
case, new successful ValueResolverResult will be stored in the cache.elementDeclaration - a ParameterizedElementDeclaration for the Element (Configuration, Connection, Operation,
Source, etc) from which the available values can be used on the parameter .
In case the value provider requires any acting parameters to be able to resolve this values, those
parameters should be populated in this declaration. Also, if the Element requires values from a
Configuration, then its name should be specified in the declaration as configRef.parameterName - the name of the parameter for which to resolve the
ResolvedValuesignoreCache - if this DeclarationSession was created with a CacheStorage. Then, ignore results
stored there and override them if new ones are successful.ValueResolverResult with the accepted parameter values to useBundleNotFoundException - if any of the dependencies defined for the session could not be resolveddefault ValueResolverResult getFieldValues(org.mule.runtime.app.declaration.api.ParameterizedElementDeclaration elementDeclaration, String parameterName, String targetSelector)
ResolvedValue that can be configured for a field in the given
parameter.
If this DeclarationSession was created with a CacheStorage, ValueResolverResult returned may be from
the cache.
Since we are resolving values for a field of a parameter, we may also require other fields as acting parameters for the value
provider. In this case, those fields can be given either as ParameterValue of a
ParameterizedElementDeclaration or as expressions. For any of those cases, the minimal representation is expected
since this input will be used for generating the key for caching the result. Extra information provided could cause a MISS in
the cache and force resolution when it is not required. E.g: We want to resolve values for the field: 'city' of an object
with the form:
{
'coordinates' : ?,
'country': ?,
'city': ?
}
If we depend on the set `country` to resolve the values of the `city`, the caller of this method can provide them either as a
ParameterValue or as an expression like:
#[{'county': 'Argentina'}]
And that will be used as acting parameter and as input for caching the result. If the expression provided has extra information like:
#[{'county': 'Argentina', 'coordinates':???}]
that will still resolve the proper values but will generate a different cache key. Only the minimal information should be provided.
elementDeclaration - a ParameterizedElementDeclaration for the Element (Configuration, Connection, Operation,
Source, etc) from which the available values can be used on the field contained in the parameter
. In case the value provider requires any acting parameters to be able to
resolve this values, those parameters should be populated in this declaration. Also, if the Element
requires values from a Configuration, then its name should be specified in the declaration as
configRef.parameterName - the name of the parameter for which to resolve the
ResolvedValuestargetSelector - the path of the object field for which to resolve the
ResolvedValuesValueResolverResult with the accepted parameter values to useBundleNotFoundException - if any of the dependencies defined for the session could not be resolvedValueResolverResult getFieldValues(org.mule.runtime.app.declaration.api.ParameterizedElementDeclaration elementDeclaration, String parameterName, String targetSelector, boolean ignoreCache)
ResolvedValue that can be configured for a field in the given
parameter.
Specify if cache should be searched for a previously obtained
ResolvedValues or the resolution should be forced again. If that is the
case, new successful ValueResolverResult will be stored in the cache.
Since we are resolving values for a field of a parameter, we may also require other fields as acting parameters for the value
provider. In this case, those fields can be given either as ParameterValue of a
ParameterizedElementDeclaration or as expressions. For any of those cases, the minimal representation is expected
since this input will be used for generating the key for caching the result. Extra information provided could cause a MISS in
the cache and force resolution when it is not required. E.g: We want to resolve values for the field: 'city' of an object
with the form:
{
'coordinates' : ?,
'country': ?,
'city': ?
}
If we depend on the set `country` to resolve the values of the `city`, the caller of this method can provide them either as a
ParameterValue or as an expression like:
#[{'county': 'Argentina'}]
And that will be used as acting parameter and as input for caching the result. If the expression provided has extra information like:
#[{'county': 'Argentina', 'coordinates':???}]
that will still resolve the proper values but will generate a different cache key. Only the minimal information should be provided.
elementDeclaration - a ParameterizedElementDeclaration for the Element (Configuration, Connection, Operation,
Source, etc) from which the available values can be used on the field contained in the parameter
. In case the value provider requires any acting parameters to be able to
resolve this values, those parameters should be populated in this declaration. Also, if the Element
requires values from a Configuration, then its name should be specified in the declaration as
configRef.parameterName - the name of the parameter for which to resolve the
ResolvedValuesignoreCache - if this DeclarationSession was created with a CacheStorage. Then, ignore results
stored there and override them if new ones are successful.targetSelector - the path of the object field for which to resolve the
ResolvedValuesValueResolverResult with the accepted parameter values to useBundleNotFoundException - if any of the dependencies defined for the session could not be resolveddefault MetadataResult<ComponentMetadataTypesDescriptor> resolveComponentMetadata(org.mule.runtime.app.declaration.api.ComponentElementDeclaration componentElementDeclaration)
DeclarationSession was created with a CacheStorage,
MetadataResult returned may be from the cache.componentElementDeclaration - a ComponentElementDeclaration for the Component (Operation or Source) from which
the dynamic types would be resolved, input, output and output attributes. It is expected
to have already defined and completed the metadata key parameters and if the connection,
configuration is required it would be expected too.MetadataResult with the dynamic types.BundleNotFoundException - if any of the dependencies defined for the session could not be resolvedMetadataResult<ComponentMetadataTypesDescriptor> resolveComponentMetadata(org.mule.runtime.app.declaration.api.ComponentElementDeclaration componentElementDeclaration, boolean ignoreCache)
MetadataResults or
the resolution should be forced again. If that is the case, new successful
MetadataResult will be stored in the cache.componentElementDeclaration - a ComponentElementDeclaration for the Component (Operation or Source) from which
the dynamic types would be resolved, input, output and output attributes. It is expected
to have already defined and completed the metadata key parameters and if the connection,
configuration is required it would be expected too.MetadataResult with the dynamic types.BundleNotFoundException - if any of the dependencies defined for the session could not be resolvedComponentSampleDataResult getSampleData(org.mule.runtime.app.declaration.api.ComponentElementDeclaration componentElementDeclaration)
componentElementDeclaration - a ComponentElementDeclaration for the Component (Operation or Source) from which
the sample data will be retrieved. It is expected to have already defined and completed
any required parameters and if the connection, configuration is required it would be
expected too.ComponentSampleDataResult with the sample dataBundleNotFoundException - if any of the dependencies defined for the session could not be resolvedDeclarationSessionCacheService getCacheService()
DeclarationSessionCacheService from this DeclarationSession. It provides all the actions related to
the internal caches being used by this DeclarationSessionDeclarationSession's DeclarationSessionCacheServiceCopyright © 2023 MuleSoft, Inc.. All rights reserved.