This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new b482b60 CAMEL-13178: rename language terser to hl7terser b482b60 is described below commit b482b60a4765704579c1dc4541b737c0afd38fd6 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue Feb 12 09:02:57 2019 +0100 CAMEL-13178: rename language terser to hl7terser --- MIGRATION.md | 11 +- .../camel-hl7/src/main/docs/hl7-dataformat.adoc | 157 +-------------------- .../src/main/docs/hl7terser-language.adoc | 134 ++++++++++++++++++ .../camel-hl7/src/main/docs/terser-language.adoc | 44 ------ .../java/org/apache/camel/component/hl7/HL7.java | 4 +- .../component/hl7/{Terser.java => Hl7Terser.java} | 4 +- ...serExpression.java => Hl7TerserExpression.java} | 12 +- ...{TerserLanguage.java => Hl7TerserLanguage.java} | 7 +- .../camel/component/hl7/AckExpressionTest.java | 6 +- .../camel/component/hl7/TerserExpressionTest.java | 12 +- components/readme.adoc | 12 +- .../camel/builder/ExpressionClauseSupport.java | 6 +- ...serExpression.java => Hl7TerserExpression.java} | 10 +- ...ava => Hl7TerserLanguageAutoConfiguration.java} | 32 ++--- ...on.java => Hl7TerserLanguageConfiguration.java} | 6 +- .../TerserLanguageAutoConfiguration.java | 8 +- .../springboot/TerserLanguageConfiguration.java | 4 +- .../src/main/resources/META-INF/spring.factories | 4 +- 18 files changed, 206 insertions(+), 267 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index f62296d..195ac60 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -45,10 +45,6 @@ Deprecated APIs and Components All deprecated APIs and components from Camel 2.x has been removed in Camel 3. -#### Simple language - -The `property` function was deprecated in Camel 2.x and has been removed. Use `exchangeProperty` as function name. - Migration Camel applications ---------------------------- @@ -77,6 +73,13 @@ The method `includeRoutes` on `RouteBuilder` has been removed. This functionalit The class `JNDIContext` has been moved from `org.apache.camel.util.jndi.JNDIContext` in the camel-core JAR to `org.apache.camel.support.jndi.JNDIContext` and moved to the `camel-support` JAR. +#### Languages + +The simple language `property` function was deprecated in Camel 2.x and has been removed. Use `exchangeProperty` as function name. + +The terser language has been renamed from terser to hl7terser. + + #### Helpers The class `AsyncProcessorHelper` has been moved from `org.apache.camel.util.AsyncProcessorHelper` in the camel-core JAR to `org.apache.camel.support.AsyncProcessorHelper` and moved to the `camel-support` JAR. diff --git a/components/camel-hl7/src/main/docs/hl7-dataformat.adoc b/components/camel-hl7/src/main/docs/hl7-dataformat.adoc index d676a43..2a14aa3 100644 --- a/components/camel-hl7/src/main/docs/hl7-dataformat.adoc +++ b/components/camel-hl7/src/main/docs/hl7-dataformat.adoc @@ -242,7 +242,7 @@ The component supports 5 options, which are listed below. | *camel.language.terser.trim* | Whether to trim the value to remove leading and trailing whitespaces and line breaks | true | Boolean |=== // spring-boot-auto-configure options: END -ND + * `marshal` = from Message to byte stream (can be used when responding using the HL7 MLLP codec) @@ -360,30 +360,6 @@ that was used to parse the message All headers except `CamelHL7Context `are `String` types. If a header value is missing, its value is `null`. -=== Options - -The HL7 Data Format supports the following options: - -[width="100%",cols="10%,10%,80%",options="header",] -|=== -|Option |Default |Description - -|`validate` |true |Whether the HAPI Parser should validate the message using the default -validation rules. It is recommended to use the `parser` or `hapiContext` -option and initialize it with the desired HAPI -http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/validation/ValidationContext.html[`ValidationContext`] - -|`parser` |`ca.uhn.hl7v2.parser.GenericParser` |Custom parser to be used. Must be of type -http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/parser/Parser.html[`ca.uhn.hl7v2.parser.Parser`]. -Note that -http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/parser/GenericParser.html[`GenericParser`] -also allows to parse XML-encoded HL7v2 messages - -|`hapiContext` |`ca.uhn.hl7v2.DefaultHapiContext` |*Camel 2.14:* Custom HAPI context that can define a custom parser, -custom ValidationContext etc. This gives you full control over the HL7 -parsing and rendering process. -|=== - === Dependencies To use HL7 in your Camel routes you'll need to add a dependency on @@ -447,134 +423,3 @@ repository]. </dependency> ---- -=== Terser language - -http://hl7api.sourceforge.net[HAPI] provides a -http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/util/Terser.html[Terser] -class that provides access to fields using a commonly used terse -location specification syntax. The Terser language allows to use this -syntax to extract values from messages and to use them as expressions -and predicates for filtering, content-based routing etc. - -Sample: - -[source,java] ----- -import static org.apache.camel.component.hl7.HL7.terser; - - // extract patient ID from field QRD-8 in the QRY_A19 message above and put into message header - from("direct:test1") - .setHeader("PATIENT_ID",terser("QRD-8(0)-1")) - .to("mock:test1"); - - // continue processing if extracted field equals a message header - from("direct:test2") - .filter(terser("QRD-8(0)-1").isEqualTo(header("PATIENT_ID")) - .to("mock:test2"); ----- - -=== HL7 Validation predicate - -Often it is preferable to first parse a HL7v2 message and in a separate -step validate it against a HAPI -http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/validation/ValidationContext.html[ValidationContext]. - -Sample: - -[source,java] ----- -import static org.apache.camel.component.hl7.HL7.messageConformsTo; -import ca.uhn.hl7v2.validation.impl.DefaultValidation; - - // Use standard or define your own validation rules - ValidationContext defaultContext = new DefaultValidation(); - - // Throws PredicateValidationException if message does not validate - from("direct:test1") - .validate(messageConformsTo(defaultContext)) - .to("mock:test1"); ----- - -=== HL7 Validation predicate using the HapiContext (Camel 2.14) - -The HAPI Context is always configured with a -http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/validation/ValidationContext.html[ValidationContext] -(or a -http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/validation/builder/ValidationRuleBuilder.html[ValidationRuleBuilder]), -so you can access the validation rules indirectly. Furthermore, when -unmarshalling the HL7DataFormat forwards the configured HAPI context in -the `CamelHL7Context` header, and the validation rules of this context -can be easily reused: - -[source,java] ----- -import static org.apache.camel.component.hl7.HL7.messageConformsTo; -import static org.apache.camel.component.hl7.HL7.messageConforms - - HapiContext hapiContext = new DefaultHapiContext(); - hapiContext.getParserConfiguration().setValidating(false); // don't validate during parsing - - // customize HapiContext some more ... e.g. enforce that PID-8 in ADT_A01 messages of version 2.4 is not empty - ValidationRuleBuilder builder = new ValidationRuleBuilder() { - @Override - protected void configure() { - forVersion(Version.V24) - .message("ADT", "A01") - .terser("PID-8", not(empty())); - } - }; - hapiContext.setValidationRuleBuilder(builder); - - HL7DataFormat hl7 = new HL7DataFormat(); - hl7.setHapiContext(hapiContext); - - from("direct:test1") - .unmarshal(hl7) // uses the GenericParser returned from the HapiContext - .validate(messageConforms()) // uses the validation rules returned from the HapiContext - // equivalent with .validate(messageConformsTo(hapiContext)) - // route continues from here ----- - -=== HL7 Acknowledgement expression - -A common task in HL7v2 processing is to generate an acknowledgement -message as response to an incoming HL7v2 message, e.g. based on a -validation result. The `ack` expression lets us accomplish this very -elegantly: - -[source,java] ----- -import static org.apache.camel.component.hl7.HL7.messageConformsTo; -import static org.apache.camel.component.hl7.HL7.ack; -import ca.uhn.hl7v2.validation.impl.DefaultValidation; - - // Use standard or define your own validation rules - ValidationContext defaultContext = new DefaultValidation(); - - from("direct:test1") - .onException(Exception.class) - .handled(true) - .transform(ack()) // auto-generates negative ack because of exception in Exchange - .end() - .validate(messageConformsTo(defaultContext)) - // do something meaningful here - - // acknowledgement - .transform(ack()) ----- - -=== More Samples - -In the following example, a plain `String` HL7 request is sent to an HL7 -listener that sends back a response: - -In the next sample, HL7 requests from the HL7 listener are routed to the -business logic, which is implemented as plain POJO registered in the -registry as `hl7service`. - -Then the Camel routes using the `RouteBuilder` may look as follows: - -Note that by using the HL7 DataFormat the Camel message headers are -populated with the fields from the MSH segment. The headers are -particularly useful for filtering or content-based routing as shown in -the example above. diff --git a/components/camel-hl7/src/main/docs/hl7terser-language.adoc b/components/camel-hl7/src/main/docs/hl7terser-language.adoc new file mode 100644 index 0000000..5e955ab --- /dev/null +++ b/components/camel-hl7/src/main/docs/hl7terser-language.adoc @@ -0,0 +1,134 @@ +[[hl7terser-language]] +== HL7 Terser Language +*Available as of Camel version 2.11* + + +http://hl7api.sourceforge.net[HAPI] provides a +http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/util/Terser.html[Terser] +class that provides access to fields using a commonly used terse +location specification syntax. The Terser language allows to use this +syntax to extract values from messages and to use them as expressions +and predicates for filtering, content-based routing etc. + +=== HL7 Terser Language options + +// language options: START +The HL7 Terser language supports 1 options, which are listed below. + + + +[width="100%",cols="2,1m,1m,6",options="header"] +|=== +| Name | Default | Java Type | Description +| trim | true | Boolean | Whether to trim the value to remove leading and trailing whitespaces and line breaks +|=== +// language options: END + + +== Samples: + +[source,java] +---- + import static org.apache.camel.component.hl7.HL7.hl7terser; + + // extract patient ID from field QRD-8 in the QRY_A19 message above and put into message header + from("direct:test1") + .setHeader("PATIENT_ID", hl7terser("QRD-8(0)-1")) + .to("mock:test1"); + + // continue processing if extracted field equals a message header + from("direct:test2") + .filter(hl7terser("QRD-8(0)-1").isEqualTo(header("PATIENT_ID")) + .to("mock:test2"); +---- + +=== HL7 Validation predicate + +Often it is preferable to first parse a HL7v2 message and in a separate +step validate it against a HAPI +http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/validation/ValidationContext.html[ValidationContext]. + +Sample: + +[source,java] +---- +import static org.apache.camel.component.hl7.HL7.messageConformsTo; +import ca.uhn.hl7v2.validation.impl.DefaultValidation; + + // Use standard or define your own validation rules + ValidationContext defaultContext = new DefaultValidation(); + + // Throws PredicateValidationException if message does not validate + from("direct:test1") + .validate(messageConformsTo(defaultContext)) + .to("mock:test1"); +---- + +=== HL7 Validation predicate using the HapiContext (Camel 2.14) + +The HAPI Context is always configured with a +http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/validation/ValidationContext.html[ValidationContext] +(or a +http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/validation/builder/ValidationRuleBuilder.html[ValidationRuleBuilder]), +so you can access the validation rules indirectly. Furthermore, when +unmarshalling the HL7DataFormat forwards the configured HAPI context in +the `CamelHL7Context` header, and the validation rules of this context +can be easily reused: + +[source,java] +---- +import static org.apache.camel.component.hl7.HL7.messageConformsTo; +import static org.apache.camel.component.hl7.HL7.messageConforms + + HapiContext hapiContext = new DefaultHapiContext(); + hapiContext.getParserConfiguration().setValidating(false); // don't validate during parsing + + // customize HapiContext some more ... e.g. enforce that PID-8 in ADT_A01 messages of version 2.4 is not empty + ValidationRuleBuilder builder = new ValidationRuleBuilder() { + @Override + protected void configure() { + forVersion(Version.V24) + .message("ADT", "A01") + .terser("PID-8", not(empty())); + } + }; + hapiContext.setValidationRuleBuilder(builder); + + HL7DataFormat hl7 = new HL7DataFormat(); + hl7.setHapiContext(hapiContext); + + from("direct:test1") + .unmarshal(hl7) // uses the GenericParser returned from the HapiContext + .validate(messageConforms()) // uses the validation rules returned from the HapiContext + // equivalent with .validate(messageConformsTo(hapiContext)) + // route continues from here +---- + +=== HL7 Acknowledgement expression + +A common task in HL7v2 processing is to generate an acknowledgement +message as response to an incoming HL7v2 message, e.g. based on a +validation result. The `ack` expression lets us accomplish this very +elegantly: + +[source,java] +---- +import static org.apache.camel.component.hl7.HL7.messageConformsTo; +import static org.apache.camel.component.hl7.HL7.ack; +import ca.uhn.hl7v2.validation.impl.DefaultValidation; + + // Use standard or define your own validation rules + ValidationContext defaultContext = new DefaultValidation(); + + from("direct:test1") + .onException(Exception.class) + .handled(true) + .transform(ack()) // auto-generates negative ack because of exception in Exchange + .end() + .validate(messageConformsTo(defaultContext)) + // do something meaningful here + + // acknowledgement + .transform(ack()) +---- + diff --git a/components/camel-hl7/src/main/docs/terser-language.adoc b/components/camel-hl7/src/main/docs/terser-language.adoc deleted file mode 100644 index f643635..0000000 --- a/components/camel-hl7/src/main/docs/terser-language.adoc +++ /dev/null @@ -1,44 +0,0 @@ -[[terser-language]] -== HL7 Terser Language -### Terser language -*Available as of Camel version 2.11.0* - - -http://hl7api.sourceforge.net[HAPI] provides a -http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/util/Terser.html[Terser] -class that provides access to fields using a commonly used terse -location specification syntax. The Terser language allows to use this -syntax to extract values from messages and to use them as expressions -and predicates for filtering, content-based routing etc. - -Sample: - -[source,java] --------------------------------------------------------------------------------------------------- -import static org.apache.camel.component.hl7.HL7.terser; -... - - // extract patient ID from field QRD-8 in the QRY_A19 message above and put into message header - from("direct:test1") - .setHeader("PATIENT_ID",terser("QRD-8(0)-1")) - .to("mock:test1"); - - // continue processing if extracted field equals a message header - from("direct:test2") - .filter(terser("QRD-8(0)-1").isEqualTo(header("PATIENT_ID")) - .to("mock:test2"); --------------------------------------------------------------------------------------------------- - -### Terser Language options - -// language options: START -The HL7 Terser language supports 1 options, which are listed below. - - - -[width="100%",cols="2,1m,1m,6",options="header"] -|=== -| Name | Default | Java Type | Description -| trim | true | Boolean | Whether to trim the value to remove leading and trailing whitespaces and line breaks -|=== -// language options: END \ No newline at end of file diff --git a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7.java b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7.java index e835040..150af63 100644 --- a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7.java +++ b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7.java @@ -32,8 +32,8 @@ public final class HL7 { // Helper class } - public static ValueBuilder terser(String expression) { - return new ValueBuilder(new TerserExpression(expression)); + public static ValueBuilder hl7terser(String expression) { + return new ValueBuilder(new Hl7TerserExpression(expression)); } public static ValueBuilder ack() { diff --git a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Terser.java b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7Terser.java similarity index 94% rename from components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Terser.java rename to components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7Terser.java index e53e2af..f55d683 100644 --- a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Terser.java +++ b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7Terser.java @@ -27,7 +27,7 @@ import org.apache.camel.language.LanguageAnnotation; @Retention(RetentionPolicy.RUNTIME) @Documented @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER }) -@LanguageAnnotation(language = "terser") -public @interface Terser { +@LanguageAnnotation(language = "hl7terser") +public @interface Hl7Terser { String value(); } diff --git a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/TerserExpression.java b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7TerserExpression.java similarity index 74% rename from components/camel-hl7/src/main/java/org/apache/camel/component/hl7/TerserExpression.java rename to components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7TerserExpression.java index 7efebc8..078ef67 100644 --- a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/TerserExpression.java +++ b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7TerserExpression.java @@ -16,23 +16,17 @@ */ package org.apache.camel.component.hl7; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - import org.apache.camel.model.language.ExpressionDefinition; -@XmlRootElement(name = "terser") -@XmlAccessorType(XmlAccessType.FIELD) -class TerserExpression extends ExpressionDefinition { +class Hl7TerserExpression extends ExpressionDefinition { - TerserExpression(String expression) { + Hl7TerserExpression(String expression) { super(expression); } @Override public String getLanguage() { - return "terser"; + return "hl7terser"; } } diff --git a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/TerserLanguage.java b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7TerserLanguage.java similarity index 93% rename from components/camel-hl7/src/main/java/org/apache/camel/component/hl7/TerserLanguage.java rename to components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7TerserLanguage.java index ea64858..0b93e6e 100644 --- a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/TerserLanguage.java +++ b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/Hl7TerserLanguage.java @@ -28,9 +28,8 @@ import org.apache.camel.support.ExpressionAdapter; import org.apache.camel.support.ExpressionToPredicateAdapter; import org.apache.camel.util.ObjectHelper; - -@org.apache.camel.spi.annotations.Language("terser") -public class TerserLanguage implements Language { +@org.apache.camel.spi.annotations.Language("hl7terser") +public class Hl7TerserLanguage implements Language { public static Expression terser(final String expression) { ObjectHelper.notNull(expression, "expression"); @@ -48,7 +47,7 @@ public class TerserLanguage implements Language { @Override public String toString() { - return "terser(" + expression + ")"; + return "hl7terser(" + expression + ")"; } }; diff --git a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/AckExpressionTest.java b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/AckExpressionTest.java index 47dbdaa..70d02bc 100644 --- a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/AckExpressionTest.java +++ b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/AckExpressionTest.java @@ -26,7 +26,7 @@ import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; import static org.apache.camel.component.hl7.HL7.ack; -import static org.apache.camel.component.hl7.HL7.terser; +import static org.apache.camel.component.hl7.HL7.hl7terser; public class AckExpressionTest extends CamelTestSupport { @@ -93,10 +93,10 @@ public class AckExpressionTest extends CamelTestSupport { from("direct:test1").transform(ack()); from("direct:test2").transform(ack(AcknowledgmentCode.CA)); from("direct:test3").onException(HL7Exception.class).handled(true).transform(ack()).end() - .transform(terser("/.BLORG")); + .transform(hl7terser("/.BLORG")); from("direct:test4").onException(HL7Exception.class).handled(true) .transform(ack(AcknowledgmentCode.AR, "Problem!", ErrorCode.APPLICATION_INTERNAL_ERROR)).end() - .transform(terser("/.BLORG")); + .transform(hl7terser("/.BLORG")); from("direct:test5").transform(ack(AcknowledgmentCode.AR, "Problem!", ErrorCode.DATA_TYPE_ERROR)); } }; diff --git a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/TerserExpressionTest.java b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/TerserExpressionTest.java index 64fed1d..cb01b3e 100644 --- a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/TerserExpressionTest.java +++ b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/TerserExpressionTest.java @@ -26,7 +26,7 @@ import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; -import static org.apache.camel.component.hl7.HL7.terser; +import static org.apache.camel.component.hl7.HL7.hl7terser; public class TerserExpressionTest extends CamelTestSupport { @@ -84,10 +84,10 @@ public class TerserExpressionTest extends CamelTestSupport { return new RouteBuilder() { public void configure() throws Exception { - from("direct:test1").transform(terser("PID-3-1")).to("mock:test1"); - from("direct:test2").filter(terser("PID-3-1").isEqualTo(PATIENT_ID)).to("mock:test2"); - from("direct:test3").filter(terser("PID-4-1").isNull()).to("mock:test3"); - from("direct:test4").filter(terser("blorg gablorg").isNull()).to("mock:test3"); + from("direct:test1").transform(hl7terser("PID-3-1")).to("mock:test1"); + from("direct:test2").filter(hl7terser("PID-3-1").isEqualTo(PATIENT_ID)).to("mock:test2"); + from("direct:test3").filter(hl7terser("PID-4-1").isNull()).to("mock:test3"); + from("direct:test4").filter(hl7terser("blorg gablorg").isNull()).to("mock:test3"); from("direct:test5").bean(terserBean).to("mock:test5"); } }; @@ -107,7 +107,7 @@ public class TerserExpressionTest extends CamelTestSupport { } public class TerserBean { - public String patientId(@Terser(value = "PID-3-1") String patientId) { + public String patientId(@Hl7Terser(value = "PID-3-1") String patientId) { return patientId; } } diff --git a/components/readme.adoc b/components/readme.adoc index 7d556d1..72b3e73 100644 --- a/components/readme.adoc +++ b/components/readme.adoc @@ -1,7 +1,7 @@ ==== Components // components: START -Number of Components: 288 in 210 JAR artifacts (0 deprecated) +Number of Components: 290 in 210 JAR artifacts (0 deprecated) [width="100%",cols="4,1,5",options="header"] |=== @@ -76,6 +76,12 @@ Number of Components: 288 in 210 JAR artifacts (0 deprecated) | link:camel-aws/src/main/docs/aws-ec2-component.adoc[AWS EC2] (camel-aws) + `aws-ec2:label` | 2.16 | The aws-ec2 is used for managing Amazon EC2 instances. +| link:camel-aws/src/main/docs/aws-ecs-component.adoc[AWS ECS] (camel-aws) + +`aws-ecs:label` | 3.0 | The aws-kms is used for managing Amazon ECS + +| link:camel-aws/src/main/docs/aws-eks-component.adoc[AWS EKS] (camel-aws) + +`aws-eks:label` | 3.0 | The aws-kms is used for managing Amazon EKS + | link:camel-aws/src/main/docs/aws-iam-component.adoc[AWS IAM] (camel-aws) + `aws-iam:label` | 2.23 | The aws-iam is used for managing Amazon IAM @@ -314,7 +320,7 @@ Number of Components: 288 in 210 JAR artifacts (0 deprecated) `gora:name` | 2.14 | The gora component allows you to work with NoSQL databases using the Apache Gora framework. | link:camel-grape/src/main/docs/grape-component.adoc[Grape] (camel-grape) + -`grape:defaultCoordinates` | 2.16 | Grape component allows you to fetch, load and manage additional jars when CamelContext is running. +`grape:defaultCoordinates` | 2.16 | The grape component allows you to fetch, load and manage additional jars when CamelContext is running. | link:camel-grpc/src/main/docs/grpc-component.adoc[gRPC] (camel-grpc) + `grpc:host:port/service` | 2.19 | The gRPC component allows to call and expose remote procedures via HTTP/2 with protobuf dataformat @@ -998,7 +1004,7 @@ Number of Languages: 18 in 9 JAR artifacts (1 deprecated) | link:../core/camel-core/src/main/docs/header-language.adoc[Header] (camel-core) | 1.5 | To use a Camel Message header in expressions or predicates. -| link:camel-hl7/src/main/docs/terser-language.adoc[HL7 Terser] (camel-hl7) | 2.11 | To use HL7 terser scripts in Camel expressions or predicates. +| link:camel-hl7/src/main/docs/hl7terser-language.adoc[HL7 Terser] (camel-hl7) | 2.11 | To use HL7 terser scripts in Camel expressions or predicates. | link:camel-script/src/main/docs/javaScript-language.adoc[JavaScript] (camel-script) | 1.0 | *deprecated* To use JavaScript in Camel expressions or predicates. diff --git a/core/camel-core/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java b/core/camel-core/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java index a11ff09..83fca07 100644 --- a/core/camel-core/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java +++ b/core/camel-core/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java @@ -26,6 +26,7 @@ import org.apache.camel.model.language.ExchangePropertyExpression; import org.apache.camel.model.language.ExpressionDefinition; import org.apache.camel.model.language.GroovyExpression; import org.apache.camel.model.language.HeaderExpression; +import org.apache.camel.model.language.Hl7TerserExpression; import org.apache.camel.model.language.JavaScriptExpression; import org.apache.camel.model.language.JsonPathExpression; import org.apache.camel.model.language.LanguageExpression; @@ -35,7 +36,6 @@ import org.apache.camel.model.language.OgnlExpression; import org.apache.camel.model.language.RefExpression; import org.apache.camel.model.language.SimpleExpression; import org.apache.camel.model.language.SpELExpression; -import org.apache.camel.model.language.TerserExpression; import org.apache.camel.model.language.TokenizerExpression; import org.apache.camel.model.language.XMLTokenizerExpression; import org.apache.camel.model.language.XPathExpression; @@ -554,8 +554,8 @@ public class ExpressionClauseSupport<T> { * @param text the expression to be evaluated * @return the builder to continue processing the DSL */ - public T terser(String text) { - return expression(new TerserExpression(text)); + public T hl7terser(String text) { + return expression(new Hl7TerserExpression(text)); } /** diff --git a/core/camel-core/src/main/java/org/apache/camel/model/language/TerserExpression.java b/core/camel-core/src/main/java/org/apache/camel/model/language/Hl7TerserExpression.java similarity index 85% rename from core/camel-core/src/main/java/org/apache/camel/model/language/TerserExpression.java rename to core/camel-core/src/main/java/org/apache/camel/model/language/Hl7TerserExpression.java index b3b8581..93fe333 100644 --- a/core/camel-core/src/main/java/org/apache/camel/model/language/TerserExpression.java +++ b/core/camel-core/src/main/java/org/apache/camel/model/language/Hl7TerserExpression.java @@ -26,18 +26,18 @@ import org.apache.camel.spi.Metadata; * To use HL7 terser scripts in Camel expressions or predicates. */ @Metadata(firstVersion = "2.11.0", label = "language,hl7", title = "HL7 Terser") -@XmlRootElement(name = "terser") +@XmlRootElement(name = "hl7terser") @XmlAccessorType(XmlAccessType.FIELD) -public class TerserExpression extends ExpressionDefinition { +public class Hl7TerserExpression extends ExpressionDefinition { - public TerserExpression() { + public Hl7TerserExpression() { } - public TerserExpression(String expression) { + public Hl7TerserExpression(String expression) { super(expression); } public String getLanguage() { - return "terser"; + return "hl7terser"; } } diff --git a/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/Hl7TerserLanguageAutoConfiguration.java similarity index 81% copy from platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java copy to platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/Hl7TerserLanguageAutoConfiguration.java index 4fedfc5..2205ee1 100644 --- a/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/Hl7TerserLanguageAutoConfiguration.java @@ -22,7 +22,7 @@ import java.util.Map; import javax.annotation.Generated; import org.apache.camel.CamelContext; import org.apache.camel.CamelContextAware; -import org.apache.camel.component.hl7.TerserLanguage; +import org.apache.camel.component.hl7.Hl7TerserLanguage; import org.apache.camel.spi.HasId; import org.apache.camel.spi.LanguageCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; @@ -53,35 +53,35 @@ import org.springframework.context.annotation.Scope; @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration @Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, - TerserLanguageAutoConfiguration.GroupConditions.class}) + Hl7TerserLanguageAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({LanguageConfigurationProperties.class, - TerserLanguageConfiguration.class}) -public class TerserLanguageAutoConfiguration { + Hl7TerserLanguageConfiguration.class}) +public class Hl7TerserLanguageAutoConfiguration { private static final Logger LOGGER = LoggerFactory - .getLogger(TerserLanguageAutoConfiguration.class); + .getLogger(Hl7TerserLanguageAutoConfiguration.class); @Autowired private ApplicationContext applicationContext; @Autowired private CamelContext camelContext; @Autowired - private TerserLanguageConfiguration configuration; + private Hl7TerserLanguageConfiguration configuration; @Autowired(required = false) - private List<LanguageCustomizer<TerserLanguage>> customizers; + private List<LanguageCustomizer<Hl7TerserLanguage>> customizers; static class GroupConditions extends GroupCondition { public GroupConditions() { - super("camel.component", "camel.component.terser"); + super("camel.component", "camel.component.hl7terser"); } } - @Bean(name = "terser-language") + @Bean(name = "hl7terser-language") @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) - @ConditionalOnMissingBean(TerserLanguage.class) - public TerserLanguage configureTerserLanguage() throws Exception { - TerserLanguage language = new TerserLanguage(); - if (CamelContextAware.class.isAssignableFrom(TerserLanguage.class)) { + @ConditionalOnMissingBean(Hl7TerserLanguage.class) + public Hl7TerserLanguage configureHl7TerserLanguage() throws Exception { + Hl7TerserLanguage language = new Hl7TerserLanguage(); + if (CamelContextAware.class.isAssignableFrom(Hl7TerserLanguage.class)) { CamelContextAware contextAware = CamelContextAware.class .cast(language); if (contextAware != null) { @@ -94,17 +94,17 @@ public class TerserLanguageAutoConfiguration { CamelPropertiesHelper.setCamelProperties(camelContext, language, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { - for (LanguageCustomizer<TerserLanguage> customizer : customizers) { + for (LanguageCustomizer<Hl7TerserLanguage> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.language.customizer", - "camel.language.terser.customizer", + "camel.language.hl7terser.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.language.customizer", - "camel.language.terser.customizer"); + "camel.language.hl7terser.customizer"); if (useCustomizer) { LOGGER.debug("Configure language {}, with customizer {}", language, customizer); diff --git a/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java b/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/Hl7TerserLanguageConfiguration.java similarity index 90% copy from platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java copy to platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/Hl7TerserLanguageConfiguration.java index eba0265..c8c2ff4 100644 --- a/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/Hl7TerserLanguageConfiguration.java @@ -26,13 +26,13 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * Generated by camel-package-maven-plugin - do not edit this file! */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") -@ConfigurationProperties(prefix = "camel.language.terser") -public class TerserLanguageConfiguration +@ConfigurationProperties(prefix = "camel.language.hl7terser") +public class Hl7TerserLanguageConfiguration extends LanguageConfigurationPropertiesCommon { /** - * Whether to enable auto configuration of the terser language. This is + * Whether to enable auto configuration of the hl7terser language. This is * enabled by default. */ private Boolean enabled; diff --git a/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java index 4fedfc5..50fd520 100644 --- a/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java @@ -72,11 +72,11 @@ public class TerserLanguageAutoConfiguration { static class GroupConditions extends GroupCondition { public GroupConditions() { - super("camel.component", "camel.component.terser"); + super("camel.component", "camel.component.hl7terser"); } } - @Bean(name = "terser-language") + @Bean(name = "hl7terser-language") @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(TerserLanguage.class) public TerserLanguage configureTerserLanguage() throws Exception { @@ -99,12 +99,12 @@ public class TerserLanguageAutoConfiguration { ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.language.customizer", - "camel.language.terser.customizer", + "camel.language.hl7terser.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.language.customizer", - "camel.language.terser.customizer"); + "camel.language.hl7terser.customizer"); if (useCustomizer) { LOGGER.debug("Configure language {}, with customizer {}", language, customizer); diff --git a/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java b/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java index eba0265..eeba1d0 100644 --- a/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java @@ -26,13 +26,13 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * Generated by camel-package-maven-plugin - do not edit this file! */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") -@ConfigurationProperties(prefix = "camel.language.terser") +@ConfigurationProperties(prefix = "camel.language.hl7terser") public class TerserLanguageConfiguration extends LanguageConfigurationPropertiesCommon { /** - * Whether to enable auto configuration of the terser language. This is + * Whether to enable auto configuration of the hl7terser language. This is * enabled by default. */ private Boolean enabled; diff --git a/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/resources/META-INF/spring.factories b/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/resources/META-INF/spring.factories index fe8653c..4be87f5 100644 --- a/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/resources/META-INF/spring.factories +++ b/platforms/spring-boot/components-starter/camel-hl7-starter/src/main/resources/META-INF/spring.factories @@ -16,5 +16,7 @@ ## --------------------------------------------------------------------------- org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ org.apache.camel.component.hl7.springboot.TerserLanguageAutoConfiguration,\ -org.apache.camel.component.hl7.springboot.HL7DataFormatAutoConfiguration +org.apache.camel.component.hl7.springboot.HL7DataFormatAutoConfiguration,\ +org.apache.camel.component.hl7.springboot.Hl7TerserLanguageAutoConfiguration +