Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }
},
"headers": {
"dns.class": { "index": 0, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The DNS class of the lookup. Should match the values of org.xbill.dns.DClass. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_CLASS" },
"dns.name": { "index": 1, "kind": "header", "displayName": "", "group": "lookup", "label": "lookup", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name to lookup", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_NAME" },
"dns.domain": { "index": 2, "kind": "header", "displayName": "", "group": "ip", "label": "ip", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The domain name.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_DOMAIN" },
"dns.server": { "index": 3, "kind": "header", "displayName": "", "group": "dig", "label": "dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server in particular for the query. If none is given, the default one specified by the OS will be used. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_SERVER" },
"dns.type": { "index": 4, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup. Should match the values of org.xbill.dns.Type. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_TYPE" },
"term": { "index": 5, "kind": "header", "displayName": "", "group": "wikipedia", "label": "wikipedia", "required": true, "javaType": "", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The term", "constantName": "org.apache.camel.component.dns.DnsConstants#TERM" }
"CamelDnsClass": { "index": 0, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The DNS class of the lookup. Should match the values of org.xbill.dns.DClass. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_CLASS" },
"CamelDnsName": { "index": 1, "kind": "header", "displayName": "", "group": "lookup", "label": "lookup", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name to lookup", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_NAME" },
"CamelDnsDomain": { "index": 2, "kind": "header", "displayName": "", "group": "ip", "label": "ip", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The domain name.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_DOMAIN" },
"CamelDnsServer": { "index": 3, "kind": "header", "displayName": "", "group": "dig", "label": "dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server in particular for the query. If none is given, the default one specified by the OS will be used. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_SERVER" },
"CamelDnsType": { "index": 4, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup. Should match the values of org.xbill.dns.Type. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_TYPE" },
"CamelDnsTerm": { "index": 5, "kind": "header", "displayName": "", "group": "wikipedia", "label": "wikipedia", "required": true, "javaType": "", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The term", "constantName": "org.apache.camel.component.dns.DnsConstants#TERM" }
},
"properties": {
"dnsType": { "index": 0, "kind": "path", "displayName": "Dns Type", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.dns.DnsType", "enum": [ "dig", "ip", "lookup", "wikipedia" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup." },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }
},
"headers": {
"dns.class": { "index": 0, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The DNS class of the lookup. Should match the values of org.xbill.dns.DClass. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_CLASS" },
"dns.name": { "index": 1, "kind": "header", "displayName": "", "group": "lookup", "label": "lookup", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name to lookup", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_NAME" },
"dns.domain": { "index": 2, "kind": "header", "displayName": "", "group": "ip", "label": "ip", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The domain name.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_DOMAIN" },
"dns.server": { "index": 3, "kind": "header", "displayName": "", "group": "dig", "label": "dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server in particular for the query. If none is given, the default one specified by the OS will be used. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_SERVER" },
"dns.type": { "index": 4, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup. Should match the values of org.xbill.dns.Type. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_TYPE" },
"term": { "index": 5, "kind": "header", "displayName": "", "group": "wikipedia", "label": "wikipedia", "required": true, "javaType": "", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The term", "constantName": "org.apache.camel.component.dns.DnsConstants#TERM" }
"CamelDnsClass": { "index": 0, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The DNS class of the lookup. Should match the values of org.xbill.dns.DClass. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_CLASS" },
"CamelDnsName": { "index": 1, "kind": "header", "displayName": "", "group": "lookup", "label": "lookup", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name to lookup", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_NAME" },
"CamelDnsDomain": { "index": 2, "kind": "header", "displayName": "", "group": "ip", "label": "ip", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The domain name.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_DOMAIN" },
"CamelDnsServer": { "index": 3, "kind": "header", "displayName": "", "group": "dig", "label": "dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server in particular for the query. If none is given, the default one specified by the OS will be used. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_SERVER" },
"CamelDnsType": { "index": 4, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup. Should match the values of org.xbill.dns.Type. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_TYPE" },
"CamelDnsTerm": { "index": 5, "kind": "header", "displayName": "", "group": "wikipedia", "label": "wikipedia", "required": true, "javaType": "", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The term", "constantName": "org.apache.camel.component.dns.DnsConstants#TERM" }
},
"properties": {
"dnsType": { "index": 0, "kind": "path", "displayName": "Dns Type", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.dns.DnsType", "enum": [ "dig", "ip", "lookup", "wikipedia" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup." },
Expand Down
6 changes: 3 additions & 3 deletions components/camel-dns/src/main/docs/dns-component.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ include::partial$component-endpoint-headers.adoc[]
This looks up a domain's IP. For example, _www.example.com_ resolves to
192.0.32.10.

The IP address to lookup must be provided in the header with key `"dns.domain"`.
The IP address to lookup must be provided in the header with key `"CamelDnsDomain"`.

=== DNS lookup

Expand All @@ -87,7 +87,7 @@ The IP address to lookup must be provided in the header with key `"dns.domain"`.

This returns a set of DNS records associated with a domain. +
The name to lookup must be provided in the header with key
`"dns.name"`.
`"CamelDnsName"`.

=== DNS Dig

Expand All @@ -101,7 +101,7 @@ Dig is a Unix command-line utility to run DNS queries.
</route>
----

The query must be provided in the header with key `"dns.query"`.
The query must be provided in the header with key `"CamelDnsName"`.


=== Dns Activation Policy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,35 @@
* <p>
* dns:///ip <br/>
* <p/>
* This will return the IP address associated with the domain passed in the header dns.domain.
* This will return the IP address associated with the domain passed in the header CamelDnsDomain.
* </p>
* <p>
* dns:///lookup This endpoint accepts three parameters.
* <ul>
* <li>dns.name: the lookup name. Usually the domain. Mandatory.</li>
* <li>dns.type: the type of the lookup. Should match the values of {@see org.xbill.dns.Type}. Optional.</li>
* <li>dns.class: the DNS class of the lookup. Should match the values of {@see org.xbill.dns.DClass}. Optional.</li>
* <li>CamelDnsName: the lookup name. Usually the domain. Mandatory.</li>
* <li>CamelDnsType: the type of the lookup. Should match the values of {@see org.xbill.dns.Type}. Optional.</li>
* <li>CamelDnsClass: the DNS class of the lookup. Should match the values of {@see org.xbill.dns.DClass}.
* Optional.</li>
* </ul>
* </p>
* <p/>
* <p>
* dns:///dig This endpoint takes a few parameters, most of them optional :
* <ul>
* <li>dns.server: the server in particular for the query. If none is given, the default one specified by the OS will be
* used.</li>
* <li>dns.query: the query itself. Mandatory.</li>
* <li>dns.type: the type of the lookup. Should match the values of {@see org.xbill.dns.Type}. Optional.</li>
* <li>dns.class: the DNS class of the lookup. Should match the values of {@see org.xbill.dns.DClass}. Optional.</li>
* <li>CamelDnsServer: the server in particular for the query. If none is given, the default one specified by the OS
* will be used.</li>
* <li>CamelDnsName: the lookup name to query. Mandatory.</li>
* <li>CamelDnsType: the type of the lookup. Should match the values of {@see org.xbill.dns.Type}. Optional.</li>
* <li>CamelDnsClass: the DNS class of the lookup. Should match the values of {@see org.xbill.dns.DClass}.
* Optional.</li>
* </ul>
* <p/>
* </p>
* <p/>
* <p>
* dns:///wikipedia This endpoint takes one paramter :
* <ul>
* <li>term: the search term on wikipedia</li>
* <li>CamelDnsTerm: the search term on wikipedia</li>
* </ul>
* <p/>
* </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ public class DnsConstants {
@Metadata(label = "lookup dig", description = "The DNS class of the lookup. Should match the values of\n" +
"`org.xbill.dns.DClass`. Optional.",
javaType = "String")
public static final String DNS_CLASS = "dns.class";
public static final String DNS_CLASS = "CamelDnsClass";
@Metadata(label = "lookup", description = "The name to lookup", javaType = "String", required = true)
public static final String DNS_NAME = "dns.name";
public static final String DNS_NAME = "CamelDnsName";
@Metadata(label = "ip", description = "The domain name.", javaType = "String", required = true)
public static final String DNS_DOMAIN = "dns.domain";
public static final String DNS_DOMAIN = "CamelDnsDomain";
@Metadata(label = "dig", description = "The server in particular for the query. If none is given, the default\n" +
"one specified by the OS will be used. Optional.",
javaType = "String")
public static final String DNS_SERVER = "dns.server";
public static final String DNS_SERVER = "CamelDnsServer";
@Metadata(label = "lookup dig", description = "The type of the lookup. Should match the values of `org.xbill.dns.Type`.\n" +
"Optional.",
javaType = "String")
public static final String DNS_TYPE = "dns.type";
public static final String DNS_TYPE = "CamelDnsType";
@Metadata(label = "wikipedia", description = "The term", required = true)
public static final String TERM = "term";
public static final String TERM = "CamelDnsTerm";

protected DnsConstants() {
//Utility class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* <p/>
* See here for a reference: http://www.commandlinefu.com/commands/view/2829/query-wikipedia-via-console-over-dns
* <p/>
* This endpoint accepts the following header: term: a simple term to use to query wikipedia.
* This endpoint accepts the following header: CamelDnsTerm: a simple term to use to query wikipedia.
*/
public class DnsWikipediaProducer extends DefaultProducer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public boolean matches(Exchange exchange) {
}
});
Map<String, Object> headers = new HashMap<>();
headers.put("dns.name", "monkey.wp.dg.cx");
headers.put("dns.type", "TXT");
headers.put(DnsConstants.DNS_NAME, "monkey.wp.dg.cx");
headers.put(DnsConstants.DNS_TYPE, "TXT");
template.sendBodyAndHeaders(null, headers);
resultEndpoint.assertIsSatisfied();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public boolean matches(Exchange exchange) {
}
});
Map<String, Object> headers = new HashMap<>();
headers.put("dns.name", "monkey.wp.dg.cx");
headers.put("dns.type", "TXT");
headers.put(DnsConstants.DNS_NAME, "monkey.wp.dg.cx");
headers.put(DnsConstants.DNS_TYPE, "TXT");
template.sendBodyAndHeaders(null, headers);
resultEndpoint.assertIsSatisfied();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class DnsIpEndpointSpringTest extends CamelSpringTestSupport {
void testNullIPRequests() throws Exception {
resultEndpoint.expectedMessageCount(0);
Exception e = assertThrows(Exception.class, () -> {
template.sendBodyAndHeader("hello", "dns.domain", null);
template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, null);
});
assertTrue(e.getCause() instanceof IllegalArgumentException);
resultEndpoint.assertIsSatisfied();
Expand All @@ -54,7 +54,7 @@ void testNullIPRequests() throws Exception {
void testEmptyIPRequests() throws Exception {
resultEndpoint.expectedMessageCount(0);
Exception e = assertThrows(Exception.class, () -> {
template.sendBodyAndHeader("hello", "dns.domain", "");
template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, "");
});
assertTrue(e.getCause() instanceof IllegalArgumentException);
resultEndpoint.assertIsSatisfied();
Expand All @@ -67,7 +67,7 @@ void testValidIPRequests() throws Exception {

resultEndpoint.expectedBodiesReceived("40.79.78.1");

template.sendBodyAndHeader("hello", "dns.domain", "www.apache.org");
template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, "www.apache.org");
resultEndpoint.assertIsSatisfied();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void configure() {
void testNullIPRequests() throws Exception {
resultEndpoint.expectedMessageCount(0);
Exception e = assertThrows(Exception.class, () -> {
template.sendBodyAndHeader("hello", "dns.domain", null);
template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, null);
});
assertTrue(e.getCause() instanceof IllegalArgumentException);
resultEndpoint.assertIsSatisfied();
Expand All @@ -63,7 +63,7 @@ void testNullIPRequests() throws Exception {
void testEmptyIPRequests() throws Exception {
resultEndpoint.expectedMessageCount(0);
Exception e = assertThrows(Exception.class, () -> {
template.sendBodyAndHeader("hello", "dns.domain", "");
template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, "");
});
assertTrue(e.getCause() instanceof IllegalArgumentException);
resultEndpoint.assertIsSatisfied();
Expand All @@ -76,7 +76,7 @@ void testValidIPRequests() throws Exception {

resultEndpoint.expectedBodiesReceived("40.79.78.1");

template.sendBodyAndHeader("hello", "dns.domain", "www.apache.org");
template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, "www.apache.org");
resultEndpoint.assertIsSatisfied();
}
}
Loading
Loading