Skip to content
Closed
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 @@ -67,6 +67,8 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
case "productUri": getOrCreateConfiguration(target).setProductUri(property(camelContext, java.lang.String.class, value)); return true;
case "requesttimeout":
case "requestTimeout": getOrCreateConfiguration(target).setRequestTimeout(property(camelContext, java.lang.Long.class, value)); return true;
case "requestedpublishinginterval":
case "requestedPublishingInterval": getOrCreateConfiguration(target).setRequestedPublishingInterval(property(camelContext, java.lang.Double.class, value)); return true;
case "sessionname":
case "sessionName": getOrCreateConfiguration(target).setSessionName(property(camelContext, java.lang.String.class, value)); return true;
case "sessiontimeout":
Expand Down Expand Up @@ -99,6 +101,7 @@ public Map<String, Object> getAllOptions(Object target) {
answer.put("overrideHost", boolean.class);
answer.put("productUri", java.lang.String.class);
answer.put("requestTimeout", java.lang.Long.class);
answer.put("requestedPublishingInterval", java.lang.Double.class);
answer.put("sessionName", java.lang.String.class);
answer.put("sessionTimeout", java.lang.Long.class);
return answer;
Expand Down Expand Up @@ -149,6 +152,8 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
case "productUri": return getOrCreateConfiguration(target).getProductUri();
case "requesttimeout":
case "requestTimeout": return getOrCreateConfiguration(target).getRequestTimeout();
case "requestedpublishinginterval":
case "requestedPublishingInterval": return getOrCreateConfiguration(target).getRequestedPublishingInterval();
case "sessionname":
case "sessionName": return getOrCreateConfiguration(target).getSessionName();
case "sessiontimeout":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
case "productUri": target.getConfiguration().setProductUri(property(camelContext, java.lang.String.class, value)); return true;
case "requesttimeout":
case "requestTimeout": target.getConfiguration().setRequestTimeout(property(camelContext, java.lang.Long.class, value)); return true;
case "requestedpublishinginterval":
case "requestedPublishingInterval": target.getConfiguration().setRequestedPublishingInterval(property(camelContext, java.lang.Double.class, value)); return true;
case "samplinginterval":
case "samplingInterval": target.setSamplingInterval(property(camelContext, java.lang.Double.class, value)); return true;
case "sessionname":
Expand Down Expand Up @@ -106,6 +108,7 @@ public Map<String, Object> getAllOptions(Object target) {
answer.put("overrideHost", boolean.class);
answer.put("productUri", java.lang.String.class);
answer.put("requestTimeout", java.lang.Long.class);
answer.put("requestedPublishingInterval", java.lang.Double.class);
answer.put("samplingInterval", java.lang.Double.class);
answer.put("sessionName", java.lang.String.class);
answer.put("sessionTimeout", java.lang.Long.class);
Expand Down Expand Up @@ -165,6 +168,8 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
case "productUri": return target.getConfiguration().getProductUri();
case "requesttimeout":
case "requestTimeout": return target.getConfiguration().getRequestTimeout();
case "requestedpublishinginterval":
case "requestedPublishingInterval": return target.getConfiguration().getRequestedPublishingInterval();
case "samplinginterval":
case "samplingInterval": return target.getSamplingInterval();
case "sessionname":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"maxResponseMessageSize": { "kind": "property", "displayName": "Max Response Message Size", "group": "client", "label": "client", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "The maximum number of bytes a response message may have" },
"overrideHost": { "kind": "property", "displayName": "Override Host", "group": "client", "label": "client", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "Override the server reported endpoint host with the host from the endpoint URI." },
"productUri": { "kind": "property", "displayName": "Product Uri", "group": "client", "label": "client", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "http:\/\/camel.apache.org\/EclipseMilo", "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "The product URI" },
"requestedPublishingInterval": { "kind": "property", "displayName": "Requested Publishing Interval", "group": "client", "label": "client", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "secret": false, "defaultValue": "1_000.0", "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "The requested publishing interval in milliseconds" },
"requestTimeout": { "kind": "property", "displayName": "Request Timeout", "group": "client", "label": "client", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "Request timeout in milliseconds" },
"sessionName": { "kind": "property", "displayName": "Session Name", "group": "client", "label": "client", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "Session name" },
"sessionTimeout": { "kind": "property", "displayName": "Session Timeout", "group": "client", "label": "client", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "Session timeout in milliseconds" }
Expand All @@ -51,7 +52,7 @@
"discoveryEndpointUri": { "kind": "parameter", "displayName": "Discovery Endpoint Uri", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "An alternative discovery URI" },
"method": { "kind": "parameter", "displayName": "Method", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The method definition (see Method ID)" },
"node": { "kind": "parameter", "displayName": "Node", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The node definition (see Node ID)" },
"samplingInterval": { "kind": "parameter", "displayName": "Sampling Interval", "group": "common", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "secret": false, "description": "The sampling interval in milliseconds" },
"samplingInterval": { "kind": "parameter", "displayName": "Sampling Interval", "group": "common", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "secret": false, "defaultValue": "0.0", "description": "The sampling interval in milliseconds" },
"bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." },
"exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." },
"exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
Expand All @@ -71,6 +72,7 @@
"maxResponseMessageSize": { "kind": "parameter", "displayName": "Max Response Message Size", "group": "client", "label": "client", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "The maximum number of bytes a response message may have" },
"overrideHost": { "kind": "parameter", "displayName": "Override Host", "group": "client", "label": "client", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "Override the server reported endpoint host with the host from the endpoint URI." },
"productUri": { "kind": "parameter", "displayName": "Product Uri", "group": "client", "label": "client", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "http:\/\/camel.apache.org\/EclipseMilo", "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "The product URI" },
"requestedPublishingInterval": { "kind": "parameter", "displayName": "Requested Publishing Interval", "group": "client", "label": "client", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "secret": false, "defaultValue": "1_000.0", "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "The requested publishing interval in milliseconds" },
"requestTimeout": { "kind": "parameter", "displayName": "Request Timeout", "group": "client", "label": "client", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "Request timeout in milliseconds" },
"sessionName": { "kind": "parameter", "displayName": "Session Name", "group": "client", "label": "client", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "Session name" },
"sessionTimeout": { "kind": "parameter", "displayName": "Session Timeout", "group": "client", "label": "client", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.milo.client.MiloClientConfiguration", "configurationField": "configuration", "description": "Session timeout in milliseconds" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ for this component:


// component options: START
The OPC UA Client component supports 23 options, which are listed below.
The OPC UA Client component supports 24 options, which are listed below.



Expand All @@ -55,6 +55,7 @@ The OPC UA Client component supports 23 options, which are listed below.
| *maxResponseMessageSize* (client) | The maximum number of bytes a response message may have | | Long
| *overrideHost* (client) | Override the server reported endpoint host with the host from the endpoint URI. | false | boolean
| *productUri* (client) | The product URI | http://camel.apache.org/EclipseMilo | String
| *requestedPublishingInterval* (client) | The requested publishing interval in milliseconds | 1_000.0 | Double
| *requestTimeout* (client) | Request timeout in milliseconds | | Long
| *sessionName* (client) | Session name | | String
| *sessionTimeout* (client) | Session timeout in milliseconds | | Long
Expand Down Expand Up @@ -120,7 +121,7 @@ with the following path and query parameters:
|===


=== Query Parameters (29 parameters):
=== Query Parameters (30 parameters):


[width="100%",cols="2,5,^1,2",options="header"]
Expand All @@ -132,7 +133,7 @@ with the following path and query parameters:
| *discoveryEndpointUri* (common) | An alternative discovery URI | | String
| *method* (common) | The method definition (see Method ID) | | String
| *node* (common) | The node definition (see Node ID) | | String
| *samplingInterval* (common) | The sampling interval in milliseconds | | Double
| *samplingInterval* (common) | The sampling interval in milliseconds | 0.0 | Double
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. The value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern
Expand All @@ -152,6 +153,7 @@ with the following path and query parameters:
| *maxResponseMessageSize* (client) | The maximum number of bytes a response message may have | | Long
| *overrideHost* (client) | Override the server reported endpoint host with the host from the endpoint URI. | false | boolean
| *productUri* (client) | The product URI | http://camel.apache.org/EclipseMilo | String
| *requestedPublishingInterval* (client) | The requested publishing interval in milliseconds | 1_000.0 | Double
| *requestTimeout* (client) | Request timeout in milliseconds | | Long
| *sessionName* (client) | Session name | | String
| *sessionTimeout* (client) | Session timeout in milliseconds | | Long
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class MiloClientConfiguration implements Cloneable {

private static final String DEFAULT_PRODUCT_URI = "http://camel.apache.org/EclipseMilo";

private static final Double DEFAULT_REQUESTED_PUBLISHING_INTERVAL = 1_000.0;

@XmlTransient // to not be included in component docs
private String endpointUri;

Expand Down Expand Up @@ -104,6 +106,9 @@ public class MiloClientConfiguration implements Cloneable {
@UriParam(label = "client")
private boolean overrideHost;

@UriParam(label = "client", defaultValue = "1_000.0")
private Double requestedPublishingInterval = DEFAULT_REQUESTED_PUBLISHING_INTERVAL;

public MiloClientConfiguration() {
}

Expand All @@ -127,6 +132,7 @@ public MiloClientConfiguration(final MiloClientConfiguration other) {
this.keyPassword = other.keyPassword;
this.allowedSecurityPolicies = allowedSecurityPolicies != null ? new HashSet<>(other.allowedSecurityPolicies) : null;
this.overrideHost = other.overrideHost;
this.requestedPublishingInterval = other.requestedPublishingInterval;
}

/**
Expand Down Expand Up @@ -388,6 +394,17 @@ public boolean isOverrideHost() {
return overrideHost;
}

/**
* The requested publishing interval in milliseconds
*/
public void setRequestedPublishingInterval(Double requestedPublishingInterval) {
this.requestedPublishingInterval = requestedPublishingInterval;
}

public Double getRequestedPublishingInterval() {
return requestedPublishingInterval;
}

@Override
public MiloClientConfiguration clone() {
return new MiloClientConfiguration(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public class MiloClientEndpoint extends DefaultEndpoint {
/**
* The sampling interval in milliseconds
*/
@UriParam
private Double samplingInterval;
@UriParam(defaultValue = "0.0")
private Double samplingInterval = 0.0;

/**
* The client configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ public void putSubscriptions(final Map<UInteger, Subscription> subscriptions) th
} else {
final ReadValueId itemId = new ReadValueId(node, AttributeId.Value.uid(), null, QualifiedName.NULL_VALUE);
Double samplingInterval = s.getSamplingInterval();
if (samplingInterval == null) {
// work around a bug (NPE) in Eclipse Milo 0.1.3
samplingInterval = 0.0;
}
final MonitoringParameters parameters = new MonitoringParameters(entry.getKey(), samplingInterval, null, null, null);
items.add(new MonitoredItemCreateRequest(itemId, MonitoringMode.Reporting, parameters));
}
Expand Down Expand Up @@ -337,7 +333,6 @@ public CompletableFuture<CallMethodResult> call(final ExpandedNodeId nodeId, fin

});
}

}

private final MiloClientConfiguration configuration;
Expand Down Expand Up @@ -478,7 +473,7 @@ private Connected performConnect() throws Exception {
client.connect().get();

try {
final UaSubscription manager = client.getSubscriptionManager().createSubscription(1_000.0).get();
final UaSubscription manager = client.getSubscriptionManager().createSubscription(this.configuration.getRequestedPublishingInterval()).get();
client.getSubscriptionManager().addSubscriptionListener(new SubscriptionListenerImpl());

return new Connected(client, manager);
Expand Down
Loading