diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/irc.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/irc.json index b83ce4971eb3b..d0cc2c7e152db 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/irc.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/irc.json @@ -31,16 +31,16 @@ "useGlobalSslContextParameters": { "index": 3, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." } }, "headers": { - "irc.messageType": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of message", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_MESSAGE_TYPE" }, - "irc.target": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The target", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_TARGET" }, - "irc.sendTo": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname or channel the message should be sent to.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_SEND_TO" }, - "irc.user.kicked": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname of the user who is kicked from a channel (passive).", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_KICKED" }, - "irc.user.host": { "index": 4, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The host of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_HOST" }, - "irc.user.nick": { "index": 5, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname of the person who sent the line or the server name of the server which sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_NICK" }, - "irc.user.servername": { "index": 6, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server name of the server which sent the line or the nickname of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_SERVERNAME" }, - "irc.user.username": { "index": 7, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The username of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_USERNAME" }, - "irc.num": { "index": 8, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The numeric reply.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_NUM" }, - "irc.value": { "index": 9, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The first part of the message", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_VALUE" } + "CamelIrcMessageType": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of message", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_MESSAGE_TYPE" }, + "CamelIrcTarget": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The target", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_TARGET" }, + "CamelIrcSendTo": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname or channel the message should be sent to.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_SEND_TO" }, + "CamelIrcUserKicked": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname of the user who is kicked from a channel (passive).", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_KICKED" }, + "CamelIrcUserHost": { "index": 4, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The host of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_HOST" }, + "CamelIrcUserNick": { "index": 5, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname of the person who sent the line or the server name of the server which sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_NICK" }, + "CamelIrcUserServername": { "index": 6, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server name of the server which sent the line or the nickname of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_SERVERNAME" }, + "CamelIrcUserUsername": { "index": 7, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The username of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_USERNAME" }, + "CamelIrcNum": { "index": 8, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The numeric reply.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_NUM" }, + "CamelIrcValue": { "index": 9, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The first part of the message", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_VALUE" } }, "properties": { "hostname": { "index": 0, "kind": "path", "displayName": "Hostname", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Hostname for the IRC chat server" }, @@ -49,7 +49,7 @@ "channels": { "index": 3, "kind": "parameter", "displayName": "Channels", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Comma separated list of IRC channels." }, "commandTimeout": { "index": 4, "kind": "parameter", "displayName": "Command Timeout", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5000, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Delay in milliseconds before sending commands after the connection is established." }, "keys": { "index": 5, "kind": "parameter", "displayName": "Keys", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Comma separated list of keys for channels." }, - "namesOnJoin": { "index": 6, "kind": "parameter", "displayName": "Names On Join", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Sends NAMES command to channel after joining it. onReply has to be true in order to process the result which will have the header value irc.num = '353'." }, + "namesOnJoin": { "index": 6, "kind": "parameter", "displayName": "Names On Join", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Sends NAMES command to channel after joining it. onReply has to be true in order to process the result which will have the header value CamelIrcNum = '353'." }, "nickname": { "index": 7, "kind": "parameter", "displayName": "Nickname", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "The nickname used in chat." }, "persistent": { "index": 8, "kind": "parameter", "displayName": "Persistent", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": true, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Use persistent messages." }, "realname": { "index": 9, "kind": "parameter", "displayName": "Realname", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "The IRC user's actual name." }, diff --git a/components/camel-irc/src/generated/resources/META-INF/org/apache/camel/component/irc/irc.json b/components/camel-irc/src/generated/resources/META-INF/org/apache/camel/component/irc/irc.json index b83ce4971eb3b..d0cc2c7e152db 100644 --- a/components/camel-irc/src/generated/resources/META-INF/org/apache/camel/component/irc/irc.json +++ b/components/camel-irc/src/generated/resources/META-INF/org/apache/camel/component/irc/irc.json @@ -31,16 +31,16 @@ "useGlobalSslContextParameters": { "index": 3, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." } }, "headers": { - "irc.messageType": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of message", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_MESSAGE_TYPE" }, - "irc.target": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The target", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_TARGET" }, - "irc.sendTo": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname or channel the message should be sent to.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_SEND_TO" }, - "irc.user.kicked": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname of the user who is kicked from a channel (passive).", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_KICKED" }, - "irc.user.host": { "index": 4, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The host of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_HOST" }, - "irc.user.nick": { "index": 5, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname of the person who sent the line or the server name of the server which sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_NICK" }, - "irc.user.servername": { "index": 6, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server name of the server which sent the line or the nickname of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_SERVERNAME" }, - "irc.user.username": { "index": 7, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The username of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_USERNAME" }, - "irc.num": { "index": 8, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The numeric reply.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_NUM" }, - "irc.value": { "index": 9, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The first part of the message", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_VALUE" } + "CamelIrcMessageType": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of message", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_MESSAGE_TYPE" }, + "CamelIrcTarget": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The target", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_TARGET" }, + "CamelIrcSendTo": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname or channel the message should be sent to.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_SEND_TO" }, + "CamelIrcUserKicked": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname of the user who is kicked from a channel (passive).", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_KICKED" }, + "CamelIrcUserHost": { "index": 4, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The host of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_HOST" }, + "CamelIrcUserNick": { "index": 5, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The nickname of the person who sent the line or the server name of the server which sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_NICK" }, + "CamelIrcUserServername": { "index": 6, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server name of the server which sent the line or the nickname of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_SERVERNAME" }, + "CamelIrcUserUsername": { "index": 7, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The username of the person who sent the line.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_USER_USERNAME" }, + "CamelIrcNum": { "index": 8, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The numeric reply.", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_NUM" }, + "CamelIrcValue": { "index": 9, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The first part of the message", "constantName": "org.apache.camel.component.irc.IrcConstants#IRC_VALUE" } }, "properties": { "hostname": { "index": 0, "kind": "path", "displayName": "Hostname", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Hostname for the IRC chat server" }, @@ -49,7 +49,7 @@ "channels": { "index": 3, "kind": "parameter", "displayName": "Channels", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Comma separated list of IRC channels." }, "commandTimeout": { "index": 4, "kind": "parameter", "displayName": "Command Timeout", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5000, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Delay in milliseconds before sending commands after the connection is established." }, "keys": { "index": 5, "kind": "parameter", "displayName": "Keys", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Comma separated list of keys for channels." }, - "namesOnJoin": { "index": 6, "kind": "parameter", "displayName": "Names On Join", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Sends NAMES command to channel after joining it. onReply has to be true in order to process the result which will have the header value irc.num = '353'." }, + "namesOnJoin": { "index": 6, "kind": "parameter", "displayName": "Names On Join", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Sends NAMES command to channel after joining it. onReply has to be true in order to process the result which will have the header value CamelIrcNum = '353'." }, "nickname": { "index": 7, "kind": "parameter", "displayName": "Nickname", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "The nickname used in chat." }, "persistent": { "index": 8, "kind": "parameter", "displayName": "Persistent", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": true, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "Use persistent messages." }, "realname": { "index": 9, "kind": "parameter", "displayName": "Realname", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.irc.IrcConfiguration", "configurationField": "configuration", "description": "The IRC user's actual name." }, diff --git a/components/camel-irc/src/main/docs/irc-component.adoc b/components/camel-irc/src/main/docs/irc-component.adoc index 4fc2b4b13c2ef..842140ba98e57 100644 --- a/components/camel-irc/src/main/docs/irc-component.adoc +++ b/components/camel-irc/src/main/docs/irc-component.adoc @@ -130,7 +130,7 @@ irc:nick@irc.server.org?channels=#chan1,#chan2,#chan3&keys=chan1Key,,chan3key === Getting a list of channel users Using the `namesOnJoin` option one can invoke the IRC-`NAMES` command after the component has joined a channel. -The server will reply with `irc.num = 353`. So to process the result the property `onReply` has to be `true`. +The server will reply with `CamelIrcNum = 353`. So to process the result the property `onReply` has to be `true`. Furthermore, one has to filter the `onReply` exchanges to get the names. For example, we want to get all exchanges that contain the usernames of the channel: @@ -139,8 +139,8 @@ For example, we want to get all exchanges that contain the usernames of the chan ----------------------------------------------------------------------------- from("ircs:nick@myserver:1234/#mychannelname?namesOnJoin=true&onReply=true") .choice() - .when(header("irc.messageType").isEqualToIgnoreCase("REPLY")) - .filter(header("irc.num").isEqualTo("353")) + .when(header("CamelIrcMessageType").isEqualToIgnoreCase("REPLY")) + .filter(header("CamelIrcNum").isEqualTo("353")) .to("mock:result").stop(); ----------------------------------------------------------------------------- @@ -153,7 +153,7 @@ You can specify the destination in the following header: [width="100%",cols="10%,10%,80%",options="header",] |===================================================================== |Header |Type |Description -|`irc.sendTo` |`String` |The channel (or the person) name. +|`CamelIrcSendTo` |`String` |The channel (or the person) name. |===================================================================== diff --git a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java index fed80ae45bb50..2889cf239ad58 100644 --- a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java +++ b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java @@ -522,7 +522,7 @@ public boolean isNamesOnJoin() { /** * Sends NAMES command to channel after joining it.
* {@link #onReply} has to be true in order to process the result which will have the header value - * irc.num = '353'. + * CamelIrcNum = '353'. */ public void setNamesOnJoin(boolean namesOnJoin) { this.namesOnJoin = namesOnJoin; diff --git a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java index a408f58f4694d..1b7a43556d667 100644 --- a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java +++ b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConstants.java @@ -23,27 +23,27 @@ */ public final class IrcConstants { @Metadata(description = "The type of message", javaType = "String") - public static final String IRC_MESSAGE_TYPE = "irc.messageType"; + public static final String IRC_MESSAGE_TYPE = "CamelIrcMessageType"; @Metadata(description = "The target", javaType = "String") - public static final String IRC_TARGET = "irc.target"; + public static final String IRC_TARGET = "CamelIrcTarget"; @Metadata(description = "The nickname or channel the message should be sent to.", javaType = "String") - public static final String IRC_SEND_TO = "irc.sendTo"; + public static final String IRC_SEND_TO = "CamelIrcSendTo"; @Metadata(description = "The nickname of the user who is kicked from a channel (passive).", javaType = "String") - public static final String IRC_USER_KICKED = "irc.user.kicked"; + public static final String IRC_USER_KICKED = "CamelIrcUserKicked"; @Metadata(description = "The host of the person who sent the line.", javaType = "String") - public static final String IRC_USER_HOST = "irc.user.host"; + public static final String IRC_USER_HOST = "CamelIrcUserHost"; @Metadata(description = "The nickname of the person who sent the line or the server name of the server which sent the line.", javaType = "String") - public static final String IRC_USER_NICK = "irc.user.nick"; + public static final String IRC_USER_NICK = "CamelIrcUserNick"; @Metadata(description = "The server name of the server which sent the line or the nickname of the person who sent the line.", javaType = "String") - public static final String IRC_USER_SERVERNAME = "irc.user.servername"; + public static final String IRC_USER_SERVERNAME = "CamelIrcUserServername"; @Metadata(description = "The username of the person who sent the line.", javaType = "String") - public static final String IRC_USER_USERNAME = "irc.user.username"; + public static final String IRC_USER_USERNAME = "CamelIrcUserUsername"; @Metadata(description = "The numeric reply.", javaType = "int") - public static final String IRC_NUM = "irc.num"; + public static final String IRC_NUM = "CamelIrcNum"; @Metadata(description = "The first part of the message", javaType = "String") - public static final String IRC_VALUE = "irc.value"; + public static final String IRC_VALUE = "CamelIrcValue"; private IrcConstants() { // Utility class diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcMultiChannelRouteIT.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcMultiChannelRouteIT.java index dc950df00ff45..9c7510b259e86 100644 --- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcMultiChannelRouteIT.java +++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcMultiChannelRouteIT.java @@ -78,8 +78,8 @@ public void configure() { * Lets send messages once the consumer has joined */ protected void sendMessages() { - template.sendBodyAndHeader(sendUri(), body1, "irc.sendTo", properties.get("channel1")); - template.sendBodyAndHeader(sendUri(), body2, "irc.sendTo", properties.get("channel2")); + template.sendBodyAndHeader(sendUri(), body1, IrcConstants.IRC_SEND_TO, properties.get("channel1")); + template.sendBodyAndHeader(sendUri(), body2, IrcConstants.IRC_SEND_TO, properties.get("channel2")); template.sendBody(sendUri(), body3); } diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcPrivmsgIT.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcPrivmsgIT.java index d370e540ce6c5..f2902886b92f1 100644 --- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcPrivmsgIT.java +++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcPrivmsgIT.java @@ -84,8 +84,8 @@ protected void sendMessages() { if (!sentMessages) { sentMessages = true; - template.sendBodyAndHeader(sendUri(), body1, "irc.target", properties.get("camelFrom")); - template.sendBodyAndHeader(sendUri(), body2, "irc.target", properties.get("camelFrom")); + template.sendBodyAndHeader(sendUri(), body1, IrcConstants.IRC_TARGET, properties.get("camelFrom")); + template.sendBodyAndHeader(sendUri(), body2, IrcConstants.IRC_TARGET, properties.get("camelFrom")); } } } diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsListUsersIT.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsListUsersIT.java index 638ddeb439f8d..88b5c95928327 100644 --- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsListUsersIT.java +++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsListUsersIT.java @@ -19,6 +19,7 @@ import org.apache.camel.RoutesBuilder; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.irc.IrcConfiguration; +import org.apache.camel.component.irc.IrcConstants; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; @@ -53,8 +54,8 @@ public void configure() { from(PRODUCER_URI + "?namesOnJoin=true&onReply=true") .choice() - .when(header("irc.messageType").isEqualToIgnoreCase("REPLY")) - .filter(header("irc.num").isEqualTo(IRC_RPL_NAMREPLY)) + .when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualToIgnoreCase("REPLY")) + .filter(header(IrcConstants.IRC_NUM).isEqualTo(IRC_RPL_NAMREPLY)) .to("mock:result").stop(); } }; diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc index 8a9a9c9fcf43f..57bcd3128ba75 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc @@ -853,6 +853,59 @@ A new accessor `web3jOperation()` is also generated for `Web3jConstants.OPERATIO (the producer dispatch header). This constant did not appear in the catalog previously, so no DSL accessor renaming applies to it. +=== camel-irc - potential breaking change + +The Exchange header constants in `IrcConstants` have been renamed to follow the +Camel naming convention used across the rest of the component catalog. The Java +field names are unchanged; only the header string values have changed: + +[options="header"] +|=== +| Constant | Previous value | New value +| `IrcConstants.IRC_MESSAGE_TYPE` | `irc.messageType` | `CamelIrcMessageType` +| `IrcConstants.IRC_TARGET` | `irc.target` | `CamelIrcTarget` +| `IrcConstants.IRC_SEND_TO` | `irc.sendTo` | `CamelIrcSendTo` +| `IrcConstants.IRC_USER_KICKED` | `irc.user.kicked` | `CamelIrcUserKicked` +| `IrcConstants.IRC_USER_HOST` | `irc.user.host` | `CamelIrcUserHost` +| `IrcConstants.IRC_USER_NICK` | `irc.user.nick` | `CamelIrcUserNick` +| `IrcConstants.IRC_USER_SERVERNAME` | `irc.user.servername` | `CamelIrcUserServername` +| `IrcConstants.IRC_USER_USERNAME` | `irc.user.username` | `CamelIrcUserUsername` +| `IrcConstants.IRC_NUM` | `irc.num` | `CamelIrcNum` +| `IrcConstants.IRC_VALUE` | `irc.value` | `CamelIrcValue` +|=== + +Routes that reference the constant symbolically (for example +`header(IrcConstants.IRC_SEND_TO)` or +`setHeader(IrcConstants.IRC_TARGET, ...)`) continue to work without changes. +Routes that set or read the header by its literal string value (for example +`setHeader("irc.sendTo", ...)`) must be updated to use the new value: + +[source,java] +---- +// before +template.sendBodyAndHeader("irc:bot@irc.server.org/#chan", "hello", + "irc.sendTo", "#otherchan"); + +// after +template.sendBodyAndHeader("irc:bot@irc.server.org/#chan", "hello", + "CamelIrcSendTo", "#otherchan"); +---- + +==== Behaviour change: cross-transport propagation of irc.* headers + +Because the renamed header values now begin with `Camel`, they are filtered by +the standard transport `HeaderFilterStrategy` (`JmsHeaderFilterStrategy`, +`HttpHeaderFilterStrategy`, etc.) when crossing a transport boundary, by design +— `Camel*` headers are framework-internal and are not propagated over the wire. + +Routes that bridge an external transport (HTTP, JMS, ...) into an `irc:` +producer and let the sender choose the IRC destination via the `irc.sendTo` +header must therefore carry that value in a non-`Camel`-prefixed application +header and map it to `IrcConstants.IRC_SEND_TO` in the route between the +transport `from` and the `irc:` `to`. Allowing untrusted senders to drive +`IrcConstants.IRC_SEND_TO` without such a mapping step is not the intended use +of the component. + == Upgrading from 4.18.1 to 4.18.2 === camel-platform-http-main diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/IrcEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/IrcEndpointBuilderFactory.java index 1597d8f70a3ee..e3bd5f53d29a2 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/IrcEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/IrcEndpointBuilderFactory.java @@ -136,7 +136,7 @@ default IrcEndpointConsumerBuilder keys(String keys) { /** * Sends NAMES command to channel after joining it. onReply has to be * true in order to process the result which will have the header value - * irc.num = '353'. + * CamelIrcNum = '353'. * * The option is a: boolean type. * @@ -153,7 +153,7 @@ default IrcEndpointConsumerBuilder namesOnJoin(boolean namesOnJoin) { /** * Sends NAMES command to channel after joining it. onReply has to be * true in order to process the result which will have the header value - * irc.num = '353'. + * CamelIrcNum = '353'. * * The option will be converted to a boolean type. * @@ -872,7 +872,7 @@ default IrcEndpointProducerBuilder keys(String keys) { /** * Sends NAMES command to channel after joining it. onReply has to be * true in order to process the result which will have the header value - * irc.num = '353'. + * CamelIrcNum = '353'. * * The option is a: boolean type. * @@ -889,7 +889,7 @@ default IrcEndpointProducerBuilder namesOnJoin(boolean namesOnJoin) { /** * Sends NAMES command to channel after joining it. onReply has to be * true in order to process the result which will have the header value - * irc.num = '353'. + * CamelIrcNum = '353'. * * The option will be converted to a boolean type. * @@ -1537,7 +1537,7 @@ default IrcEndpointBuilder keys(String keys) { /** * Sends NAMES command to channel after joining it. onReply has to be * true in order to process the result which will have the header value - * irc.num = '353'. + * CamelIrcNum = '353'. * * The option is a: boolean type. * @@ -1554,7 +1554,7 @@ default IrcEndpointBuilder namesOnJoin(boolean namesOnJoin) { /** * Sends NAMES command to channel after joining it. onReply has to be * true in order to process the result which will have the header value - * irc.num = '353'. + * CamelIrcNum = '353'. * * The option will be converted to a boolean type. * @@ -2136,10 +2136,10 @@ public static class IrcHeaderNameBuilder { * * Group: common * - * @return the name of the header {@code irc.messageType}. + * @return the name of the header {@code IrcMessageType}. */ - public String ircMessagetype() { - return "irc.messageType"; + public String ircMessageType() { + return "CamelIrcMessageType"; } /** * The target. @@ -2148,10 +2148,10 @@ public String ircMessagetype() { * * Group: common * - * @return the name of the header {@code irc.target}. + * @return the name of the header {@code IrcTarget}. */ public String ircTarget() { - return "irc.target"; + return "CamelIrcTarget"; } /** * The nickname or channel the message should be sent to. @@ -2160,10 +2160,10 @@ public String ircTarget() { * * Group: common * - * @return the name of the header {@code irc.sendTo}. + * @return the name of the header {@code IrcSendTo}. */ - public String ircSendto() { - return "irc.sendTo"; + public String ircSendTo() { + return "CamelIrcSendTo"; } /** * The nickname of the user who is kicked from a channel (passive). @@ -2172,10 +2172,10 @@ public String ircSendto() { * * Group: common * - * @return the name of the header {@code irc.user.kicked}. + * @return the name of the header {@code IrcUserKicked}. */ public String ircUserKicked() { - return "irc.user.kicked"; + return "CamelIrcUserKicked"; } /** * The host of the person who sent the line. @@ -2184,10 +2184,10 @@ public String ircUserKicked() { * * Group: common * - * @return the name of the header {@code irc.user.host}. + * @return the name of the header {@code IrcUserHost}. */ public String ircUserHost() { - return "irc.user.host"; + return "CamelIrcUserHost"; } /** * The nickname of the person who sent the line or the server name of @@ -2197,10 +2197,10 @@ public String ircUserHost() { * * Group: common * - * @return the name of the header {@code irc.user.nick}. + * @return the name of the header {@code IrcUserNick}. */ public String ircUserNick() { - return "irc.user.nick"; + return "CamelIrcUserNick"; } /** * The server name of the server which sent the line or the nickname of @@ -2210,10 +2210,10 @@ public String ircUserNick() { * * Group: common * - * @return the name of the header {@code irc.user.servername}. + * @return the name of the header {@code IrcUserServername}. */ public String ircUserServername() { - return "irc.user.servername"; + return "CamelIrcUserServername"; } /** * The username of the person who sent the line. @@ -2222,10 +2222,10 @@ public String ircUserServername() { * * Group: common * - * @return the name of the header {@code irc.user.username}. + * @return the name of the header {@code IrcUserUsername}. */ public String ircUserUsername() { - return "irc.user.username"; + return "CamelIrcUserUsername"; } /** * The numeric reply. @@ -2234,10 +2234,10 @@ public String ircUserUsername() { * * Group: common * - * @return the name of the header {@code irc.num}. + * @return the name of the header {@code IrcNum}. */ public String ircNum() { - return "irc.num"; + return "CamelIrcNum"; } /** * The first part of the message. @@ -2246,10 +2246,10 @@ public String ircNum() { * * Group: common * - * @return the name of the header {@code irc.value}. + * @return the name of the header {@code IrcValue}. */ public String ircValue() { - return "irc.value"; + return "CamelIrcValue"; } } static IrcEndpointBuilder endpointBuilder(String componentName, String path) {