You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/02/09 12:55:56 UTC
(camel) 07/10: (chores) camel-asn1: documentation fixes
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 28d97a387d2313459ec6b424197194b6512e385d
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Feb 9 10:08:35 2024 +0100
(chores) camel-asn1: documentation fixes
- Fixed grammar and typos
- Fixed punctuation
- Added and/or fixed links
---
.../camel-asn1/src/main/docs/asn1-dataformat.adoc | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/components/camel-asn1/src/main/docs/asn1-dataformat.adoc b/components/camel-asn1/src/main/docs/asn1-dataformat.adoc
index 863b5789a33..a679b9e3f93 100644
--- a/components/camel-asn1/src/main/docs/asn1-dataformat.adoc
+++ b/components/camel-asn1/src/main/docs/asn1-dataformat.adoc
@@ -11,7 +11,9 @@
*Since Camel {since}*
-The ASN.1 Data Format Data Format [Introduction to ASN.1](https://www.itu.int/en/ITU-T/asn1/Pages/introduction.aspx) is a Camel Frameworks's data format implementation based on Bouncy Castle's bcprov-jdk18on library and jASN.1's java compiler for the formal notation used for describing data transmitted by telecommunications protocols, regardless of language implementation and physical representation of these data, whatever the application, whether complex or very simple. Messages can be [...]
+The https://www.itu.int/en/ITU-T/asn1/Pages/introduction.aspx[ASN.1 Data Format] is a Camel Framework's data format implementation based on Bouncy Castle's bcprov-jdk18on library and jASN.1's java compiler for the formal notation used for describing data transmitted by telecommunications protocols, regardless of language implementation and physical representation of these data, whatever the application, whether complex or very simple.
+Messages can be unmarshalled (conversion to simple Java POJO(s)) to plain Java objects.
+With the help of Camel's routing engine and data transformations, you can then play with POJO(s) and apply customized formatting and call other Camel Components to convert and send messages to upstream systems.
== ASN.1 Data Format Options
@@ -23,14 +25,15 @@ include::partial$dataformat-options.adoc[]
There are 3 different ways to unmarshal ASN.1 structured messages. (Usually binary files)
-In this first example we unmarshal BER file payload to OutputStream and send it to mock endpoint.
+In this first example, we unmarshal BER file payload to OutputStream and send it to mock endpoint.
[source,java]
-----------------------------------------------------------------------
from("direct:unmarshal").unmarshal(asn1).to("mock:unmarshal");
-----------------------------------------------------------------------
-In the second example we unmarshal BER file payload to byte array using Split EIP. The reason for applying Split EIP is that usually each BER file or (ASN.1 structured file) contains multiple records to process and Split EIP helps us to get each record in a file as byte arrays which is actually ASN1Primitive's instance (by the use of Bouncy Castle's ASN.1 support in bcprov-jdk18on library)
+In the second example, we unmarshal BER file payload to a byte array using Split EIP.
+The reason for applying Split EIP is that usually each BER file or (ASN.1 structured file) contains multiple records to process and Split EIP helps us to get each record in a file as byte arrays which is actually ASN1Primitive's instance (by the use of Bouncy Castle's ASN.1 support in bcprov-jdk18on library)
Byte arrays then may be converted to ASN1Primitive by the help of public static method in (ASN1Primitive.fromByteArray)
In such example, note that you need to set `usingIterator=true`
@@ -42,9 +45,10 @@ from("direct:unmarshal")
.to("mock:unmarshal");
-----------------------------------------------------------------------
-In the last example we unmarshal BER file payload to plain old Java Objects using Split EIP. The reason for applying Split EIP is already mentioned in the previous example. Please note and keep in mind that reason. In such example we also need to set the fully qualified name of the class or <YourObject>.class reference through data format.
-The important thing to note here is that your object should have been generated by jasn1 compiler which is a nice tool to generate java object representations of your ASN.1 structure. For the reference usage of jasn1 compiler see [JASN.1 Project Page](https://www.beanit.com/asn1/) and please also see how the compiler is invoked with the help of maven's exec plugin.
-For example, in this data format's unit tests an example ASN.1 structure(TestSMSBerCdr.asn1) is added in `src/test/resources/asn1_structure`. jasn1 compiler is invoked and java object's representations are generated in `$\{basedir}/target/generated/src/test/java`
+In the last example, we unmarshalled a BER file payload to plain old Java Objects using Split EIP. The reason for applying Split EIP is already mentioned in the previous example. Please note and keep in mind that reason. In such example we also need to set the fully qualified name of the class or <YourObject>.class reference through data format.
+The important thing to note here is that your object should have been generated by jasn1 compiler, which is a nice tool to generate java object representations of your ASN.1 structure.
+For the reference usage of jasn1 compiler, see the https://www.beanit.com/asn1/[JASN.1 Project Page] and please also see how the compiler is invoked with the help of maven's exec plugin.
+For example, in this data format's unit tests an example ASN.1 structure(TestSMSBerCdr.asn1) is added in `src/test/resources/asn1_structure`. jasn1 compiler is invoked, and java object's representations are generated in `$\{basedir}/target/generated/src/test/java`
The nice thing about this example, you will get POJO instance at the mock endpoint or at whatever your endpoint is.
[source,java]
@@ -61,7 +65,7 @@ from("direct:unmarshaldsl")
To use ASN.1 data format in your camel routes you need to add a dependency on
*camel-asn1* which implements this data format.
-If you use Maven you can just add the following to your `pom.xml`,
+If you use Maven you can add the following to your `pom.xml`,
substituting the version number for the latest & greatest release (see
the download page for the latest versions).