[
https://issues.apache.org/jira/browse/CAMEL-6306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13639648#comment-13639648
]
Alan Foster commented on CAMEL-6306:
------------------------------------
I'm a big fan of this idea! I wonder if it should be merged with 2.10.x/2.11.x
too?
It would also be interesting to see if there was a way to support available
values + default value if possible
For instance from the JMS component documentation there is an UriParam
'acknowledgementModeName' with specific allowed values
|| Option || Default Value || Description ||
| acknowledgementModeName |AUTO_ACKNOWLEDGE | The JMS acknowledgement
name, which is one of: SESSION_TRANSACTED, CLIENT_ACKNOWLEDGE,
AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE|
It would be nice to expand the annotation type to maybe have
{code:java}
@UriParam(name = "acknowledgementModeName",
defaultValue = "AUTO_ACKNOWLEDGE",
values = { "SESSION_TRANSACTED", "CLIENT_ACKNOWLEDGE",
"AUTO_ACKNOWLEDGE", "DUPS_OK_ACKNOWLEDGE" })
private String acknowledgementModeName;
{code}
{code:java}
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target({ElementType.FIELD })
public @interface UriParam {
/**
* Returns the name of the parameter.
*
* If this is not specified then the name of the field or property which
has this annotation is used.
*/
String name() default "";
/**
*
* @return The default value that this uri param will use if none is
supplied by the endpoint
*/
String defaultValue() default "";
/**
*
* @return The range of possible values for this param
*/
String[] values() default "";
}
{code}
That gives the benefit of offering intelli-sense on IDEs, which would be great.
Obviously there are specific datatypes which you can infer possible values
from, ie boolean is true or false, but for string based constants this would
certainly be useful!
> provide a way to introspect a component, find the various parameters
> available and their types so that tooling can provide forms to let users
> create & customise endpoints
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-6306
> URL: https://issues.apache.org/jira/browse/CAMEL-6306
> Project: Camel
> Issue Type: New Feature
> Reporter: james strachan
> Assignee: james strachan
> Fix For: 2.12.0
>
>
> From the current EndpointConfiguration you need a URI or Endpoint to be able
> to get the configuration object; and there's no way to introspect it to find
> its properties.
> Tools like IDEs or web consoles typically need to start from a blank slate,
> create a form and let users enter the various properties required to
> configure and create a new endpoint.
> So this issue adds a new ComponentConfiguration API; which is like
> EndpointConfiguration but can be created on any existing Camel component
> without any code changes and lets users configure the configuration; then
> either create a URI string or create an Endpoint directly - or introspect the
> available properties.
> There are 2 implementations; a basic implementation which works with any
> camel component today and a more advanced implementation which makes use of
> the @UriEndpoint / @UriParam / @UriParams annotations from CAMEL-6304 to
> provide better metadata.
> The aim is to work with all camel components/endpoints from day 1 but to
> provide a way for endpoint developers to provide better metadata by using
> some annotations
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira