You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/04/12 08:55:47 UTC

[01/18] camel git commit: Remove query parameters from URI

Repository: camel
Updated Branches:
  refs/heads/master 586f9409d -> b7df95775


Remove query parameters from URI


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/89333ca5
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/89333ca5
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/89333ca5

Branch: refs/heads/master
Commit: 89333ca5d7ebdd045d4ec6ae5bdbb4b3135d8995
Parents: 60d1e3d
Author: Jens Reimann <jr...@redhat.com>
Authored: Wed Apr 12 08:48:58 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:26 2017 +0200

----------------------------------------------------------------------
 .../org/apache/camel/component/milo/server/MiloServerEndpoint.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/89333ca5/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
index 6abacf2..7045286 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
@@ -30,7 +30,7 @@ import org.apache.camel.spi.UriPath;
 /**
  * OPC UA Server based endpoint
  */
-@UriEndpoint(scheme = "milo-server", syntax = "milo-server:itemId[?options]", title = "OPC UA Server", consumerClass = MiloServerConsumer.class, label = "iot")
+@UriEndpoint(scheme = "milo-server", syntax = "milo-server:itemId", title = "OPC UA Server", consumerClass = MiloServerConsumer.class, label = "iot")
 class MiloServerEndpoint extends DefaultEndpoint {
 
 	@UriPath


[04/18] camel git commit: Initial import of Camel Milo

Posted by ac...@apache.org.
http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/package-info.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/package-info.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/package-info.java
new file mode 100644
index 0000000..cf9ef60
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Client functionality
+ */
+package org.apache.camel.component.milo.client;

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
new file mode 100644
index 0000000..eaf178b
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.converter;
+
+import org.apache.camel.Converter;
+import org.apache.camel.TypeConverters;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
+
+@Converter
+public final class ValueConverter implements TypeConverters {
+	private ValueConverter() {
+	}
+
+	@Converter
+	public static Variant toVariant(final DataValue value) {
+		return value.getValue();
+	}
+
+	@Converter
+	public static DataValue toDataValue(final Variant value) {
+		return new DataValue(value);
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
new file mode 100644
index 0000000..7e5e94c
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * Data conversion
+ */
+package org.apache.camel.component.milo.converter;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/package-info.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/package-info.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/package-info.java
new file mode 100644
index 0000000..7d99602
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Common base classes
+ */
+package org.apache.camel.component.milo;

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
new file mode 100644
index 0000000..0c383c9
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
@@ -0,0 +1,466 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.server;
+
+import static java.util.Collections.singletonList;
+import static org.eclipse.milo.opcua.sdk.server.api.config.OpcUaServerConfig.USER_TOKEN_POLICY_ANONYMOUS;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.security.KeyPair;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.function.Supplier;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.component.milo.KeyStoreLoader;
+import org.apache.camel.component.milo.client.MiloClientConsumer;
+import org.apache.camel.component.milo.server.internal.CamelNamespace;
+import org.apache.camel.impl.DefaultComponent;
+import org.eclipse.milo.opcua.sdk.server.OpcUaServer;
+import org.eclipse.milo.opcua.sdk.server.api.config.OpcUaServerConfig;
+import org.eclipse.milo.opcua.sdk.server.api.config.OpcUaServerConfigBuilder;
+import org.eclipse.milo.opcua.sdk.server.identity.AnonymousIdentityValidator;
+import org.eclipse.milo.opcua.sdk.server.identity.IdentityValidator;
+import org.eclipse.milo.opcua.sdk.server.identity.UsernameIdentityValidator;
+import org.eclipse.milo.opcua.stack.core.StatusCodes;
+import org.eclipse.milo.opcua.stack.core.UaException;
+import org.eclipse.milo.opcua.stack.core.application.CertificateManager;
+import org.eclipse.milo.opcua.stack.core.application.CertificateValidator;
+import org.eclipse.milo.opcua.stack.core.application.DefaultCertificateManager;
+import org.eclipse.milo.opcua.stack.core.application.DefaultCertificateValidator;
+import org.eclipse.milo.opcua.stack.core.security.SecurityPolicy;
+import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
+import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo;
+import org.eclipse.milo.opcua.stack.core.types.structured.UserTokenPolicy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * OPC UA Server based component
+ */
+public class MiloServerComponent extends DefaultComponent {
+
+	private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);
+
+	private final static class DenyAllCertificateValidator implements CertificateValidator {
+		public static final CertificateValidator INSTANCE = new DenyAllCertificateValidator();
+
+		private DenyAllCertificateValidator() {
+		}
+
+		@Override
+		public void validate(final X509Certificate certificate) throws UaException {
+			throw new UaException(StatusCodes.Bad_CertificateUseNotAllowed);
+		}
+
+		@Override
+		public void verifyTrustChain(final X509Certificate certificate, final List<X509Certificate> chain)
+				throws UaException {
+			throw new UaException(StatusCodes.Bad_CertificateUseNotAllowed);
+		}
+	}
+
+	private static final String URL_CHARSET = "UTF-8";
+
+	public static final String DEFAULT_NAMESPACE_URI = "urn:org:apache:camel";
+
+	private static final OpcUaServerConfig DEFAULT_SERVER_CONFIG;
+	
+	static {
+		final OpcUaServerConfigBuilder cfg = OpcUaServerConfig.builder();
+
+		cfg.setCertificateManager(new DefaultCertificateManager());
+		cfg.setCertificateValidator(DenyAllCertificateValidator.INSTANCE);
+		cfg.setSecurityPolicies(EnumSet.allOf(SecurityPolicy.class));
+		cfg.setApplicationName(LocalizedText.english("Apache Camel Milo Server"));
+		cfg.setApplicationUri("urn:org:apache:camel:milo:server");
+		cfg.setProductUri("urn:org:apache:camel:milo");
+
+		if (Boolean.getBoolean("org.apache.camel.milo.server.default.enableAnonymous")) {
+			cfg.setUserTokenPolicies(singletonList(USER_TOKEN_POLICY_ANONYMOUS));
+			cfg.setIdentityValidator(AnonymousIdentityValidator.INSTANCE);
+		}
+
+		DEFAULT_SERVER_CONFIG = cfg.build();
+	}
+
+	private String namespaceUri = DEFAULT_NAMESPACE_URI;
+
+	private final OpcUaServerConfigBuilder serverConfig;
+
+	private OpcUaServer server;
+	private CamelNamespace namespace;
+
+	private final Map<String, MiloServerEndpoint> endpoints = new HashMap<>();
+
+	private Boolean enableAnonymousAuthentication;
+
+	private Map<String, String> userMap;
+
+	private List<String> bindAddresses;
+
+	private Supplier<CertificateValidator> certificateValidator;
+
+	private final List<Runnable> runOnStop = new LinkedList<>();
+
+	public MiloServerComponent() {
+		this(DEFAULT_SERVER_CONFIG);
+	}
+
+	public MiloServerComponent(final OpcUaServerConfig serverConfig) {
+		this.serverConfig = OpcUaServerConfig.copy(serverConfig != null ? serverConfig : DEFAULT_SERVER_CONFIG);
+	}
+
+	@Override
+	protected void doStart() throws Exception {
+		this.server = new OpcUaServer(buildServerConfig());
+
+		this.namespace = this.server.getNamespaceManager().registerAndAdd(this.namespaceUri,
+				index -> new CamelNamespace(index, this.namespaceUri, this.server));
+
+		super.doStart();
+		this.server.startup();
+	}
+
+	/**
+	 * Build the final server configuration, apply all complex configuration
+	 *
+	 * @return the new server configuration, never returns {@code null}
+	 */
+	private OpcUaServerConfig buildServerConfig() {
+
+		if (this.userMap != null || this.enableAnonymousAuthentication != null) {
+			// set identity validator
+
+			final Map<String, String> userMap = this.userMap != null ? new HashMap<>(this.userMap)
+					: Collections.emptyMap();
+			final boolean allowAnonymous = this.enableAnonymousAuthentication != null
+					? this.enableAnonymousAuthentication : false;
+			final IdentityValidator identityValidator = new UsernameIdentityValidator(allowAnonymous, challenge -> {
+				final String pwd = userMap.get(challenge.getUsername());
+				if (pwd == null) {
+					return false;
+				}
+				return pwd.equals(challenge.getPassword());
+			});
+			this.serverConfig.setIdentityValidator(identityValidator);
+
+			// add token policies
+
+			final List<UserTokenPolicy> tokenPolicies = new LinkedList<>();
+			if (Boolean.TRUE.equals(this.enableAnonymousAuthentication)) {
+				tokenPolicies.add(OpcUaServerConfig.USER_TOKEN_POLICY_ANONYMOUS);
+			}
+			if (userMap != null) {
+				tokenPolicies.add(OpcUaServerConfig.USER_TOKEN_POLICY_USERNAME);
+			}
+			this.serverConfig.setUserTokenPolicies(tokenPolicies);
+		}
+
+		if (this.bindAddresses != null) {
+			this.serverConfig.setBindAddresses(new ArrayList<>(this.bindAddresses));
+		}
+
+		if (this.certificateValidator != null) {
+			final CertificateValidator validator = this.certificateValidator.get();
+			LOG.debug("Using validator: {}", validator);
+			if (validator instanceof Closeable) {
+				runOnStop(() -> {
+					try {
+						LOG.debug("Closing: {}", validator);
+						((Closeable) validator).close();
+					} catch (final IOException e) {
+						LOG.warn("Failed to close", e);
+					}
+				});
+			}
+			this.serverConfig.setCertificateValidator(validator);
+		}
+
+		// build final configuration
+
+		return this.serverConfig.build();
+	}
+
+	private void runOnStop(final Runnable runnable) {
+		this.runOnStop.add(runnable);
+	}
+
+	@Override
+	protected void doStop() throws Exception {
+		this.server.shutdown();
+		super.doStop();
+
+		this.runOnStop.forEach(runnable -> {
+			try {
+				runnable.run();
+			} catch (final Exception e) {
+				LOG.warn("Failed to run on stop", e);
+			}
+		});
+		this.runOnStop.clear();
+	}
+
+	@Override
+	protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters)
+			throws Exception {
+		synchronized (this) {
+			if (remaining == null || remaining.isEmpty()) {
+				return null;
+			}
+
+			MiloServerEndpoint endpoint = this.endpoints.get(remaining);
+
+			if (endpoint == null) {
+				endpoint = new MiloServerEndpoint(uri, remaining, this.namespace, this);
+				setProperties(endpoint, parameters);
+				this.endpoints.put(remaining, endpoint);
+			}
+
+			return endpoint;
+		}
+	}
+
+	/**
+	 * The URI of the namespace, defaults to <code>urn:org:apache:camel</code>
+	 */
+	public void setNamespaceUri(final String namespaceUri) {
+		this.namespaceUri = namespaceUri;
+	}
+
+	/**
+	 * The application name
+	 */
+	public void setApplicationName(final String applicationName) {
+		Objects.requireNonNull(applicationName);
+		this.serverConfig.setApplicationName(LocalizedText.english(applicationName));
+	}
+
+	/**
+	 * The application URI
+	 */
+	public void setApplicationUri(final String applicationUri) {
+		Objects.requireNonNull(applicationUri);
+		this.serverConfig.setApplicationUri(applicationUri);
+	}
+
+	/**
+	 * The product URI
+	 */
+	public void setProductUri(final String productUri) {
+		Objects.requireNonNull(productUri);
+		this.serverConfig.setProductUri(productUri);
+	}
+
+	/**
+	 * The TCP port the server binds to
+	 */
+	public void setBindPort(final int port) {
+		this.serverConfig.setBindPort(port);
+	}
+
+	/**
+	 * Set whether strict endpoint URLs are enforced
+	 */
+	public void setStrictEndpointUrlsEnabled(final boolean strictEndpointUrlsEnforced) {
+		this.serverConfig.setStrictEndpointUrlsEnabled(strictEndpointUrlsEnforced);
+	}
+
+	/**
+	 * Server name
+	 */
+	public void setServerName(final String serverName) {
+		this.serverConfig.setServerName(serverName);
+	}
+
+	/**
+	 * Server hostname
+	 */
+	public void setHostname(final String hostname) {
+		this.serverConfig.setHostname(hostname);
+	}
+
+	/**
+	 * Security policies
+	 */
+	public void setSecurityPolicies(final Set<SecurityPolicy> securityPolicies) {
+		if (securityPolicies == null || securityPolicies.isEmpty()) {
+			this.serverConfig.setSecurityPolicies(EnumSet.noneOf(SecurityPolicy.class));
+		} else {
+			this.serverConfig.setSecurityPolicies(EnumSet.copyOf(securityPolicies));
+		}
+	}
+
+	/**
+	 * Security policies by URI or name
+	 */
+	public void setSecurityPoliciesById(final Collection<String> securityPolicies) {
+		final EnumSet<SecurityPolicy> policies = EnumSet.noneOf(SecurityPolicy.class);
+
+		if (securityPolicies != null) {
+			for (final String policyName : securityPolicies) {
+				final SecurityPolicy policy = SecurityPolicy.fromUriSafe(policyName)
+						.orElseGet(() -> SecurityPolicy.valueOf(policyName));
+				policies.add(policy);
+			}
+		}
+
+		this.serverConfig.setSecurityPolicies(policies);
+	}
+
+	/**
+	 * Security policies by URI or name
+	 */
+	public void setSecurityPoliciesById(final String... ids) {
+		if (ids != null) {
+			setSecurityPoliciesById(Arrays.asList(ids));
+		} else {
+			setSecurityPoliciesById((Collection<String>) null);
+		}
+	}
+
+	/**
+	 * Set user password combinations in the form of "user1:pwd1,user2:pwd2"
+	 * <p>
+	 * Usernames and passwords will be URL decoded
+	 * </p>
+	 */
+	public void setUserAuthenticationCredentials(final String userAuthenticationCredentials) {
+		if (userAuthenticationCredentials != null) {
+			this.userMap = new HashMap<>();
+
+			for (final String creds : userAuthenticationCredentials.split(",")) {
+				final String[] toks = creds.split(":", 2);
+				if (toks.length == 2) {
+					try {
+						this.userMap.put(URLDecoder.decode(toks[0], URL_CHARSET),
+								URLDecoder.decode(toks[1], URL_CHARSET));
+					} catch (final UnsupportedEncodingException e) {
+						// FIXME: do log
+					}
+				}
+			}
+		} else {
+			this.userMap = null;
+		}
+	}
+
+	/**
+	 * Enable anonymous authentication, disabled by default
+	 */
+	public void setEnableAnonymousAuthentication(final boolean enableAnonymousAuthentication) {
+		this.enableAnonymousAuthentication = enableAnonymousAuthentication;
+	}
+
+	/**
+	 * Set the addresses of the local addresses the server should bind to
+	 */
+	public void setBindAddresses(final String bindAddresses) {
+		if (bindAddresses != null) {
+			this.bindAddresses = Arrays.asList(bindAddresses.split(","));
+		} else {
+			this.bindAddresses = null;
+		}
+	}
+
+	/**
+	 * Server build info
+	 */
+	public void setBuildInfo(final BuildInfo buildInfo) {
+		this.serverConfig.setBuildInfo(buildInfo);
+	}
+
+	/**
+	 * Server certificate
+	 */
+	public void setServerCertificate(final KeyStoreLoader.Result result) {
+		/*
+		 * We are not implicitly deactivating the server certificate manager. If
+		 * the key could not be found by the KeyStoreLoader, it will return
+		 * "null" from the load() method.
+		 *
+		 * So if someone calls setServerCertificate ( loader.load () ); he may,
+		 * by accident, disable the server certificate.
+		 *
+		 * If disabling the server certificate is desired, do it explicitly.
+		 */
+		Objects.requireNonNull(result, "Setting a null is not supported. call setCertificateManager(null) instead.)");
+		setServerCertificate(result.getKeyPair(), result.getCertificate());
+	}
+
+	/**
+	 * Server certificate
+	 */
+	public void setServerCertificate(final KeyPair keyPair, final X509Certificate certificate) {
+		setCertificateManager(new DefaultCertificateManager(keyPair, certificate));
+	}
+
+	/**
+	 * Server certificate manager
+	 */
+	public void setCertificateManager(final CertificateManager certificateManager) {
+		if (certificateManager != null) {
+			this.serverConfig.setCertificateManager(certificateManager);
+		} else {
+			this.serverConfig.setCertificateManager(new DefaultCertificateManager());
+		}
+	}
+
+	/**
+	 * Validator for client certificates
+	 */
+	public void setCertificateValidator(final Supplier<CertificateValidator> certificateValidator) {
+		this.certificateValidator = certificateValidator;
+	}
+
+	/**
+	 * Validator for client certificates using default file based approach
+	 */
+	public void setDefaultCertificateValidator(final File certificatesBaseDir) {
+		this.certificateValidator = () -> new DefaultCertificateValidator(certificatesBaseDir);
+	}
+
+	/**
+	 * Validator for client certificates using default file based approach
+	 */
+	public void setDefaultCertificateExistingValidator(final File trustedDir) {
+		throw new UnsupportedOperationException("Can be implemented after fix in upstream");
+
+		/*
+		 * checkDispose(this.certificateValidator);
+		 *
+		 * this.certificateValidator = new
+		 * DefaultCertificateValidator(trustedDir, null, null);
+		 * this.serverConfig.setCertificateValidator(this.certificateValidator);
+		 */
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
new file mode 100644
index 0000000..e641ea5
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.server;
+
+import java.util.function.Consumer;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.milo.Messages;
+import org.apache.camel.component.milo.server.internal.CamelServerItem;
+import org.apache.camel.impl.DefaultConsumer;
+import org.apache.camel.impl.DefaultMessage;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+
+class MiloServerConsumer extends DefaultConsumer {
+
+	private final CamelServerItem item;
+	private final Consumer<DataValue> writeHandler = this::performWrite;
+
+	public MiloServerConsumer(final Endpoint endpoint, final Processor processor, final CamelServerItem item) {
+		super(endpoint, processor);
+		this.item = item;
+	}
+
+	@Override
+	protected void doStart() throws Exception {
+		super.doStart();
+
+		this.item.addWriteListener(this.writeHandler);
+	}
+
+	@Override
+	protected void doStop() throws Exception {
+		this.item.removeWriteListener(this.writeHandler);
+
+		super.doStop();
+	}
+
+	protected void performWrite(final DataValue value) {
+
+		final Exchange exchange = getEndpoint().createExchange();
+		exchange.setIn(mapToMessage(value));
+
+		try {
+			getAsyncProcessor().process(exchange);
+		} catch (final Exception e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	private DefaultMessage mapToMessage(final DataValue value) {
+		if (value == null) {
+			return null;
+		}
+
+		final DefaultMessage result = new DefaultMessage();
+
+		Messages.fillFromDataValue(value, result);
+
+		return result;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
new file mode 100644
index 0000000..dec28aa
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.server;
+
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.component.milo.server.internal.CamelNamespace;
+import org.apache.camel.component.milo.server.internal.CamelServerItem;
+import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriPath;
+
+/**
+ * OPC UA Server based endpoint
+ */
+@UriEndpoint(scheme = "milo-server", syntax = "milo-server:itemId[?options]", title = "OPC UA Server", consumerClass = MiloServerConsumer.class, label = "iot")
+class MiloServerEndpoint extends DefaultEndpoint {
+
+	@UriPath
+	@Metadata(required = "true")
+	private String itemId;
+
+	private final CamelNamespace namespace;
+
+	private CamelServerItem item;
+
+	public MiloServerEndpoint(final String uri, final String itemId, final CamelNamespace namespace,
+			final Component component) {
+		super(uri, component);
+		this.itemId = itemId;
+		this.namespace = namespace;
+	}
+
+	@Override
+	protected void doStart() throws Exception {
+		super.doStart();
+		this.item = this.namespace.getOrAddItem(this.itemId);
+	}
+
+	@Override
+	protected void doStop() throws Exception {
+		if (this.item != null) {
+			this.item.dispose();
+			this.item = null;
+		}
+		super.doStop();
+	}
+
+	@Override
+	protected void doShutdown() throws Exception {
+		// FIXME: need to call back to component?
+		super.doShutdown();
+	}
+
+	@Override
+	public Producer createProducer() throws Exception {
+		return new MiloServerProducer(this, this.item);
+	}
+
+	@Override
+	public Consumer createConsumer(final Processor processor) throws Exception {
+		return new MiloServerConsumer(this, processor, this.item);
+	}
+
+	@Override
+	public boolean isSingleton() {
+		return true;
+	}
+
+	/**
+	 * ID of the item
+	 *
+	 * @param itemId
+	 *            the new ID of the item
+	 */
+	public void setItemId(final String itemId) {
+		this.itemId = itemId;
+	}
+
+	/**
+	 * Get the ID of the item
+	 *
+	 * @return the ID of the item
+	 */
+	public String getItemId() {
+		return this.itemId;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
new file mode 100644
index 0000000..4b2724b
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.server;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.milo.server.internal.CamelServerItem;
+import org.apache.camel.impl.DefaultProducer;
+
+class MiloServerProducer extends DefaultProducer {
+
+	private final CamelServerItem item;
+
+	public MiloServerProducer(final Endpoint endpoint, final CamelServerItem item) {
+		super(endpoint);
+		this.item = item;
+	}
+
+	@Override
+	public void process(final Exchange exchange) throws Exception {
+		final Object value = exchange.getIn().getBody();
+		this.item.update(value);
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
new file mode 100644
index 0000000..2a094cd
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.server.internal;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+import org.apache.camel.component.milo.client.MiloClientConsumer;
+import org.eclipse.milo.opcua.sdk.core.Reference;
+import org.eclipse.milo.opcua.sdk.server.OpcUaServer;
+import org.eclipse.milo.opcua.sdk.server.api.AccessContext;
+import org.eclipse.milo.opcua.sdk.server.api.DataItem;
+import org.eclipse.milo.opcua.sdk.server.api.MonitoredItem;
+import org.eclipse.milo.opcua.sdk.server.api.Namespace;
+import org.eclipse.milo.opcua.sdk.server.api.ServerNodeMap;
+import org.eclipse.milo.opcua.sdk.server.nodes.AttributeContext;
+import org.eclipse.milo.opcua.sdk.server.nodes.ServerNode;
+import org.eclipse.milo.opcua.sdk.server.nodes.UaFolderNode;
+import org.eclipse.milo.opcua.sdk.server.nodes.UaObjectNode;
+import org.eclipse.milo.opcua.sdk.server.util.SubscriptionModel;
+import org.eclipse.milo.opcua.stack.core.Identifiers;
+import org.eclipse.milo.opcua.stack.core.StatusCodes;
+import org.eclipse.milo.opcua.stack.core.UaException;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
+import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
+import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
+import org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode;
+import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort;
+import org.eclipse.milo.opcua.stack.core.types.enumerated.NodeClass;
+import org.eclipse.milo.opcua.stack.core.types.enumerated.TimestampsToReturn;
+import org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId;
+import org.eclipse.milo.opcua.stack.core.types.structured.WriteValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Lists;
+
+public class CamelNamespace implements Namespace {
+
+	private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);
+
+	private final UShort namespaceIndex;
+
+	private final String namespaceUri;
+
+	private final ServerNodeMap nodeManager;
+	private final SubscriptionModel subscriptionModel;
+
+	private final UaFolderNode folder;
+	private final UaObjectNode itemsObject;
+
+	private final Map<String, CamelServerItem> itemMap = new HashMap<>();
+
+	public CamelNamespace(final UShort namespaceIndex, final String namespaceUri, final OpcUaServer server) {
+		this.namespaceIndex = namespaceIndex;
+		this.namespaceUri = namespaceUri;
+
+		this.nodeManager = server.getNodeMap();
+		this.subscriptionModel = new SubscriptionModel(server, this);
+
+		// create structure
+
+		{
+			final NodeId nodeId = new NodeId(namespaceIndex, "camel");
+			final QualifiedName name = new QualifiedName(namespaceIndex, "camel");
+			final LocalizedText displayName = LocalizedText.english("Camel");
+
+			this.folder = new UaFolderNode(this.nodeManager, nodeId, name, displayName);
+			this.nodeManager.addNode(this.folder);
+		}
+
+		{
+			final NodeId nodeId = new NodeId(namespaceIndex, "items");
+			final QualifiedName name = new QualifiedName(namespaceIndex, "items");
+			final LocalizedText displayName = LocalizedText.english("Items");
+			this.itemsObject = new UaObjectNode(this.nodeManager, nodeId, name, displayName);
+			this.folder.addComponent(this.itemsObject);
+		}
+
+		// register reference to structure
+
+		try {
+			server.getUaNamespace().addReference(Identifiers.ObjectsFolder, Identifiers.Organizes, true,
+					this.folder.getNodeId().expanded(), NodeClass.Object);
+		} catch (final UaException e) {
+			throw new RuntimeException("Failed to register folder", e);
+		}
+	}
+
+	@Override
+	public UShort getNamespaceIndex() {
+		return this.namespaceIndex;
+	}
+
+	@Override
+	public String getNamespaceUri() {
+		return this.namespaceUri;
+	}
+
+	@Override
+	public CompletableFuture<List<Reference>> browse(final AccessContext context, final NodeId nodeId) {
+		final ServerNode node = this.nodeManager.get(nodeId);
+
+		if (node != null) {
+			return CompletableFuture.completedFuture(node.getReferences());
+		} else {
+			final CompletableFuture<List<Reference>> f = new CompletableFuture<>();
+			f.completeExceptionally(new UaException(StatusCodes.Bad_NodeIdUnknown));
+			return f;
+		}
+	}
+
+	@Override
+	public void read(final ReadContext context, final Double maxAge, final TimestampsToReturn timestamps,
+			final List<ReadValueId> readValueIds) {
+		final List<DataValue> results = Lists.newArrayListWithCapacity(readValueIds.size());
+
+		for (final ReadValueId id : readValueIds) {
+			final ServerNode node = this.nodeManager.get(id.getNodeId());
+
+			final DataValue value;
+
+			if (node != null) {
+				value = node.readAttribute(new AttributeContext(context), id.getAttributeId(), timestamps,
+						id.getIndexRange());
+			} else {
+				value = new DataValue(StatusCodes.Bad_NodeIdUnknown);
+			}
+
+			results.add(value);
+		}
+
+		context.complete(results);
+	}
+
+	@Override
+	public void write(final WriteContext context, final List<WriteValue> writeValues) {
+		final List<StatusCode> results = Lists.newArrayListWithCapacity(writeValues.size());
+
+		for (final WriteValue writeValue : writeValues) {
+			try {
+				final ServerNode node = this.nodeManager.getNode(writeValue.getNodeId())
+						.orElseThrow(() -> new UaException(StatusCodes.Bad_NodeIdUnknown));
+
+				node.writeAttribute(new AttributeContext(context), writeValue.getAttributeId(), writeValue.getValue(),
+						writeValue.getIndexRange());
+
+				if (LOG.isTraceEnabled()) {
+					final Variant variant = writeValue.getValue().getValue();
+					final Object o = variant != null ? variant.getValue() : null;
+					LOG.trace("Wrote value={} to attributeId={} of {}", o, writeValue.getAttributeId(),
+							writeValue.getNodeId());
+				}
+
+				results.add(StatusCode.GOOD);
+			} catch (final UaException e) {
+				results.add(e.getStatusCode());
+			}
+		}
+
+		context.complete(results);
+	}
+
+	@Override
+	public void onDataItemsCreated(final List<DataItem> dataItems) {
+		this.subscriptionModel.onDataItemsCreated(dataItems);
+	}
+
+	@Override
+	public void onDataItemsModified(final List<DataItem> dataItems) {
+		this.subscriptionModel.onDataItemsModified(dataItems);
+	}
+
+	@Override
+	public void onDataItemsDeleted(final List<DataItem> dataItems) {
+		this.subscriptionModel.onDataItemsDeleted(dataItems);
+	}
+
+	@Override
+	public void onMonitoringModeChanged(final List<MonitoredItem> monitoredItems) {
+		this.subscriptionModel.onMonitoringModeChanged(monitoredItems);
+	}
+
+	public CamelServerItem getOrAddItem(final String itemId) {
+		synchronized (this) {
+			CamelServerItem item = this.itemMap.get(itemId);
+			if (item == null) {
+				item = new CamelServerItem(itemId, this.nodeManager, this.namespaceIndex, this.itemsObject);
+				this.itemMap.put(itemId, item);
+			}
+			return item;
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
new file mode 100644
index 0000000..3a23aee
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.server.internal;
+
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ubyte;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.function.Consumer;
+
+import org.eclipse.milo.opcua.sdk.core.AccessLevel;
+import org.eclipse.milo.opcua.sdk.server.api.ServerNodeMap;
+import org.eclipse.milo.opcua.sdk.server.nodes.UaObjectNode;
+import org.eclipse.milo.opcua.sdk.server.nodes.UaVariableNode;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DateTime;
+import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
+import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
+import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
+import org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode;
+import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CamelServerItem {
+	private static final Logger LOG = LoggerFactory.getLogger(CamelServerItem.class);
+
+	private UaObjectNode baseNode;
+	private UaVariableNode item;
+
+	private DataValue value = new DataValue(StatusCode.BAD);
+	private final Set<Consumer<DataValue>> listeners = new CopyOnWriteArraySet<>();
+
+	public CamelServerItem(final String itemId, final ServerNodeMap nodeManager, final UShort namespaceIndex,
+			final UaObjectNode baseNode) {
+
+		this.baseNode = baseNode;
+
+		final NodeId nodeId = new NodeId(namespaceIndex, "items-" + itemId);
+		final QualifiedName qname = new QualifiedName(namespaceIndex, itemId);
+		final LocalizedText displayName = LocalizedText.english(itemId);
+
+		// create variable node
+
+		this.item = new UaVariableNode(nodeManager, nodeId, qname, displayName) {
+
+			@Override
+			public DataValue getValue() {
+				return getDataValue();
+			}
+
+			@Override
+			public synchronized void setValue(final DataValue value) {
+				setDataValue(value);
+			}
+
+		};
+
+		// item.setDataType();
+		this.item.setAccessLevel(ubyte(AccessLevel.getMask(AccessLevel.READ_WRITE)));
+		this.item.setUserAccessLevel(ubyte(AccessLevel.getMask(AccessLevel.READ_WRITE)));
+
+		baseNode.addComponent(this.item);
+	}
+
+	public void dispose() {
+		this.baseNode.removeComponent(this.item);
+		this.listeners.clear();
+	}
+
+	public void addWriteListener(final Consumer<DataValue> consumer) {
+		this.listeners.add(consumer);
+	}
+
+	public void removeWriteListener(final Consumer<DataValue> consumer) {
+		this.listeners.remove(consumer);
+	}
+
+	protected void setDataValue(final DataValue value) {
+		LOG.debug("setValue -> {}", value);
+		runThrough(this.listeners, c -> c.accept(value));
+	}
+
+	/**
+	 * Run through a list, aggregating errors
+	 *
+	 * <p>
+	 * The consumer is called for each list item, regardless if the consumer did
+	 * through an exception. All exceptions are caught and thrown in one
+	 * RuntimeException. The first exception being wrapped directly while the
+	 * latter ones, if any, are added as suppressed exceptions.
+	 * </p>
+	 *
+	 * @param list
+	 *            the list to run through
+	 * @param consumer
+	 *            the consumer processing list elements
+	 */
+	protected <T> void runThrough(final Collection<Consumer<T>> list, final Consumer<Consumer<T>> consumer) {
+		LinkedList<Throwable> errors = null;
+
+		for (final Consumer<T> listener : list) {
+			try {
+				consumer.accept(listener);
+			} catch (final Throwable e) {
+				if (errors == null) {
+					errors = new LinkedList<>();
+				}
+				errors.add(e);
+			}
+		}
+
+		if (errors == null || errors.isEmpty()) {
+			return;
+		}
+
+		final RuntimeException ex = new RuntimeException(errors.pollFirst());
+		errors.forEach(ex::addSuppressed);
+		throw ex;
+	}
+
+	protected DataValue getDataValue() {
+		return this.value;
+	}
+
+	public void update(final Object value) {
+		this.value = new DataValue(new Variant(value), StatusCode.GOOD, DateTime.now());
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/package-info.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/package-info.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/package-info.java
new file mode 100644
index 0000000..5469d8f
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Server functionality
+ */
+package org.apache.camel.component.milo.server;

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/resources/META-INF/LICENSE.txt
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/resources/META-INF/LICENSE.txt b/components/camel-milo/src/main/resources/META-INF/LICENSE.txt
new file mode 100755
index 0000000..6b0b127
--- /dev/null
+++ b/components/camel-milo/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/resources/META-INF/NOTICE.txt
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/resources/META-INF/NOTICE.txt b/components/camel-milo/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/components/camel-milo/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+   =========================================================================
+   ==  NOTICE file corresponding to the section 4 d of                    ==
+   ==  the Apache License, Version 2.0,                                   ==
+   ==  in this case for the Apache Camel distribution.                    ==
+   =========================================================================
+
+   This product includes software developed by
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Please read the different LICENSE files present in the licenses directory of
+   this distribution.

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/TypeConverter b/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
new file mode 100644
index 0000000..57fb90f
--- /dev/null
+++ b/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
@@ -0,0 +1 @@
+org.apache.camel.component.milo.converter
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/component/milo-client
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/component/milo-client b/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/component/milo-client
new file mode 100644
index 0000000..17dec7a
--- /dev/null
+++ b/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/component/milo-client
@@ -0,0 +1 @@
+class=org.apache.camel.component.milo.client.MiloClientComponent
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/component/milo-server
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/component/milo-server b/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/component/milo-server
new file mode 100644
index 0000000..aa7ae63
--- /dev/null
+++ b/components/camel-milo/src/main/resources/META-INF/services/org/apache/camel/component/milo-server
@@ -0,0 +1 @@
+class=org.apache.camel.component.milo.server.MiloServerComponent
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
new file mode 100644
index 0000000..818b36d
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.function.Consumer;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.milo.server.MiloServerComponent;
+import org.apache.camel.component.mock.AssertionClause;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+
+public abstract class AbstractMiloServerTest extends CamelTestSupport {
+
+	public static void testBody(final AssertionClause clause, final Consumer<DataValue> valueConsumer) {
+		testBody(clause, DataValue.class, valueConsumer);
+	}
+
+	public static <T> void testBody(final AssertionClause clause, final Class<T> bodyClass,
+			final Consumer<T> valueConsumer) {
+		clause.predicate(exchange -> {
+			final T body = exchange.getIn().getBody(bodyClass);
+			valueConsumer.accept(body);
+			return true;
+		});
+	}
+
+	public static Consumer<DataValue> assertGoodValue(final Object expectedValue) {
+		return value -> {
+			assertNotNull(value);
+			assertEquals(expectedValue, value.getValue().getValue());
+			assertTrue(value.getStatusCode().isGood());
+			assertFalse(value.getStatusCode().isBad());
+		};
+	}
+
+	@Override
+	protected CamelContext createCamelContext() throws Exception {
+		final CamelContext context = super.createCamelContext();
+		configureContext(context);
+		return context;
+	}
+
+	protected void configureContext(final CamelContext context) throws Exception {
+		final MiloServerComponent server = context.getComponent("milo-server", MiloServerComponent.class);
+		configureMiloServer(server);
+	}
+
+	protected void configureMiloServer(final MiloServerComponent server) throws Exception {
+		server.setBindAddresses("localhost");
+		server.setBindPort(12685);
+		server.setUserAuthenticationCredentials("foo:bar,foo2:bar2");
+	}
+
+	/**
+	 * Create a default key store for testing
+	 *
+	 * @return always returns a key store
+	 */
+	protected KeyStoreLoader.Result loadDefaultTestKey() {
+		try {
+
+			final KeyStoreLoader loader = new KeyStoreLoader();
+			loader.setUrl("file:src/test/resources/cert/cert.p12");
+			loader.setKeyStorePassword("pwd1");
+			loader.setKeyPassword("pwd1");
+			return loader.load();
+		} catch (final GeneralSecurityException | IOException e) {
+			throw new RuntimeException(e);
+		}
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
new file mode 100644
index 0000000..aecc2ec
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo;
+
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.milo.server.MiloServerComponent;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+/**
+ * Testing monitoring items over multiple connections
+ */
+public class MonitorItemMultiConnectionsCertTest extends AbstractMiloServerTest {
+
+	private static final String DIRECT_START_1 = "direct:start1";
+
+	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
+
+	// with key
+	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?nodeId=items-myitem1&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI
+			+ "&keyStoreUrl=file:src/test/resources/cert/cert.p12&keyStorePassword=pwd1&keyPassword=pwd1";
+
+	// with wrong password
+	private static final String MILO_CLIENT_ITEM_C2_1 = "milo-client:tcp://foo:bar2@localhost:12685?nodeId=items-myitem1&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+
+	// without key, clientId=1
+	private static final String MILO_CLIENT_ITEM_C3_1 = "milo-client:tcp://foo:bar@localhost:12685?clientId=1&nodeId=items-myitem1&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+
+	private static final String MOCK_TEST_1 = "mock:test1";
+	private static final String MOCK_TEST_2 = "mock:test2";
+	private static final String MOCK_TEST_3 = "mock:test3";
+
+	@EndpointInject(uri = MOCK_TEST_1)
+	protected MockEndpoint test1Endpoint;
+
+	@EndpointInject(uri = MOCK_TEST_2)
+	protected MockEndpoint test2Endpoint;
+
+	@EndpointInject(uri = MOCK_TEST_3)
+	protected MockEndpoint test3Endpoint;
+
+	@Produce(uri = DIRECT_START_1)
+	protected ProducerTemplate producer1;
+
+	@Override
+	protected void configureMiloServer(final MiloServerComponent server) throws Exception {
+		super.configureMiloServer(server);
+
+		final Path baseDir = Paths.get("target/testing/cert/default");
+		final Path trusted = baseDir.resolve("trusted");
+
+		Files.createDirectories(trusted);
+		Files.copy(Paths.get("src/test/resources/cert/certificate.der"), trusted.resolve("certificate.der"),
+				REPLACE_EXISTING);
+
+		server.setServerCertificate(loadDefaultTestKey());
+		server.setDefaultCertificateValidator(baseDir.toFile());
+	}
+
+	@Override
+	protected RoutesBuilder createRouteBuilder() throws Exception {
+		return new RouteBuilder() {
+			@Override
+			public void configure() throws Exception {
+				from(DIRECT_START_1).to(MILO_SERVER_ITEM_1);
+
+				from(MILO_CLIENT_ITEM_C1_1).to(MOCK_TEST_1);
+				from(MILO_CLIENT_ITEM_C2_1).to(MOCK_TEST_2);
+				from(MILO_CLIENT_ITEM_C3_1).to(MOCK_TEST_3);
+			}
+		};
+	}
+
+	/**
+	 * Monitor multiple connections, but only one has the correct credentials
+	 */
+	@Test
+	public void testMonitorItem1() throws Exception {
+		// set server value
+		this.producer1.sendBody("Foo");
+
+		// item 1 ... only this one receives
+		this.test1Endpoint.setExpectedCount(1);
+		this.test1Endpoint.setSleepForEmptyTest(5_000);
+
+		// item 2
+		this.test2Endpoint.setExpectedCount(0);
+		this.test2Endpoint.setSleepForEmptyTest(5_000);
+
+		// item 3
+		this.test3Endpoint.setExpectedCount(0);
+		this.test3Endpoint.setSleepForEmptyTest(5_000);
+
+		// assert
+		this.assertMockEndpointsSatisfied();
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
new file mode 100644
index 0000000..01c09a9
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.milo.server.MiloServerComponent;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+/**
+ * Testing monitoring items over multiple connections
+ */
+public class MonitorItemMultiConnectionsTest extends AbstractMiloServerTest {
+
+	private static final String DIRECT_START_1 = "direct:start1";
+
+	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
+
+	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?nodeId=items-myitem1&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+
+	private static final String MILO_CLIENT_ITEM_C2_1 = "milo-client:tcp://foo:bar2@localhost:12685?nodeId=items-myitem1&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+
+	private static final String MILO_CLIENT_ITEM_C3_1 = "milo-client:tcp://foo2:bar@localhost:12685?nodeId=items-myitem1&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+
+	private static final String MOCK_TEST_1 = "mock:test1";
+	private static final String MOCK_TEST_2 = "mock:test2";
+	private static final String MOCK_TEST_3 = "mock:test3";
+
+	@EndpointInject(uri = MOCK_TEST_1)
+	protected MockEndpoint test1Endpoint;
+
+	@EndpointInject(uri = MOCK_TEST_2)
+	protected MockEndpoint test2Endpoint;
+
+	@EndpointInject(uri = MOCK_TEST_3)
+	protected MockEndpoint test3Endpoint;
+
+	@Produce(uri = DIRECT_START_1)
+	protected ProducerTemplate producer1;
+
+	@Override
+	protected RoutesBuilder createRouteBuilder() throws Exception {
+		return new RouteBuilder() {
+			@Override
+			public void configure() throws Exception {
+				from(DIRECT_START_1).to(MILO_SERVER_ITEM_1);
+
+				from(MILO_CLIENT_ITEM_C1_1).to(MOCK_TEST_1);
+				from(MILO_CLIENT_ITEM_C2_1).to(MOCK_TEST_2);
+				from(MILO_CLIENT_ITEM_C3_1).to(MOCK_TEST_3);
+			}
+		};
+	}
+
+	/**
+	 * Monitor multiple connections, but only one has the correct credentials
+	 */
+	@Test
+	public void testMonitorItem1() throws Exception {
+		// set server value
+		this.producer1.sendBody("Foo");
+
+		// item 1 ... only this one receives
+		this.test1Endpoint.setExpectedCount(1);
+		this.test1Endpoint.setSleepForEmptyTest(5_000);
+
+		// item 2
+		this.test2Endpoint.setExpectedCount(0);
+		this.test2Endpoint.setSleepForEmptyTest(5_000);
+
+		// item 3
+		this.test3Endpoint.setExpectedCount(0);
+		this.test3Endpoint.setSleepForEmptyTest(5_000);
+
+		// assert
+		this.assertMockEndpointsSatisfied();
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
new file mode 100644
index 0000000..05ae003
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.milo.server.MiloServerComponent;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+/**
+ * Testing the monitor functionality for item
+ */
+public class MonitorItemTest extends AbstractMiloServerTest {
+
+	private static final String DIRECT_START_1 = "direct:start1";
+
+	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
+
+	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?nodeId=items-myitem1&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+
+	private static final String MOCK_TEST_1 = "mock:test1";
+
+	@EndpointInject(uri = MOCK_TEST_1)
+	protected MockEndpoint test1Endpoint;
+
+	@Produce(uri = DIRECT_START_1)
+	protected ProducerTemplate producer1;
+
+	@Override
+	protected RoutesBuilder createRouteBuilder() throws Exception {
+		return new RouteBuilder() {
+			@Override
+			public void configure() throws Exception {
+				from(DIRECT_START_1).to(MILO_SERVER_ITEM_1);
+
+				from(MILO_CLIENT_ITEM_C1_1).to(MOCK_TEST_1);
+			}
+		};
+	}
+
+	/**
+	 * Monitor multiple events
+	 */
+	@Test
+	public void testMonitorItem1() throws Exception {
+		/*
+		 * we will wait 2 * 1_000 milliseconds between server updates since the
+		 * default server update rate is 1_000 milliseconds
+		 */
+
+		// set server values
+		this.producer1.sendBody("Foo");
+		Thread.sleep(2_000);
+		this.producer1.sendBody("Bar");
+		Thread.sleep(2_000);
+		this.producer1.sendBody("Baz");
+		Thread.sleep(2_000);
+
+		// item 1 ... only this one receives
+		this.test1Endpoint.setExpectedCount(3);
+
+		// tests
+		testBody(this.test1Endpoint.message(0), assertGoodValue("Foo"));
+		testBody(this.test1Endpoint.message(1), assertGoodValue("Bar"));
+		testBody(this.test1Endpoint.message(2), assertGoodValue("Baz"));
+
+		// assert
+		this.assertMockEndpointsSatisfied();
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
new file mode 100644
index 0000000..2bb9e08
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo;
+
+import static com.google.common.net.UrlEscapers.urlFormParameterEscaper;
+import static org.apache.camel.component.milo.server.MiloServerComponent.DEFAULT_NAMESPACE_URI;
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ushort;
+
+import java.io.Serializable;
+
+import org.apache.camel.ResolveEndpointFailedException;
+import org.apache.camel.component.milo.client.MiloClientEndpoint;
+import org.junit.Test;
+
+/**
+ * Testing different ways to specify node IDs
+ */
+public class NodeIdTest extends AbstractMiloServerTest {
+
+	@Test
+	public void testLegacy() {
+		testUri("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-myitem1&namespaceUri=" + DEFAULT_NAMESPACE_URI,
+				DEFAULT_NAMESPACE_URI, "items-myitem1");
+		testUri("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-myitem1&namespaceIndex=1", ushort(1),
+				"items-myitem1");
+	}
+
+	@Test
+	public void testFull1() {
+		final String s = String.format("nsu=%s;s=%s", DEFAULT_NAMESPACE_URI, "item-1");
+		testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=RAW(" + s + ")",
+				DEFAULT_NAMESPACE_URI, "item-1");
+	}
+
+	@Test
+	public void testFull2() {
+		final String s = String.format("ns=%s;s=%s", 1, "item-1");
+		testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=RAW(" + s + ")", ushort(1),
+				"item-1");
+	}
+
+	@Test
+	public void testFull3() {
+		final String s = String.format("ns=%s;i=%s", 1, 2);
+		testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=RAW(" + s + ")", ushort(1),
+				uint(2));
+	}
+
+	@Test
+	public void testFull1NonRaw() {
+		final String s = String.format("ns=%s;i=%s", 1, 2);
+		testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node="
+				+ urlFormParameterEscaper().escape(s), ushort(1), uint(2));
+	}
+
+	@Test
+	public void testDocURL() {
+		testUri("milo-client://user:password@localhost:12345?node=RAW(nsu=http://foo.bar;s=foo/bar)", "http://foo.bar",
+				"foo/bar");
+	}
+
+	@Test(expected = ResolveEndpointFailedException.class)
+	public void testMixed() {
+		// This must fail since "node" is incomplete
+		testUri("milo-client:tcp://foo:bar@localhost:12685?node=foo&namespaceUri=" + DEFAULT_NAMESPACE_URI, null, null);
+	}
+
+	private void testUri(final String uri, final Serializable namespace, final Serializable partialNodeId) {
+		assertNodeId(getMandatoryEndpoint(uri, MiloClientEndpoint.class), namespace, partialNodeId);
+	}
+
+	private void assertNodeId(final MiloClientEndpoint endpoint, final Serializable namespace,
+			final Serializable partialNodeId) {
+
+		final NamespaceId ns = endpoint.makeNamespaceId();
+		final PartialNodeId pn = endpoint.makePartialNodeId();
+
+		assertNotNull(ns);
+		assertNotNull(pn);
+
+		assertEquals(namespace, ns.getValue());
+		assertEquals(partialNodeId, pn.getValue());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
new file mode 100644
index 0000000..40c85e5
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.milo.server.MiloServerComponent;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
+import org.junit.Test;
+
+/**
+ * Unit tests for writing from the client side
+ */
+public class WriteClientTest extends AbstractMiloServerTest {
+
+	private static final String DIRECT_START_1 = "direct:start1";
+	private static final String DIRECT_START_2 = "direct:start2";
+	private static final String DIRECT_START_3 = "direct:start3";
+	private static final String DIRECT_START_4 = "direct:start4";
+
+	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
+	private static final String MILO_SERVER_ITEM_2 = "milo-server:myitem2";
+
+	private static final String MILO_CLIENT_BASE_C1 = "milo-client:tcp://foo:bar@localhost:12685";
+	private static final String MILO_CLIENT_BASE_C2 = "milo-client:tcp://foo2:bar2@localhost:12685";
+
+	private static final String MILO_CLIENT_ITEM_C1_1 = MILO_CLIENT_BASE_C1 + "?nodeId=items-myitem1&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+	private static final String MILO_CLIENT_ITEM_C1_2 = MILO_CLIENT_BASE_C1 + "?nodeId=items-myitem2&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+
+	private static final String MILO_CLIENT_ITEM_C2_1 = MILO_CLIENT_BASE_C2 + "?nodeId=items-myitem1&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+	private static final String MILO_CLIENT_ITEM_C2_2 = MILO_CLIENT_BASE_C2 + "?nodeId=items-myitem2&namespaceUri="
+			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+
+	private static final String MOCK_TEST_1 = "mock:test1";
+	private static final String MOCK_TEST_2 = "mock:test2";
+
+	@EndpointInject(uri = MOCK_TEST_1)
+	protected MockEndpoint test1Endpoint;
+
+	@EndpointInject(uri = MOCK_TEST_2)
+	protected MockEndpoint test2Endpoint;
+
+	@Produce(uri = DIRECT_START_1)
+	protected ProducerTemplate producer1;
+
+	@Produce(uri = DIRECT_START_2)
+	protected ProducerTemplate producer2;
+
+	@Produce(uri = DIRECT_START_3)
+	protected ProducerTemplate producer3;
+
+	@Produce(uri = DIRECT_START_4)
+	protected ProducerTemplate producer4;
+
+	@Override
+	protected RoutesBuilder createRouteBuilder() throws Exception {
+		return new RouteBuilder() {
+			@Override
+			public void configure() throws Exception {
+
+				from(MILO_SERVER_ITEM_1).to(MOCK_TEST_1);
+				from(MILO_SERVER_ITEM_2).to(MOCK_TEST_2);
+
+				from(DIRECT_START_1).to(MILO_CLIENT_ITEM_C1_1);
+				from(DIRECT_START_2).to(MILO_CLIENT_ITEM_C1_2);
+
+				from(DIRECT_START_3).to(MILO_CLIENT_ITEM_C2_1);
+				from(DIRECT_START_4).to(MILO_CLIENT_ITEM_C2_2);
+			}
+		};
+	}
+
+	@Test
+	public void testWrite1() throws Exception {
+		// item 1
+		this.test1Endpoint.setExpectedCount(2);
+		testBody(this.test1Endpoint.message(0), assertGoodValue("Foo1"));
+		testBody(this.test1Endpoint.message(1), assertGoodValue("Foo2"));
+
+		// item 2
+		this.test2Endpoint.setExpectedCount(0);
+
+		// send
+		sendValue(this.producer1, new Variant("Foo1"));
+		sendValue(this.producer1, new Variant("Foo2"));
+
+		// assert
+		this.assertMockEndpointsSatisfied();
+	}
+
+	@Test
+	public void testWrite2() throws Exception {
+		// item 1
+		this.test1Endpoint.setExpectedCount(0);
+
+		// item 2
+		this.test2Endpoint.setExpectedCount(2);
+		testBody(this.test2Endpoint.message(0), assertGoodValue("Foo1"));
+		testBody(this.test2Endpoint.message(1), assertGoodValue("Foo2"));
+
+		// send
+		sendValue(this.producer2, new Variant("Foo1"));
+		sendValue(this.producer2, new Variant("Foo2"));
+
+		// assert
+		this.assertMockEndpointsSatisfied();
+	}
+
+	@Test
+	public void testWrite3() throws Exception {
+		// item 1
+		this.test1Endpoint.setExpectedCount(2);
+		testBody(this.test1Endpoint.message(0), assertGoodValue("Foo1"));
+		testBody(this.test1Endpoint.message(1), assertGoodValue("Foo3"));
+
+		// item 1
+		this.test2Endpoint.setExpectedCount(2);
+		testBody(this.test2Endpoint.message(0), assertGoodValue("Foo2"));
+		testBody(this.test2Endpoint.message(1), assertGoodValue("Foo4"));
+
+		// send
+		sendValue(this.producer1, new Variant("Foo1"));
+		sendValue(this.producer2, new Variant("Foo2"));
+		sendValue(this.producer3, new Variant("Foo3"));
+		sendValue(this.producer4, new Variant("Foo4"));
+
+		// assert
+		assertMockEndpointsSatisfied();
+	}
+
+	private static void sendValue(final ProducerTemplate producerTemplate, final Variant variant) {
+		// we always write synchronously since we do need the message order
+		producerTemplate.sendBodyAndHeader(variant, "await", true);
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
new file mode 100644
index 0000000..bef67aa
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.converter;
+
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ConverterTest extends CamelTestSupport {
+
+	@Test
+	public void testDataValueToVariant() {
+		final Variant value = testConvertDataValue("Foo", Variant.class);
+		Assert.assertNotNull(value);
+		Assert.assertEquals("Foo", value.getValue());
+	}
+
+	@Test
+	public void testVariantToDataValue() {
+		final DataValue value = testConvert(new Variant("Foo"), DataValue.class);
+		Assert.assertNotNull(value);
+		Assert.assertEquals("Foo", value.getValue().getValue());
+		Assert.assertTrue(value.getStatusCode().isGood());
+	}
+
+	private <T> T testConvert(final Object value, final Class<T> clazz) {
+		return this.context.getTypeConverter().convertTo(clazz, value);
+	}
+
+	private <T> T testConvertDataValue(final Object value, final Class<T> clazz) {
+		return this.context.getTypeConverter().convertTo(clazz, new DataValue(new Variant(value)));
+	}
+}


[06/18] camel git commit: Update copyright header

Posted by ac...@apache.org.
Update copyright header


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bc7974de
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bc7974de
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bc7974de

Branch: refs/heads/master
Commit: bc7974decc1cad14ba5b833ea69b2140bab5fd38
Parents: 7b3837f
Author: Jens Reimann <jr...@redhat.com>
Authored: Mon Apr 10 15:51:56 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:26 2017 +0200

----------------------------------------------------------------------
 .../apache/camel/component/milo/KeyStoreLoader.java | 16 ++++++++--------
 .../org/apache/camel/component/milo/Messages.java   | 16 ++++++++--------
 .../apache/camel/component/milo/NamespaceId.java    | 16 ++++++++--------
 .../apache/camel/component/milo/PartialNodeId.java  | 16 ++++++++--------
 .../component/milo/client/MiloClientComponent.java  | 16 ++++++++--------
 .../milo/client/MiloClientConfiguration.java        | 16 ++++++++--------
 .../component/milo/client/MiloClientConnection.java | 16 ++++++++--------
 .../component/milo/client/MiloClientConsumer.java   | 16 ++++++++--------
 .../component/milo/client/MiloClientEndpoint.java   | 16 ++++++++--------
 .../milo/client/MiloClientItemConfiguration.java    | 16 ++++++++--------
 .../component/milo/client/MiloClientProducer.java   | 16 ++++++++--------
 .../milo/client/internal/SubscriptionManager.java   | 16 ++++++++--------
 .../camel/component/milo/client/package-info.java   | 16 ++++++++--------
 .../component/milo/converter/ValueConverter.java    | 16 ++++++++--------
 .../component/milo/converter/package-info.java      | 16 ++++++++++++++++
 .../apache/camel/component/milo/package-info.java   | 16 ++++++++--------
 .../component/milo/server/MiloServerComponent.java  | 16 ++++++++--------
 .../component/milo/server/MiloServerConsumer.java   | 16 ++++++++--------
 .../component/milo/server/MiloServerEndpoint.java   | 16 ++++++++--------
 .../component/milo/server/MiloServerProducer.java   | 16 ++++++++--------
 .../milo/server/internal/CamelNamespace.java        | 16 ++++++++--------
 .../milo/server/internal/CamelServerItem.java       | 16 ++++++++--------
 .../camel/component/milo/server/package-info.java   | 16 ++++++++--------
 .../camel/component/milo/testing/Application.java   | 16 ++++++++--------
 .../component/milo/testing/Application2Client.java  | 16 ++++++++--------
 .../component/milo/testing/Application2Server.java  | 16 ++++++++--------
 26 files changed, 216 insertions(+), 200 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
index 1df24ee..fa1f970 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
index 8383d7c..f696fda 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo;
 
 import org.apache.camel.impl.DefaultMessage;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
index f16bbdc..4960b75 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo;
 
 import static java.util.Objects.requireNonNull;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
index 0f3defd..21d2834 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo;
 
 import static java.util.Objects.requireNonNull;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
index 2824e3e..94520e5 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.client;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
index cf9905e..e1e7301 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.client;
 
 import java.net.MalformedURLException;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
index bc67c88..dd90f80 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.client;
 
 import static java.util.Objects.requireNonNull;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
index b0e5d75..a57609e 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.client;
 
 import java.util.Objects;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
index 3e0742d..cc2b804 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.client;
 
 import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ushort;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
index 8664ef7..a8a0b5f 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.client;
 
 import org.apache.camel.component.milo.NamespaceId;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
index edc5718..0082596 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.client;
 
 import org.apache.camel.Endpoint;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
index 95acfe4..fb2e396 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016, 2017 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.client.internal;
 
 import java.net.URI;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/package-info.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/package-info.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/package-info.java
index cf9ef60..1ce7f10 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/package-info.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/package-info.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 /**
  * Client functionality
  */

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
index eaf178b..f2b03d9 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.converter;
 
 import org.apache.camel.Converter;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
index 7e5e94c..ee8a1f4 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
@@ -1,4 +1,20 @@
 /**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
  * Data conversion
  */
 package org.apache.camel.component.milo.converter;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/package-info.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/package-info.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/package-info.java
index 7d99602..38c9815 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/package-info.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/package-info.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 /**
  * Common base classes
  */

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
index 0c383c9..5a23cef 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.server;
 
 import static java.util.Collections.singletonList;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
index e641ea5..07537cd 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.server;
 
 import java.util.function.Consumer;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
index dec28aa..b398174 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.server;
 
 import org.apache.camel.Component;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
index 4b2724b..ef38848 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.server;
 
 import org.apache.camel.Endpoint;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
index 2a094cd..1cb345f 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.server.internal;
 
 import java.util.HashMap;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
index 3a23aee..8130943 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.server.internal;
 
 import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ubyte;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/package-info.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/package-info.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/package-info.java
index 5469d8f..5dbbb6c 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/package-info.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/package-info.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 /**
  * Server functionality
  */

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
index df0f984..1fa5df6 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.testing;
 
 import org.apache.camel.CamelContext;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
index 6c72a6a..4d76b38 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.testing;
 
 import org.apache.camel.CamelContext;

http://git-wip-us.apache.org/repos/asf/camel/blob/bc7974de/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
index 9ec30ab..af596cf 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.testing;
 
 import org.apache.camel.CamelContext;


[18/18] camel git commit: Regen docs

Posted by ac...@apache.org.
Regen docs


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b7df9577
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b7df9577
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b7df9577

Branch: refs/heads/master
Commit: b7df957753ff5aa616a3774d0f0766346015b136
Parents: 839453f
Author: Andrea Cosentino <an...@gmail.com>
Authored: Wed Apr 12 10:54:18 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:27 2017 +0200

----------------------------------------------------------------------
 .../camel-milo/src/main/docs/milo-client-component.adoc      | 2 +-
 components/readme.adoc                                       | 8 +++++++-
 docs/user-manual/en/SUMMARY.md                               | 2 ++
 3 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b7df9577/components/camel-milo/src/main/docs/milo-client-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-client-component.adoc b/components/camel-milo/src/main/docs/milo-client-component.adoc
index 4b8d342..a68163c 100644
--- a/components/camel-milo/src/main/docs/milo-client-component.adoc
+++ b/components/camel-milo/src/main/docs/milo-client-component.adoc
@@ -85,7 +85,7 @@ In other words, shared connections located by the combination of endpoint URI an
 // endpoint options: START
 The Milo based OPC UA Client endpoint is configured using URI syntax:
 
-    milo-client:tcp://user:password@host:port/path/to/service?itemId=item.id&namespaceUri=urn:foo:bar
+    milo-client:tcp://user:password@host:port/path/to/service
 
 with the following path and query parameters:
 

http://git-wip-us.apache.org/repos/asf/camel/blob/b7df9577/components/readme.adoc
----------------------------------------------------------------------
diff --git a/components/readme.adoc b/components/readme.adoc
index 9991e20..0dfca91 100644
--- a/components/readme.adoc
+++ b/components/readme.adoc
@@ -2,7 +2,7 @@ Components
 ^^^^^^^^^^
 
 // components: START
-Number of Components: 228 in 182 JAR artifacts (14 deprecated)
+Number of Components: 230 in 183 JAR artifacts (14 deprecated)
 
 [width="100%",cols="4,1,5",options="header"]
 |=======================================================================
@@ -389,6 +389,9 @@ Number of Components: 228 in 182 JAR artifacts (14 deprecated)
 | link:camel-metrics/src/main/docs/metrics-component.adoc[Metrics] (camel-metrics) +
 `metrics:metricsType:metricsName` | 2.14 | To collect various metrics directly from Camel routes using the DropWizard metrics library.
 
+| link:camel-milo/src/main/docs/milo-client-component.adoc[Milo based OPC UA Client] (camel-milo) +
+`milo-client:tcp://user:password@host:port/path/to/service` |  | Camel OPC UA support
+
 | link:camel-mina/src/main/docs/mina-component.adoc[Mina] (camel-mina) +
 `mina:protocol:host:port` | 1.0 | *deprecated* Socket level networking using TCP or UDP with the Apache Mina 1.x library.
 
@@ -449,6 +452,9 @@ Number of Components: 228 in 182 JAR artifacts (14 deprecated)
 | link:camel-olingo4/src/main/docs/olingo4-component.adoc[Olingo4] (camel-olingo4) +
 `olingo4:apiName/methodName` | 2.19 | Communicates with OData 4.0 services using Apache Olingo OData API.
 
+| link:camel-milo/src/main/docs/milo-server-component.adoc[OPC UA Server] (camel-milo) +
+`milo-server:itemId` |  | OPC UA Server based endpoint
+
 | link:camel-openshift/src/main/docs/openshift-component.adoc[OpenShift] (camel-openshift) +
 `openshift:clientId` | 2.14 | *deprecated* To manage your Openshift 2.x applications.
 

http://git-wip-us.apache.org/repos/asf/camel/blob/b7df9577/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index e5330bf..bdd6a79 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -239,6 +239,7 @@
 	* [Lucene](lucene-component.adoc)
 	* [Lumberjack](lumberjack-component.adoc)
 	* [Metrics](metrics-component.adoc)
+	* [Milo based OPC UA Client](milo-client-component.adoc)
 	* [Mina](mina-component.adoc)
 	* [Mina2](mina2-component.adoc)
 	* [MLLP](mllp-component.adoc)
@@ -258,6 +259,7 @@
 	* [Netty4 HTTP](netty4-http-component.adoc)
 	* [Olingo2](olingo2-component.adoc)
 	* [Olingo4](olingo4-component.adoc)
+	* [OPC UA Server](milo-server-component.adoc)
 	* [OpenShift](openshift-component.adoc)
 	* [OpenStack Cinder](openstack-cinder-component.adoc)
 	* [OpenStack Glance](openstack-glance-component.adoc)


[11/18] camel git commit: Organize imports

Posted by ac...@apache.org.
Organize imports


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/942f160c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/942f160c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/942f160c

Branch: refs/heads/master
Commit: 942f160c23298adc1bafe671e8d591ed0896fece
Parents: 19db14d
Author: Jens Reimann <jr...@redhat.com>
Authored: Wed Apr 12 09:51:50 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:27 2017 +0200

----------------------------------------------------------------------
 .../org/apache/camel/component/milo/NamespaceId.java     |  4 ++--
 .../org/apache/camel/component/milo/PartialNodeId.java   | 11 ++++++-----
 .../camel/component/milo/client/MiloClientComponent.java |  8 ++++----
 .../component/milo/client/MiloClientConnection.java      |  4 ++--
 .../camel/component/milo/server/MiloServerComponent.java |  7 ++++---
 .../component/milo/server/internal/CamelNamespace.java   |  4 ++--
 .../component/milo/server/internal/CamelServerItem.java  |  4 ++--
 .../milo/MonitorItemMultiConnectionsCertTest.java        |  4 ++--
 .../java/org/apache/camel/component/milo/NodeIdTest.java | 10 +++++-----
 .../org/apache/camel/component/milo/WriteClientTest.java |  4 ++--
 .../milo/server/ServerSetCertificateManagerTest.java     |  4 ++--
 11 files changed, 33 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
index ac5bf9f..8e19ec0 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
@@ -16,10 +16,10 @@
  */
 package org.apache.camel.component.milo;
 
-import static java.util.Objects.requireNonNull;
-
 import java.io.Serializable;
 
+import static java.util.Objects.requireNonNull;
+
 import org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId;
 import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
index 172702a..a9e2006 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
@@ -16,13 +16,13 @@
  */
 package org.apache.camel.component.milo;
 
-import static java.util.Objects.requireNonNull;
-import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
-import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ushort;
-
 import java.io.Serializable;
 import java.util.UUID;
 
+import static java.util.Objects.requireNonNull;
+
+import com.google.common.base.MoreObjects;
+
 import org.eclipse.milo.opcua.stack.core.types.builtin.ByteString;
 import org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId;
 import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
@@ -30,7 +30,8 @@ import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
 import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort;
 import org.eclipse.milo.opcua.stack.core.types.enumerated.IdType;
 
-import com.google.common.base.MoreObjects;
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ushort;
 
 public class PartialNodeId {
 

http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
index 580d5e9..ed75037 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
@@ -22,6 +22,10 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.function.Consumer;
 
+import com.google.common.base.Supplier;
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.Multimap;
+
 import org.apache.camel.Endpoint;
 import org.apache.camel.component.milo.KeyStoreLoader;
 import org.apache.camel.component.milo.KeyStoreLoader.Result;
@@ -33,10 +37,6 @@ import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Supplier;
-import com.google.common.collect.HashMultimap;
-import com.google.common.collect.Multimap;
-
 public class MiloClientComponent extends DefaultComponent {
 
     private static final Logger LOG = LoggerFactory.getLogger(MiloClientComponent.class);

http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
index 7abf159..ec3d569 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
@@ -16,10 +16,10 @@
  */
 package org.apache.camel.component.milo.client;
 
-import static java.util.Objects.requireNonNull;
-
 import java.util.function.Consumer;
 
+import static java.util.Objects.requireNonNull;
+
 import org.apache.camel.component.milo.NamespaceId;
 import org.apache.camel.component.milo.PartialNodeId;
 import org.apache.camel.component.milo.client.internal.SubscriptionManager;

http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
index be6665e..b72c6b5 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
@@ -16,9 +16,6 @@
  */
 package org.apache.camel.component.milo.server;
 
-import static java.util.Collections.singletonList;
-import static org.eclipse.milo.opcua.sdk.server.api.config.OpcUaServerConfig.USER_TOKEN_POLICY_ANONYMOUS;
-
 import java.io.Closeable;
 import java.io.File;
 import java.io.IOException;
@@ -39,6 +36,8 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.function.Supplier;
 
+import static java.util.Collections.singletonList;
+
 import org.apache.camel.Endpoint;
 import org.apache.camel.component.milo.KeyStoreLoader;
 import org.apache.camel.component.milo.client.MiloClientConsumer;
@@ -63,6 +62,8 @@ import org.eclipse.milo.opcua.stack.core.types.structured.UserTokenPolicy;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.eclipse.milo.opcua.sdk.server.api.config.OpcUaServerConfig.USER_TOKEN_POLICY_ANONYMOUS;
+
 /**
  * OPC UA Server based component
  */

http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
index 0445803..c2eb2b0 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
@@ -21,6 +21,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
+import com.google.common.collect.Lists;
+
 import org.apache.camel.component.milo.client.MiloClientConsumer;
 import org.eclipse.milo.opcua.sdk.core.Reference;
 import org.eclipse.milo.opcua.sdk.server.OpcUaServer;
@@ -51,8 +53,6 @@ import org.eclipse.milo.opcua.stack.core.types.structured.WriteValue;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.collect.Lists;
-
 public class CamelNamespace implements Namespace {
 
     private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);

http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
index a8df20b..f57a96e 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.component.milo.server.internal;
 
-import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ubyte;
-
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.Set;
@@ -39,6 +37,8 @@ import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ubyte;
+
 public class CamelServerItem {
     private static final Logger LOG = LoggerFactory.getLogger(CamelServerItem.class);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
index e397520..4440263 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
@@ -16,12 +16,12 @@
  */
 package org.apache.camel.component.milo;
 
-import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
-
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Produce;
 import org.apache.camel.ProducerTemplate;

http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
index 857d7a0..0f6f0aa 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
@@ -16,17 +16,17 @@
  */
 package org.apache.camel.component.milo;
 
-import static com.google.common.net.UrlEscapers.urlFormParameterEscaper;
-import static org.apache.camel.component.milo.server.MiloServerComponent.DEFAULT_NAMESPACE_URI;
-import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
-import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ushort;
-
 import java.io.Serializable;
 
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.component.milo.client.MiloClientEndpoint;
 import org.junit.Test;
 
+import static com.google.common.net.UrlEscapers.urlFormParameterEscaper;
+import static org.apache.camel.component.milo.server.MiloServerComponent.DEFAULT_NAMESPACE_URI;
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ushort;
+
 /**
  * Testing different ways to specify node IDs
  */

http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
index abf675d..8f8dbc3 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.component.milo;
 
-import static org.apache.camel.component.milo.NodeIds.nodeValue;
-
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Produce;
 import org.apache.camel.ProducerTemplate;
@@ -28,6 +26,8 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
 import org.junit.Test;
 
+import static org.apache.camel.component.milo.NodeIds.nodeValue;
+
 /**
  * Unit tests for writing from the client side
  */

http://git-wip-us.apache.org/repos/asf/camel/blob/942f160c/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
index 979451b..bb71c26 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
@@ -16,12 +16,12 @@
  */
 package org.apache.camel.component.milo.server;
 
-import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
-
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+
 import org.apache.camel.component.milo.AbstractMiloServerTest;
 import org.junit.Test;
 


[10/18] camel git commit: Rename documentation files

Posted by ac...@apache.org.
Rename documentation files


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/10c10a70
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/10c10a70
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/10c10a70

Branch: refs/heads/master
Commit: 10c10a70a5acec8c9f00021b27e23deba1820735
Parents: 89333ca
Author: Jens Reimann <jr...@redhat.com>
Authored: Wed Apr 12 09:28:42 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:27 2017 +0200

----------------------------------------------------------------------
 .../src/main/docs/milo-client-component.adoc    | 168 +++++++++++++++++++
 .../camel-milo/src/main/docs/milo-client.adoc   | 168 -------------------
 .../src/main/docs/milo-server-component.adoc    | 111 ++++++++++++
 .../camel-milo/src/main/docs/milo-server.adoc   | 111 ------------
 4 files changed, 279 insertions(+), 279 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/10c10a70/components/camel-milo/src/main/docs/milo-client-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-client-component.adoc b/components/camel-milo/src/main/docs/milo-client-component.adoc
new file mode 100644
index 0000000..f1585cf
--- /dev/null
+++ b/components/camel-milo/src/main/docs/milo-client-component.adoc
@@ -0,0 +1,168 @@
+[[MiloClient-MiloClientComponent]]
+
+Milo Client Component
+~~~~~~~~~~~~~~~~~~~~~~~
+
+*Available as of Camel 2.19*
+
+The *Milo Client* component provides access to OPC UA servers using the
+http://eclipse.org/milo[Eclipse Milo\u2122] implementation.
+
+*Java 8*: This component requires Java 8 at runtime. 
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>de.dentrassi.camel</groupId>
+    <artifactId>de.dentrassi.camel.milo</artifactId>
+    <version><!-- your Apache Camel version--></version>
+</dependency>
+------------------------------------------------------------
+
+
+
+// component options: START
+The Milo based OPC UA Client component supports 5 options which are listed below.
+
+
+
+[width="100%",cols="2s,1m,8",options="header"]
+|=======================================================================
+| Name | Java Type | Description
+| defaultConfiguration | MiloClientConfiguration | All default options for client
+| applicationName | String | Default application name
+| applicationUri | String | Default application URI
+| productUri | String | Default product URI
+| reconnectTimeout | Long | Default reconnect timeout
+|=======================================================================
+// component options: END
+
+
+
+[[MiloClient-URIformat]]
+URI format
+^^^^^^^^^^
+
+The URI syntax of the endpoint is: 
+
+[source]
+------------------------
+milo-client:tcp://[user:password@]host:port/path/to/service?node=RAW(nsu=urn:foo:bar;s=item-1)
+------------------------
+
+If the server does not use a path, then it is possible to simply omit it:
+
+------------------------
+milo-client:tcp://[user:password@]host:port?node=RAW(nsu=urn:foo:bar;s=item-1)
+------------------------
+
+If no user credentials are provided the client will switch to anonymous mode.
+
+[[MiloClient-URIOptions]]
+URI options
+^^^^^^^^^^^
+
+All configuration options in the group +client+ are applicable to the shared client instance. Endpoints
+will share client instances for each endpoint URI. So the first time a request for that endpoint URI is
+made, the options of the +client+ group are applied. All further instances will be ignored.
+
+If you need alternate options for the same endpoint URI it is possible though to set the +clientId+ option
+which will by added internally to the endpoint URI in order to select a different shared connection instance.
+In other words, shared connections located by the combination of endpoint URI and client id.
+
+
+
+
+
+
+
+
+
+
+
+
+// endpoint options: START
+The Milo based OPC UA Client component supports 27 endpoint options which are listed below:
+
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| endpointUri | common |  | String | *Required* The OPC UA server endpoint
+| clientId | common |  | String | A virtual client id to force the creation of a new connection instance
+| defaultAwaitWrites | common | false | boolean | Default await setting for writes
+| namespaceIndex | common |  | Integer | The namespace as numeric index deprecated
+| namespaceUri | common |  | String | The namespace as URI deprecated
+| node | common |  | ExpandedNodeId | The node definition (see Node ID)
+| nodeId | common |  | String | The node ID as string ID deprecated
+| samplingInterval | common |  | Double | The sampling interval in milliseconds
+| bridgeErrorHandler | consumer | false | boolean | 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/ERROR level and ignored.
+| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+| applicationName | client | Apache Camel adapter for Eclipse Milo | String | The application name
+| applicationUri | client | http://camel.apache.org/EclipseMilo/Client | String | The application URI
+| channelLifetime | client |  | Long | Channel lifetime in milliseconds
+| keyAlias | client |  | String | The name of the key in the keystore file
+| keyPassword | client |  | String | The key password
+| keyStorePassword | client |  | String | The keystore password
+| keyStoreType | client |  | String | The key store type
+| keyStoreUrl | client |  | URL | The URL where the key should be loaded from
+| maxPendingPublishRequests | client |  | Long | The maximum number of pending publish requests
+| maxResponseMessageSize | client |  | Long | The maximum number of bytes a response message may have
+| productUri | client | http://camel.apache.org/EclipseMilo | String | The product URI
+| requestTimeout | client |  | Long | Request timeout in milliseconds
+| secureChannelReauthenticationEnabled | client |  | Boolean | Whether secure channel re-authentication is enabled
+| sessionName | client |  | String | Session name
+| sessionTimeout | client |  | Long | Session timeout in milliseconds
+|=======================================================================
+// endpoint options: END
+
+
+
+
+
+
+Node ID
++++++++
+
+
+In order to define a target node a namespace and node id is required. In previous versions this was possible by
+specifying `nodeId` and either `namespaceUri` or `namespaceIndex`. However this only allowed for using
+string based node IDs. And while this configuration is still possible, the newer one is preferred.
+
+The new approach is to specify a full namespace+node ID in the format `ns=1;i=1` which also allows to use the other
+node ID formats (like numeric, GUID/UUID or opaque). If the `node` parameter is used the older ones must not be used.
+The syntax of this node format is a set of `key=value` pairs delimited by a semi-colon (`;`). 
+
+Exactly one namespace and one node id key must be used. See the following table for possible keys:
+
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Key | Type | Description
+| ns  | namespace | Numeric namespace index
+| nsu | namespace | Namespace URI
+| s   | node | String node ID
+| i   | node | Numeric node ID
+| g   | node | GUID/UUID node ID
+| b   | node | Base64 encoded string for opaque node ID
+|=======================================================================
+
+As the values generated by the syntax cannot be transparently encoded into a URI parameter value, it is necessary to escape
+them. However Camel allows to wrap the actual value inside `RAW(\u2026)`, which makes escaping unnecessary. For example:
+
+------------------------
+milo-client://user:password@localhost:12345?node=RAW(nsu=http://foo.bar;s=foo/bar)
+------------------------
+
+[[MiloClient-SeeAlso]]
+See Also
+^^^^^^^^
+
+* link:configuring-camel.html[Configuring Camel]
+* link:component.html[Component]
+* link:endpoint.html[Endpoint]
+* link:getting-started.html[Getting Started]
+

http://git-wip-us.apache.org/repos/asf/camel/blob/10c10a70/components/camel-milo/src/main/docs/milo-client.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-client.adoc b/components/camel-milo/src/main/docs/milo-client.adoc
deleted file mode 100644
index f1585cf..0000000
--- a/components/camel-milo/src/main/docs/milo-client.adoc
+++ /dev/null
@@ -1,168 +0,0 @@
-[[MiloClient-MiloClientComponent]]
-
-Milo Client Component
-~~~~~~~~~~~~~~~~~~~~~~~
-
-*Available as of Camel 2.19*
-
-The *Milo Client* component provides access to OPC UA servers using the
-http://eclipse.org/milo[Eclipse Milo\u2122] implementation.
-
-*Java 8*: This component requires Java 8 at runtime. 
-
-Maven users will need to add the following dependency to their `pom.xml`
-for this component:
-
-[source,xml]
-------------------------------------------------------------
-<dependency>
-    <groupId>de.dentrassi.camel</groupId>
-    <artifactId>de.dentrassi.camel.milo</artifactId>
-    <version><!-- your Apache Camel version--></version>
-</dependency>
-------------------------------------------------------------
-
-
-
-// component options: START
-The Milo based OPC UA Client component supports 5 options which are listed below.
-
-
-
-[width="100%",cols="2s,1m,8",options="header"]
-|=======================================================================
-| Name | Java Type | Description
-| defaultConfiguration | MiloClientConfiguration | All default options for client
-| applicationName | String | Default application name
-| applicationUri | String | Default application URI
-| productUri | String | Default product URI
-| reconnectTimeout | Long | Default reconnect timeout
-|=======================================================================
-// component options: END
-
-
-
-[[MiloClient-URIformat]]
-URI format
-^^^^^^^^^^
-
-The URI syntax of the endpoint is: 
-
-[source]
-------------------------
-milo-client:tcp://[user:password@]host:port/path/to/service?node=RAW(nsu=urn:foo:bar;s=item-1)
-------------------------
-
-If the server does not use a path, then it is possible to simply omit it:
-
-------------------------
-milo-client:tcp://[user:password@]host:port?node=RAW(nsu=urn:foo:bar;s=item-1)
-------------------------
-
-If no user credentials are provided the client will switch to anonymous mode.
-
-[[MiloClient-URIOptions]]
-URI options
-^^^^^^^^^^^
-
-All configuration options in the group +client+ are applicable to the shared client instance. Endpoints
-will share client instances for each endpoint URI. So the first time a request for that endpoint URI is
-made, the options of the +client+ group are applied. All further instances will be ignored.
-
-If you need alternate options for the same endpoint URI it is possible though to set the +clientId+ option
-which will by added internally to the endpoint URI in order to select a different shared connection instance.
-In other words, shared connections located by the combination of endpoint URI and client id.
-
-
-
-
-
-
-
-
-
-
-
-
-// endpoint options: START
-The Milo based OPC UA Client component supports 27 endpoint options which are listed below:
-
-[width="100%",cols="2s,1,1m,1m,5",options="header"]
-|=======================================================================
-| Name | Group | Default | Java Type | Description
-| endpointUri | common |  | String | *Required* The OPC UA server endpoint
-| clientId | common |  | String | A virtual client id to force the creation of a new connection instance
-| defaultAwaitWrites | common | false | boolean | Default await setting for writes
-| namespaceIndex | common |  | Integer | The namespace as numeric index deprecated
-| namespaceUri | common |  | String | The namespace as URI deprecated
-| node | common |  | ExpandedNodeId | The node definition (see Node ID)
-| nodeId | common |  | String | The node ID as string ID deprecated
-| samplingInterval | common |  | Double | The sampling interval in milliseconds
-| bridgeErrorHandler | consumer | false | boolean | 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/ERROR level and ignored.
-| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
-| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
-| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
-| applicationName | client | Apache Camel adapter for Eclipse Milo | String | The application name
-| applicationUri | client | http://camel.apache.org/EclipseMilo/Client | String | The application URI
-| channelLifetime | client |  | Long | Channel lifetime in milliseconds
-| keyAlias | client |  | String | The name of the key in the keystore file
-| keyPassword | client |  | String | The key password
-| keyStorePassword | client |  | String | The keystore password
-| keyStoreType | client |  | String | The key store type
-| keyStoreUrl | client |  | URL | The URL where the key should be loaded from
-| maxPendingPublishRequests | client |  | Long | The maximum number of pending publish requests
-| maxResponseMessageSize | client |  | Long | The maximum number of bytes a response message may have
-| productUri | client | http://camel.apache.org/EclipseMilo | String | The product URI
-| requestTimeout | client |  | Long | Request timeout in milliseconds
-| secureChannelReauthenticationEnabled | client |  | Boolean | Whether secure channel re-authentication is enabled
-| sessionName | client |  | String | Session name
-| sessionTimeout | client |  | Long | Session timeout in milliseconds
-|=======================================================================
-// endpoint options: END
-
-
-
-
-
-
-Node ID
-+++++++
-
-
-In order to define a target node a namespace and node id is required. In previous versions this was possible by
-specifying `nodeId` and either `namespaceUri` or `namespaceIndex`. However this only allowed for using
-string based node IDs. And while this configuration is still possible, the newer one is preferred.
-
-The new approach is to specify a full namespace+node ID in the format `ns=1;i=1` which also allows to use the other
-node ID formats (like numeric, GUID/UUID or opaque). If the `node` parameter is used the older ones must not be used.
-The syntax of this node format is a set of `key=value` pairs delimited by a semi-colon (`;`). 
-
-Exactly one namespace and one node id key must be used. See the following table for possible keys:
-
-[width="100%",cols="2s,1,1m,1m,5",options="header"]
-|=======================================================================
-| Key | Type | Description
-| ns  | namespace | Numeric namespace index
-| nsu | namespace | Namespace URI
-| s   | node | String node ID
-| i   | node | Numeric node ID
-| g   | node | GUID/UUID node ID
-| b   | node | Base64 encoded string for opaque node ID
-|=======================================================================
-
-As the values generated by the syntax cannot be transparently encoded into a URI parameter value, it is necessary to escape
-them. However Camel allows to wrap the actual value inside `RAW(\u2026)`, which makes escaping unnecessary. For example:
-
-------------------------
-milo-client://user:password@localhost:12345?node=RAW(nsu=http://foo.bar;s=foo/bar)
-------------------------
-
-[[MiloClient-SeeAlso]]
-See Also
-^^^^^^^^
-
-* link:configuring-camel.html[Configuring Camel]
-* link:component.html[Component]
-* link:endpoint.html[Endpoint]
-* link:getting-started.html[Getting Started]
-

http://git-wip-us.apache.org/repos/asf/camel/blob/10c10a70/components/camel-milo/src/main/docs/milo-server-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-server-component.adoc b/components/camel-milo/src/main/docs/milo-server-component.adoc
new file mode 100644
index 0000000..6c86c10
--- /dev/null
+++ b/components/camel-milo/src/main/docs/milo-server-component.adoc
@@ -0,0 +1,111 @@
+[[MiloServer-OpcUaServerComponent]]
+
+Eclipse Milo Server Component
+~~~~~~~~~~~~~~~~~~~~~~~
+
+*Available as of Camel 2.19*
+
+The *Milo Server* component provides an OPC UA server using the
+http://eclipse.org/milo[Eclipse Milo\u2122] implementation.
+
+*Java 8*: This component requires Java 8 at runtime. 
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>de.dentrassi.camel</groupId>
+    <artifactId>de.dentrassi.camel.milo</artifactId>
+    <version><!-- your Apache Camel version--></version>
+</dependency>
+------------------------------------------------------------
+
+Messages sent to the endpoint from Camel will be available from the OPC UA server to OPC UA Clients.
+Value write requests from OPC UA Client will trigger messages which are sent into Apache Camel.
+
+
+
+
+// component options: START
+The OPC UA Server component supports 19 options which are listed below.
+
+
+
+[width="100%",cols="2s,1m,8",options="header"]
+|=======================================================================
+| Name | Java Type | Description
+| namespaceUri | String | The URI of the namespace defaults to urn:org:apache:camel
+| applicationName | String | The application name
+| applicationUri | String | The application URI
+| productUri | String | The product URI
+| bindPort | int | The TCP port the server binds to
+| strictEndpointUrlsEnabled | boolean | Set whether strict endpoint URLs are enforced
+| serverName | String | Server name
+| hostname | String | Server hostname
+| securityPolicies | Set | Security policies
+| securityPoliciesById | String> | Security policies by URI or name
+| userAuthenticationCredentials | String | Set user password combinations in the form of user1:pwd1user2:pwd2 Usernames and passwords will be URL decoded
+| enableAnonymousAuthentication | boolean | Enable anonymous authentication disabled by default
+| bindAddresses | String | Set the addresses of the local addresses the server should bind to
+| buildInfo | BuildInfo | Server build info
+| serverCertificate | Result | Server certificate
+| certificateManager | CertificateManager | Server certificate manager
+| certificateValidator | CertificateValidator> | Validator for client certificates
+| defaultCertificateValidator | File | Validator for client certificates using default file based approach
+| defaultCertificateExistingValidator | File | Validator for client certificates using default file based approach
+|=======================================================================
+// component options: END
+
+
+
+
+
+
+
+
+
+[[MiloServer-URIformat]]
+URI format
+^^^^^^^^^^
+
+[source,java]
+------------------------
+milo-server:itemId[?options]
+------------------------
+
+[[Milo-URIOptions]]
+URI options
+^^^^^^^^^^^
+
+
+
+// endpoint options: START
+The OPC UA Server component supports 5 endpoint options which are listed below:
+
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| itemId | common |  | String | *Required* ID of the item
+| bridgeErrorHandler | consumer | false | boolean | 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/ERROR level and ignored.
+| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+|=======================================================================
+// endpoint options: END
+
+
+
+
+
+
+[[MiloServer-SeeAlso]]
+See Also
+^^^^^^^^
+
+* link:configuring-camel.html[Configuring Camel]
+* link:component.html[Component]
+* link:endpoint.html[Endpoint]
+* link:getting-started.html[Getting Started]
+

http://git-wip-us.apache.org/repos/asf/camel/blob/10c10a70/components/camel-milo/src/main/docs/milo-server.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-server.adoc b/components/camel-milo/src/main/docs/milo-server.adoc
deleted file mode 100644
index 6c86c10..0000000
--- a/components/camel-milo/src/main/docs/milo-server.adoc
+++ /dev/null
@@ -1,111 +0,0 @@
-[[MiloServer-OpcUaServerComponent]]
-
-Eclipse Milo Server Component
-~~~~~~~~~~~~~~~~~~~~~~~
-
-*Available as of Camel 2.19*
-
-The *Milo Server* component provides an OPC UA server using the
-http://eclipse.org/milo[Eclipse Milo\u2122] implementation.
-
-*Java 8*: This component requires Java 8 at runtime. 
-
-Maven users will need to add the following dependency to their `pom.xml`
-for this component:
-
-[source,xml]
-------------------------------------------------------------
-<dependency>
-    <groupId>de.dentrassi.camel</groupId>
-    <artifactId>de.dentrassi.camel.milo</artifactId>
-    <version><!-- your Apache Camel version--></version>
-</dependency>
-------------------------------------------------------------
-
-Messages sent to the endpoint from Camel will be available from the OPC UA server to OPC UA Clients.
-Value write requests from OPC UA Client will trigger messages which are sent into Apache Camel.
-
-
-
-
-// component options: START
-The OPC UA Server component supports 19 options which are listed below.
-
-
-
-[width="100%",cols="2s,1m,8",options="header"]
-|=======================================================================
-| Name | Java Type | Description
-| namespaceUri | String | The URI of the namespace defaults to urn:org:apache:camel
-| applicationName | String | The application name
-| applicationUri | String | The application URI
-| productUri | String | The product URI
-| bindPort | int | The TCP port the server binds to
-| strictEndpointUrlsEnabled | boolean | Set whether strict endpoint URLs are enforced
-| serverName | String | Server name
-| hostname | String | Server hostname
-| securityPolicies | Set | Security policies
-| securityPoliciesById | String> | Security policies by URI or name
-| userAuthenticationCredentials | String | Set user password combinations in the form of user1:pwd1user2:pwd2 Usernames and passwords will be URL decoded
-| enableAnonymousAuthentication | boolean | Enable anonymous authentication disabled by default
-| bindAddresses | String | Set the addresses of the local addresses the server should bind to
-| buildInfo | BuildInfo | Server build info
-| serverCertificate | Result | Server certificate
-| certificateManager | CertificateManager | Server certificate manager
-| certificateValidator | CertificateValidator> | Validator for client certificates
-| defaultCertificateValidator | File | Validator for client certificates using default file based approach
-| defaultCertificateExistingValidator | File | Validator for client certificates using default file based approach
-|=======================================================================
-// component options: END
-
-
-
-
-
-
-
-
-
-[[MiloServer-URIformat]]
-URI format
-^^^^^^^^^^
-
-[source,java]
-------------------------
-milo-server:itemId[?options]
-------------------------
-
-[[Milo-URIOptions]]
-URI options
-^^^^^^^^^^^
-
-
-
-// endpoint options: START
-The OPC UA Server component supports 5 endpoint options which are listed below:
-
-[width="100%",cols="2s,1,1m,1m,5",options="header"]
-|=======================================================================
-| Name | Group | Default | Java Type | Description
-| itemId | common |  | String | *Required* ID of the item
-| bridgeErrorHandler | consumer | false | boolean | 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/ERROR level and ignored.
-| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
-| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
-| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
-|=======================================================================
-// endpoint options: END
-
-
-
-
-
-
-[[MiloServer-SeeAlso]]
-See Also
-^^^^^^^^
-
-* link:configuring-camel.html[Configuring Camel]
-* link:component.html[Component]
-* link:endpoint.html[Endpoint]
-* link:getting-started.html[Getting Started]
-


[05/18] camel git commit: Initial import of Camel Milo

Posted by ac...@apache.org.
Initial import of Camel Milo

Signed-off-by: Jens Reimann <jr...@redhat.com>


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7b3837fa
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7b3837fa
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7b3837fa

Branch: refs/heads/master
Commit: 7b3837fae7acf115885da3ea3958b79042240d26
Parents: 586f940
Author: Jens Reimann <jr...@redhat.com>
Authored: Mon Apr 10 15:48:30 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:26 2017 +0200

----------------------------------------------------------------------
 components/camel-milo/pom.xml                   | 104 ++++
 .../camel-milo/src/main/docs/milo-client.adoc   | 168 ++++++
 .../camel-milo/src/main/docs/milo-server.adoc   | 111 ++++
 .../camel/component/milo/KeyStoreLoader.java    | 145 +++++
 .../apache/camel/component/milo/Messages.java   |  38 ++
 .../camel/component/milo/NamespaceId.java       |  83 +++
 .../camel/component/milo/PartialNodeId.java     | 119 ++++
 .../milo/client/MiloClientComponent.java        | 219 +++++++
 .../milo/client/MiloClientConfiguration.java    | 292 ++++++++++
 .../milo/client/MiloClientConnection.java       | 127 +++++
 .../milo/client/MiloClientConsumer.java         |  92 +++
 .../milo/client/MiloClientEndpoint.java         | 242 ++++++++
 .../client/MiloClientItemConfiguration.java     |  28 +
 .../milo/client/MiloClientProducer.java         |  63 ++
 .../client/internal/SubscriptionManager.java    | 570 +++++++++++++++++++
 .../component/milo/client/package-info.java     |  20 +
 .../milo/converter/ValueConverter.java          |  38 ++
 .../component/milo/converter/package-info.java  |   4 +
 .../camel/component/milo/package-info.java      |  20 +
 .../milo/server/MiloServerComponent.java        | 466 +++++++++++++++
 .../milo/server/MiloServerConsumer.java         |  78 +++
 .../milo/server/MiloServerEndpoint.java         | 106 ++++
 .../milo/server/MiloServerProducer.java         |  38 ++
 .../milo/server/internal/CamelNamespace.java    | 213 +++++++
 .../milo/server/internal/CamelServerItem.java   | 146 +++++
 .../component/milo/server/package-info.java     |  20 +
 .../src/main/resources/META-INF/LICENSE.txt     | 203 +++++++
 .../src/main/resources/META-INF/NOTICE.txt      |  11 +
 .../services/org/apache/camel/TypeConverter     |   1 +
 .../org/apache/camel/component/milo-client      |   1 +
 .../org/apache/camel/component/milo-server      |   1 +
 .../component/milo/AbstractMiloServerTest.java  |  90 +++
 .../MonitorItemMultiConnectionsCertTest.java    | 124 ++++
 .../milo/MonitorItemMultiConnectionsTest.java   |  99 ++++
 .../camel/component/milo/MonitorItemTest.java   |  89 +++
 .../apache/camel/component/milo/NodeIdTest.java | 100 ++++
 .../camel/component/milo/WriteClientTest.java   | 156 +++++
 .../component/milo/converter/ConverterTest.java |  49 ++
 .../component/milo/server/ServerLocalTest.java  |  83 +++
 .../server/ServerSetCertificateManagerTest.java |  51 ++
 .../server/ServerSetSecurityPoliciesTest.java   |  50 ++
 .../component/milo/testing/Application.java     |  72 +++
 .../milo/testing/Application2Client.java        |  59 ++
 .../milo/testing/Application2Server.java        |  72 +++
 .../camel-milo/src/test/resources/cert/Makefile |  16 +
 .../camel-milo/src/test/resources/cert/cert.ini |  13 +
 .../camel-milo/src/test/resources/cert/cert.p12 | Bin 0 -> 2461 bytes
 .../src/test/resources/cert/certificate.crt     |  20 +
 .../src/test/resources/cert/certificate.der     | Bin 0 -> 856 bytes
 .../src/test/resources/cert/privateKey.key      |  28 +
 .../src/test/resources/log4j2.properties        |  28 +
 components/pom.xml                              |   1 +
 parent/pom.xml                                  |   1 +
 .../camel-milo-starter/pom.xml                  |  51 ++
 .../src/main/resources/META-INF/LICENSE.txt     | 203 +++++++
 .../src/main/resources/META-INF/NOTICE.txt      |  11 +
 .../src/main/resources/META-INF/spring.provides |  18 +
 .../spring-boot/components-starter/pom.xml      |   1 +
 58 files changed, 5252 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-milo/pom.xml b/components/camel-milo/pom.xml
new file mode 100644
index 0000000..5c597ba
--- /dev/null
+++ b/components/camel-milo/pom.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>components</artifactId>
+        <version>2.19.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-milo</artifactId>
+    <packaging>jar</packaging>
+    <name>Camel :: Milo</name>
+    <description>Camel OPC UA support</description>
+
+    <properties>
+        <camel.osgi.export.pkg>
+            !*.internal.*,
+            org.apache.camel.component.milo.*
+        </camel.osgi.export.pkg>
+        <camel.osgi.import.before.defaults>
+            com.google.common.*;version="19.0.0"
+        </camel.osgi.import.before.defaults>
+        <camel.osgi.export.service>
+            org.apache.camel.spi.ComponentResolver;component=milo-client,
+            org.apache.camel.spi.ComponentResolver;component=milo-server
+        </camel.osgi.export.service>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.eclipse.milo</groupId>
+            <artifactId>sdk-server</artifactId>
+            <version>${milo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.eclipse.milo</groupId>
+            <artifactId>sdk-client</artifactId>
+            <version>${milo-version}</version>
+        </dependency>
+
+        <!-- testing -->
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <!-- required due to issue eclipse/milo#23 -->
+                    <reuseForks>false</reuseForks>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/docs/milo-client.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-client.adoc b/components/camel-milo/src/main/docs/milo-client.adoc
new file mode 100644
index 0000000..60dfbcf
--- /dev/null
+++ b/components/camel-milo/src/main/docs/milo-client.adoc
@@ -0,0 +1,168 @@
+[[MiloClient-MiloClientComponent]]
+
+Milo Client Component
+~~~~~~~~~~~~~~~~~~~~~~~
+
+*Available as of Camel 2.18*
+
+The *Milo Client* component provides access to OPC UA servers using the
+http://eclipse.org/milo[Eclipse Milo\u2122] implementation.
+
+*Java 8*: This component requires Java 8 at runtime. 
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>de.dentrassi.camel</groupId>
+    <artifactId>de.dentrassi.camel.milo</artifactId>
+    <version><!-- your Apache Camel version--></version>
+</dependency>
+------------------------------------------------------------
+
+
+
+// component options: START
+The Milo based OPC UA Client component supports 5 options which are listed below.
+
+
+
+[width="100%",cols="2s,1m,8",options="header"]
+|=======================================================================
+| Name | Java Type | Description
+| defaultConfiguration | MiloClientConfiguration | All default options for client
+| applicationName | String | Default application name
+| applicationUri | String | Default application URI
+| productUri | String | Default product URI
+| reconnectTimeout | Long | Default reconnect timeout
+|=======================================================================
+// component options: END
+
+
+
+[[MiloClient-URIformat]]
+URI format
+^^^^^^^^^^
+
+The URI syntax of the endpoint is: 
+
+[source]
+------------------------
+milo-client:tcp://[user:password@]host:port/path/to/service?node=RAW(nsu=urn:foo:bar;s=item-1)
+------------------------
+
+If the server does not use a path, then it is possible to simply omit it:
+
+------------------------
+milo-client:tcp://[user:password@]host:port?node=RAW(nsu=urn:foo:bar;s=item-1)
+------------------------
+
+If no user credentials are provided the client will switch to anonymous mode.
+
+[[MiloClient-URIOptions]]
+URI options
+^^^^^^^^^^^
+
+All configuration options in the group +client+ are applicable to the shared client instance. Endpoints
+will share client instances for each endpoint URI. So the first time a request for that endpoint URI is
+made, the options of the +client+ group are applied. All further instances will be ignored.
+
+If you need alternate options for the same endpoint URI it is possible though to set the +clientId+ option
+which will by added internally to the endpoint URI in order to select a different shared connection instance.
+In other words, shared connections located by the combination of endpoint URI and client id.
+
+
+
+
+
+
+
+
+
+
+
+
+// endpoint options: START
+The Milo based OPC UA Client component supports 27 endpoint options which are listed below:
+
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| endpointUri | common |  | String | *Required* The OPC UA server endpoint
+| clientId | common |  | String | A virtual client id to force the creation of a new connection instance
+| defaultAwaitWrites | common | false | boolean | Default await setting for writes
+| namespaceIndex | common |  | Integer | The namespace as numeric index deprecated
+| namespaceUri | common |  | String | The namespace as URI deprecated
+| node | common |  | ExpandedNodeId | The node definition (see Node ID)
+| nodeId | common |  | String | The node ID as string ID deprecated
+| samplingInterval | common |  | Double | The sampling interval in milliseconds
+| bridgeErrorHandler | consumer | false | boolean | 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/ERROR level and ignored.
+| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+| applicationName | client | Apache Camel adapter for Eclipse Milo | String | The application name
+| applicationUri | client | http://camel.apache.org/EclipseMilo/Client | String | The application URI
+| channelLifetime | client |  | Long | Channel lifetime in milliseconds
+| keyAlias | client |  | String | The name of the key in the keystore file
+| keyPassword | client |  | String | The key password
+| keyStorePassword | client |  | String | The keystore password
+| keyStoreType | client |  | String | The key store type
+| keyStoreUrl | client |  | URL | The URL where the key should be loaded from
+| maxPendingPublishRequests | client |  | Long | The maximum number of pending publish requests
+| maxResponseMessageSize | client |  | Long | The maximum number of bytes a response message may have
+| productUri | client | http://camel.apache.org/EclipseMilo | String | The product URI
+| requestTimeout | client |  | Long | Request timeout in milliseconds
+| secureChannelReauthenticationEnabled | client |  | Boolean | Whether secure channel re-authentication is enabled
+| sessionName | client |  | String | Session name
+| sessionTimeout | client |  | Long | Session timeout in milliseconds
+|=======================================================================
+// endpoint options: END
+
+
+
+
+
+
+Node ID
++++++++
+
+
+In order to define a target node a namespace and node id is required. In previous versions this was possible by
+specifying `nodeId` and either `namespaceUri` or `namespaceIndex`. However this only allowed for using
+string based node IDs. And while this configuration is still possible, the newer one is preferred.
+
+The new approach is to specify a full namespace+node ID in the format `ns=1;i=1` which also allows to use the other
+node ID formats (like numeric, GUID/UUID or opaque). If the `node` parameter is used the older ones must not be used.
+The syntax of this node format is a set of `key=value` pairs delimited by a semi-colon (`;`). 
+
+Exactly one namespace and one node id key must be used. See the following table for possible keys:
+
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Key | Type | Description
+| ns  | namespace | Numeric namespace index
+| nsu | namespace | Namespace URI
+| s   | node | String node ID
+| i   | node | Numeric node ID
+| g   | node | GUID/UUID node ID
+| b   | node | Base64 encoded string for opaque node ID
+|=======================================================================
+
+As the values generated by the syntax cannot be transparently encoded into a URI parameter value, it is necessary to escape
+them. However Camel allows to wrap the actual value inside `RAW(\u2026)`, which makes escaping unnecessary. For example:
+
+------------------------
+milo-client://user:password@localhost:12345?node=RAW(nsu=http://foo.bar;s=foo/bar)
+------------------------
+
+[[MiloClient-SeeAlso]]
+See Also
+^^^^^^^^
+
+* link:configuring-camel.html[Configuring Camel]
+* link:component.html[Component]
+* link:endpoint.html[Endpoint]
+* link:getting-started.html[Getting Started]
+

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/docs/milo-server.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-server.adoc b/components/camel-milo/src/main/docs/milo-server.adoc
new file mode 100644
index 0000000..3f699f6
--- /dev/null
+++ b/components/camel-milo/src/main/docs/milo-server.adoc
@@ -0,0 +1,111 @@
+[[MiloServer-OpcUaServerComponent]]
+
+Eclipse Milo Server Component
+~~~~~~~~~~~~~~~~~~~~~~~
+
+*Available as of Camel 2.18*
+
+The *Milo Server* component provides an OPC UA server using the
+http://eclipse.org/milo[Eclipse Milo\u2122] implementation.
+
+*Java 8*: This component requires Java 8 at runtime. 
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>de.dentrassi.camel</groupId>
+    <artifactId>de.dentrassi.camel.milo</artifactId>
+    <version><!-- your Apache Camel version--></version>
+</dependency>
+------------------------------------------------------------
+
+Messages sent to the endpoint from Camel will be available from the OPC UA server to OPC UA Clients.
+Value write requests from OPC UA Client will trigger messages which are sent into Apache Camel.
+
+
+
+
+// component options: START
+The OPC UA Server component supports 19 options which are listed below.
+
+
+
+[width="100%",cols="2s,1m,8",options="header"]
+|=======================================================================
+| Name | Java Type | Description
+| namespaceUri | String | The URI of the namespace defaults to urn:org:apache:camel
+| applicationName | String | The application name
+| applicationUri | String | The application URI
+| productUri | String | The product URI
+| bindPort | int | The TCP port the server binds to
+| strictEndpointUrlsEnabled | boolean | Set whether strict endpoint URLs are enforced
+| serverName | String | Server name
+| hostname | String | Server hostname
+| securityPolicies | Set | Security policies
+| securityPoliciesById | String> | Security policies by URI or name
+| userAuthenticationCredentials | String | Set user password combinations in the form of user1:pwd1user2:pwd2 Usernames and passwords will be URL decoded
+| enableAnonymousAuthentication | boolean | Enable anonymous authentication disabled by default
+| bindAddresses | String | Set the addresses of the local addresses the server should bind to
+| buildInfo | BuildInfo | Server build info
+| serverCertificate | Result | Server certificate
+| certificateManager | CertificateManager | Server certificate manager
+| certificateValidator | CertificateValidator> | Validator for client certificates
+| defaultCertificateValidator | File | Validator for client certificates using default file based approach
+| defaultCertificateExistingValidator | File | Validator for client certificates using default file based approach
+|=======================================================================
+// component options: END
+
+
+
+
+
+
+
+
+
+[[MiloServer-URIformat]]
+URI format
+^^^^^^^^^^
+
+[source,java]
+------------------------
+milo-server:itemId[?options]
+------------------------
+
+[[Milo-URIOptions]]
+URI options
+^^^^^^^^^^^
+
+
+
+// endpoint options: START
+The OPC UA Server component supports 5 endpoint options which are listed below:
+
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| itemId | common |  | String | *Required* ID of the item
+| bridgeErrorHandler | consumer | false | boolean | 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/ERROR level and ignored.
+| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+|=======================================================================
+// endpoint options: END
+
+
+
+
+
+
+[[MiloServer-SeeAlso]]
+See Also
+^^^^^^^^
+
+* link:configuring-camel.html[Configuring Camel]
+* link:component.html[Component]
+* link:endpoint.html[Endpoint]
+* link:getting-started.html[Getting Started]
+

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
new file mode 100644
index 0000000..1df24ee
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.GeneralSecurityException;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyStore;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.security.cert.X509Certificate;
+import java.util.NoSuchElementException;
+
+public class KeyStoreLoader {
+	public static final String DEFAULT_KEY_STORE_TYPE = "PKCS12";
+
+	private String type = DEFAULT_KEY_STORE_TYPE;
+	private URL url;
+	private String keyStorePassword;
+	private String keyPassword;
+	private String keyAlias;
+
+	public static class Result {
+
+		private final X509Certificate certificate;
+		private final KeyPair keyPair;
+
+		public Result(final X509Certificate certificate, final KeyPair keyPair) {
+			this.certificate = certificate;
+			this.keyPair = keyPair;
+		}
+
+		public X509Certificate getCertificate() {
+			return this.certificate;
+		}
+
+		public KeyPair getKeyPair() {
+			return this.keyPair;
+		}
+	}
+
+	public KeyStoreLoader() {
+	}
+
+	public void setType(final String type) {
+		this.type = type != null ? type : DEFAULT_KEY_STORE_TYPE;
+	}
+
+	public String getType() {
+		return this.type;
+	}
+
+	public void setUrl(final URL url) {
+		this.url = url;
+	}
+
+	public URL getUrl() {
+		return this.url;
+	}
+
+	public void setUrl(final String url) throws MalformedURLException {
+		this.url = new URL(url);
+	}
+
+	public void setKeyStorePassword(final String keyStorePassword) {
+		this.keyStorePassword = keyStorePassword;
+	}
+
+	public String getKeyStorePassword() {
+		return this.keyStorePassword;
+	}
+
+	public void setKeyPassword(final String keyPassword) {
+		this.keyPassword = keyPassword;
+	}
+
+	public String getKeyPassword() {
+		return this.keyPassword;
+	}
+
+	public void setKeyAlias(final String keyAlias) {
+		this.keyAlias = keyAlias;
+	}
+
+	public String getKeyAlias() {
+		return this.keyAlias;
+	}
+
+	public Result load() throws GeneralSecurityException, IOException {
+
+		final KeyStore keyStore = KeyStore.getInstance(this.type);
+
+		try (InputStream stream = this.url.openStream()) {
+			keyStore.load(stream, this.keyStorePassword != null ? this.keyStorePassword.toCharArray() : null);
+		}
+
+		String effectiveKeyAlias = this.keyAlias;
+
+		if (effectiveKeyAlias == null) {
+			if (keyStore.size() != 1) {
+				throw new IllegalArgumentException(
+						"Key store contains more than one key. The use of the 'keyAlias' parameter is required.");
+			}
+			try {
+				effectiveKeyAlias = keyStore.aliases().nextElement();
+			} catch (final NoSuchElementException e) {
+				throw new RuntimeException("Failed to enumerate key alias", e);
+			}
+		}
+
+		final Key privateKey = keyStore.getKey(effectiveKeyAlias,
+				this.keyPassword != null ? this.keyPassword.toCharArray() : null);
+
+		if (privateKey instanceof PrivateKey) {
+			final X509Certificate certificate = (X509Certificate) keyStore.getCertificate(effectiveKeyAlias);
+			if (certificate == null) {
+				return null;
+			}
+
+			final PublicKey publicKey = certificate.getPublicKey();
+			final KeyPair keyPair = new KeyPair(publicKey, (PrivateKey) privateKey);
+			return new Result(certificate, keyPair);
+		}
+
+		return null;
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
new file mode 100644
index 0000000..8383d7c
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo;
+
+import org.apache.camel.impl.DefaultMessage;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+
+public final class Messages {
+	private Messages() {
+	}
+
+	/**
+	 * Fill a Message from a DataValue
+	 *
+	 * @param value
+	 *            the value to feed from
+	 * @param result
+	 *            the result to feed to
+	 */
+	public static void fillFromDataValue(final DataValue value, final DefaultMessage result) {
+		result.setBody(value);
+		result.setFault(value.getStatusCode().isBad());
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
new file mode 100644
index 0000000..f16bbdc
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo;
+
+import static java.util.Objects.requireNonNull;
+
+import java.io.Serializable;
+
+import org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort;
+
+public class NamespaceId {
+	private final String uri;
+	private final UShort numeric;
+
+	public NamespaceId(final String uri) {
+		requireNonNull(uri);
+
+		this.uri = uri;
+		this.numeric = null;
+	}
+
+	public NamespaceId(final UShort numeric) {
+		requireNonNull(numeric);
+
+		this.uri = null;
+		this.numeric = numeric;
+	}
+
+	public String getUri() {
+		return this.uri;
+	}
+
+	public UShort getNumeric() {
+		return this.numeric;
+	}
+
+	public boolean isNumeric() {
+		return this.numeric != null;
+	}
+
+	@Override
+	public String toString() {
+		if (isNumeric()) {
+			return String.format("[Namespace - numeric: %s]", this.numeric);
+		} else {
+			return String.format("[Namespace - URI: %s]", this.uri);
+		}
+	}
+
+	public Serializable getValue() {
+		return this.uri != null ? this.uri : this.numeric;
+	}
+
+	public static NamespaceId fromExpandedNodeId(final ExpandedNodeId id) {
+		if (id == null) {
+			return null;
+		}
+
+		if (id.getNamespaceUri() != null) {
+			return new NamespaceId(id.getNamespaceUri());
+		}
+		if (id.getNamespaceIndex() != null) {
+			return new NamespaceId(id.getNamespaceIndex());
+		}
+
+		throw new IllegalStateException(String.format("Unknown namespace type"));
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
new file mode 100644
index 0000000..0f3defd
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo;
+
+import static java.util.Objects.requireNonNull;
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ushort;
+
+import java.io.Serializable;
+import java.util.UUID;
+
+import org.eclipse.milo.opcua.stack.core.types.builtin.ByteString;
+import org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId;
+import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort;
+import org.eclipse.milo.opcua.stack.core.types.enumerated.IdType;
+
+import com.google.common.base.MoreObjects;
+
+public class PartialNodeId {
+
+	private IdType type;
+
+	private final Serializable id;
+
+	public PartialNodeId(final int id) {
+		this(uint(id));
+	}
+
+	public PartialNodeId(final UInteger id) {
+		requireNonNull(id);
+		this.id = id;
+	}
+
+	public PartialNodeId(final String id) {
+		requireNonNull(id);
+		this.id = id;
+	}
+
+	public PartialNodeId(final UUID id) {
+		requireNonNull(id);
+		this.id = id;
+	}
+
+	public PartialNodeId(final ByteString id) {
+		requireNonNull(id);
+		this.id = id;
+	}
+
+	public NodeId toNodeId(final int namespaceIndex) {
+		if (this.id instanceof String) {
+			return new NodeId(namespaceIndex, (String) this.id);
+		} else if (this.id instanceof UInteger) {
+			return new NodeId(ushort(namespaceIndex), (UInteger) this.id);
+		} else if (this.id instanceof ByteString) {
+			return new NodeId(namespaceIndex, (ByteString) this.id);
+		} else if (this.id instanceof UUID) {
+			return new NodeId(namespaceIndex, (UUID) this.id);
+		}
+		throw new IllegalStateException("Invalid id type: " + this.id);
+	}
+
+	public NodeId toNodeId(final UShort namespaceIndex) {
+		if (this.id instanceof String) {
+			return new NodeId(namespaceIndex, (String) this.id);
+		} else if (this.id instanceof UInteger) {
+			return new NodeId(namespaceIndex, (UInteger) this.id);
+		} else if (this.id instanceof ByteString) {
+			return new NodeId(namespaceIndex, (ByteString) this.id);
+		} else if (this.id instanceof UUID) {
+			return new NodeId(namespaceIndex, (UUID) this.id);
+		}
+		throw new IllegalStateException("Invalid id type: " + this.id);
+	}
+
+	@Override
+	public String toString() {
+		return MoreObjects.toStringHelper(this).add("type", this.type).add("id", this.id).toString();
+	}
+
+	public Serializable getValue() {
+		return this.id;
+	}
+
+	public static PartialNodeId fromExpandedNodeId(final ExpandedNodeId node) {
+		if (node == null) {
+			return null;
+		}
+
+		final Object value = node.getIdentifier();
+
+		if (value instanceof String) {
+			return new PartialNodeId((String) value);
+		} else if (value instanceof UInteger) {
+			return new PartialNodeId((UInteger) value);
+		} else if (value instanceof UUID) {
+			return new PartialNodeId((UUID) value);
+		} else if (value instanceof ByteString) {
+			return new PartialNodeId((ByteString) value);
+		}
+
+		throw new IllegalStateException(String.format("Unknown node id type: " + value));
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
new file mode 100644
index 0000000..2824e3e
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.client;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.Consumer;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.component.milo.KeyStoreLoader;
+import org.apache.camel.component.milo.KeyStoreLoader.Result;
+import org.apache.camel.impl.DefaultComponent;
+import org.eclipse.milo.opcua.sdk.client.api.config.OpcUaClientConfigBuilder;
+import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.Multimap;
+
+public class MiloClientComponent extends DefaultComponent {
+
+	private static final Logger LOG = LoggerFactory.getLogger(MiloClientComponent.class);
+
+	private final Map<String, MiloClientConnection> cache = new HashMap<>();
+	private final Multimap<String, MiloClientEndpoint> connectionMap = HashMultimap.create();
+
+	private MiloClientConfiguration defaultConfiguration = new MiloClientConfiguration();
+
+	@Override
+	protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters)
+			throws Exception {
+
+		final MiloClientConfiguration configuration = new MiloClientConfiguration(this.defaultConfiguration);
+		configuration.setEndpointUri(remaining);
+		setProperties(configuration, parameters);
+
+		return createEndpoint(uri, configuration, parameters);
+	}
+
+	private synchronized MiloClientEndpoint createEndpoint(final String uri,
+			final MiloClientConfiguration configuration, final Map<String, Object> parameters) throws Exception {
+
+		MiloClientConnection connection = this.cache.get(configuration.toCacheId());
+
+		if (connection == null) {
+			LOG.info("Cache miss - creating new connection instance: {}", configuration.toCacheId());
+
+			connection = new MiloClientConnection(configuration, mapToClientConfiguration(configuration));
+			this.cache.put(configuration.toCacheId(), connection);
+		}
+
+		final MiloClientEndpoint endpoint = new MiloClientEndpoint(uri, this, connection,
+				configuration.getEndpointUri());
+
+		setProperties(endpoint, parameters);
+
+		// register connection with endpoint
+
+		this.connectionMap.put(configuration.toCacheId(), endpoint);
+
+		return endpoint;
+	}
+
+	private OpcUaClientConfigBuilder mapToClientConfiguration(final MiloClientConfiguration configuration) {
+		final OpcUaClientConfigBuilder builder = new OpcUaClientConfigBuilder();
+
+		whenHasText(configuration::getApplicationName,
+				value -> builder.setApplicationName(LocalizedText.english(value)));
+		whenHasText(configuration::getApplicationUri, builder::setApplicationUri);
+		whenHasText(configuration::getProductUri, builder::setProductUri);
+
+		if (configuration.getRequestTimeout() != null) {
+			builder.setRequestTimeout(Unsigned.uint(configuration.getRequestTimeout()));
+		}
+		if (configuration.getChannelLifetime() != null) {
+			builder.setChannelLifetime(Unsigned.uint(configuration.getChannelLifetime()));
+		}
+
+		whenHasText(configuration::getSessionName, value -> builder.setSessionName(() -> value));
+		if (configuration.getSessionTimeout() != null) {
+			builder.setSessionTimeout(UInteger.valueOf(configuration.getSessionTimeout()));
+		}
+
+		if (configuration.getMaxPendingPublishRequests() != null) {
+			builder.setMaxPendingPublishRequests(UInteger.valueOf(configuration.getMaxPendingPublishRequests()));
+		}
+
+		if (configuration.getMaxResponseMessageSize() != null) {
+			builder.setMaxResponseMessageSize(UInteger.valueOf(configuration.getMaxPendingPublishRequests()));
+		}
+
+		if (configuration.getSecureChannelReauthenticationEnabled() != null) {
+			builder.setSecureChannelReauthenticationEnabled(configuration.getSecureChannelReauthenticationEnabled());
+		}
+
+		if (configuration.getKeyStoreUrl() != null) {
+			setKey(configuration, builder);
+		}
+
+		return builder;
+	}
+
+	private void setKey(final MiloClientConfiguration configuration, final OpcUaClientConfigBuilder builder) {
+		final KeyStoreLoader loader = new KeyStoreLoader();
+
+		final Result result;
+		try {
+			// key store properties
+			loader.setType(configuration.getKeyStoreType());
+			loader.setUrl(configuration.getKeyStoreUrl());
+			loader.setKeyStorePassword(configuration.getKeyStorePassword());
+
+			// key properties
+			loader.setKeyAlias(configuration.getKeyAlias());
+			loader.setKeyPassword(configuration.getKeyPassword());
+
+			result = loader.load();
+		} catch (GeneralSecurityException | IOException e) {
+			throw new IllegalStateException("Failed to load key", e);
+		}
+
+		if (result == null) {
+			throw new IllegalStateException("Key not found in keystore");
+		}
+
+		builder.setCertificate(result.getCertificate());
+		builder.setKeyPair(result.getKeyPair());
+	}
+
+	private void whenHasText(final Supplier<String> valueSupplier, final Consumer<String> valueConsumer) {
+		final String value = valueSupplier.get();
+		if (value != null && !value.isEmpty()) {
+			valueConsumer.accept(value);
+		}
+	}
+
+	/**
+	 * All default options for client
+	 */
+	public void setDefaultConfiguration(final MiloClientConfiguration defaultConfiguration) {
+		this.defaultConfiguration = defaultConfiguration;
+	}
+
+	/**
+	 * Default application name
+	 */
+	public void setApplicationName(final String applicationName) {
+		this.defaultConfiguration.setApplicationName(applicationName);
+	}
+
+	/**
+	 * Default application URI
+	 */
+	public void setApplicationUri(final String applicationUri) {
+		this.defaultConfiguration.setApplicationUri(applicationUri);
+	}
+
+	/**
+	 * Default product URI
+	 */
+	public void setProductUri(final String productUri) {
+		this.defaultConfiguration.setProductUri(productUri);
+	}
+
+	/**
+	 * Default reconnect timeout
+	 */
+	public void setReconnectTimeout(final Long reconnectTimeout) {
+		this.defaultConfiguration.setRequestTimeout(reconnectTimeout);
+	}
+
+	public synchronized void disposed(final MiloClientEndpoint endpoint) {
+
+		final MiloClientConnection connection = endpoint.getConnection();
+
+		// unregister usage of connection
+
+		this.connectionMap.remove(connection.getConnectionId(), endpoint);
+
+		// test if this was the last endpoint using this connection
+
+		if (!this.connectionMap.containsKey(connection.getConnectionId())) {
+
+			// this was the last endpoint using the connection ...
+
+			// ... remove from the cache
+
+			this.cache.remove(connection.getConnectionId());
+
+			// ... and close
+
+			try {
+				connection.close();
+			} catch (final Exception e) {
+				LOG.warn("Failed to close connection", e);
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
new file mode 100644
index 0000000..cf9905e
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
@@ -0,0 +1,292 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.camel.component.milo.KeyStoreLoader;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+
+@UriParams
+public class MiloClientConfiguration implements Cloneable {
+
+	private static final String DEFAULT_APPLICATION_URI = "http://camel.apache.org/EclipseMilo/Client";
+
+	private static final String DEFAULT_APPLICATION_NAME = "Apache Camel adapter for Eclipse Milo";
+
+	private static final String DEFAULT_PRODUCT_URI = "http://camel.apache.org/EclipseMilo";
+
+	private String endpointUri;
+
+	@UriParam
+	private String clientId;
+
+	@UriParam(label = "client", defaultValue = DEFAULT_APPLICATION_NAME)
+	private String applicationName = DEFAULT_APPLICATION_NAME;
+
+	@UriParam(label = "client", defaultValue = DEFAULT_APPLICATION_URI)
+	private String applicationUri = DEFAULT_APPLICATION_URI;
+
+	@UriParam(label = "client", defaultValue = DEFAULT_PRODUCT_URI)
+	private String productUri = DEFAULT_PRODUCT_URI;
+
+	@UriParam(label = "client")
+	private Long requestTimeout;
+
+	@UriParam(label = "client")
+	private Long channelLifetime;
+
+	@UriParam(label = "client")
+	private String sessionName;
+
+	@UriParam(label = "client")
+	private Long sessionTimeout;
+
+	@UriParam(label = "client")
+	private Long maxPendingPublishRequests;
+
+	@UriParam(label = "client")
+	private Long maxResponseMessageSize;
+
+	@UriParam(label = "client")
+	private Boolean secureChannelReauthenticationEnabled;
+
+	@UriParam(label = "client")
+	private URL keyStoreUrl;
+
+	@UriParam(label = "client")
+	private String keyStoreType = KeyStoreLoader.DEFAULT_KEY_STORE_TYPE;
+
+	@UriParam(label = "client")
+	private String keyAlias;
+
+	@UriParam(label = "client")
+	private String keyStorePassword;
+
+	@UriParam(label = "client")
+	private String keyPassword;
+
+	public MiloClientConfiguration() {
+	}
+
+	public MiloClientConfiguration(final MiloClientConfiguration other) {
+		this.clientId = other.clientId;
+		this.endpointUri = other.endpointUri;
+		this.applicationName = other.applicationName;
+		this.productUri = other.productUri;
+		this.requestTimeout = other.requestTimeout;
+	}
+
+	public void setEndpointUri(final String endpointUri) {
+		this.endpointUri = endpointUri;
+	}
+
+	public String getEndpointUri() {
+		return this.endpointUri;
+	}
+
+	/**
+	 * A virtual client id to force the creation of a new connection instance
+	 */
+	public void setClientId(final String clientId) {
+		this.clientId = clientId;
+	}
+
+	public String getClientId() {
+		return this.clientId;
+	}
+
+	/**
+	 * The application name
+	 */
+	public void setApplicationName(final String applicationName) {
+		this.applicationName = applicationName;
+	}
+
+	public String getApplicationName() {
+		return this.applicationName;
+	}
+
+	/**
+	 * The application URI
+	 */
+	public void setApplicationUri(final String applicationUri) {
+		this.applicationUri = applicationUri;
+	}
+
+	public String getApplicationUri() {
+		return this.applicationUri;
+	}
+
+	/**
+	 * The product URI
+	 */
+	public void setProductUri(final String productUri) {
+		this.productUri = productUri;
+	}
+
+	public String getProductUri() {
+		return this.productUri;
+	}
+
+	/**
+	 * Request timeout in milliseconds
+	 */
+	public void setRequestTimeout(final Long reconnectTimeout) {
+		this.requestTimeout = reconnectTimeout;
+	}
+
+	public Long getRequestTimeout() {
+		return this.requestTimeout;
+	}
+
+	/**
+	 * Channel lifetime in milliseconds
+	 */
+	public void setChannelLifetime(final Long channelLifetime) {
+		this.channelLifetime = channelLifetime;
+	}
+
+	public Long getChannelLifetime() {
+		return this.channelLifetime;
+	}
+
+	/**
+	 * Session name
+	 */
+	public void setSessionName(final String sessionName) {
+		this.sessionName = sessionName;
+	}
+
+	public String getSessionName() {
+		return this.sessionName;
+	}
+
+	/**
+	 * Session timeout in milliseconds
+	 */
+	public void setSessionTimeout(final Long sessionTimeout) {
+		this.sessionTimeout = sessionTimeout;
+	}
+
+	public Long getSessionTimeout() {
+		return this.sessionTimeout;
+	}
+
+	/**
+	 * The maximum number of pending publish requests
+	 */
+	public void setMaxPendingPublishRequests(final Long maxPendingPublishRequests) {
+		this.maxPendingPublishRequests = maxPendingPublishRequests;
+	}
+
+	public Long getMaxPendingPublishRequests() {
+		return this.maxPendingPublishRequests;
+	}
+
+	/**
+	 * The maximum number of bytes a response message may have
+	 */
+	public void setMaxResponseMessageSize(final Long maxResponseMessageSize) {
+		this.maxResponseMessageSize = maxResponseMessageSize;
+	}
+
+	public Long getMaxResponseMessageSize() {
+		return this.maxResponseMessageSize;
+	}
+
+	/**
+	 * Whether secure channel re-authentication is enabled
+	 */
+	public void setSecureChannelReauthenticationEnabled(final Boolean secureChannelReauthenticationEnabled) {
+		this.secureChannelReauthenticationEnabled = secureChannelReauthenticationEnabled;
+	}
+
+	public Boolean getSecureChannelReauthenticationEnabled() {
+		return this.secureChannelReauthenticationEnabled;
+	}
+
+	/**
+	 * The URL where the key should be loaded from
+	 */
+	public void setKeyStoreUrl(final String keyStoreUrl) throws MalformedURLException {
+		this.keyStoreUrl = keyStoreUrl != null ? new URL(keyStoreUrl) : null;
+	}
+
+	public URL getKeyStoreUrl() {
+		return this.keyStoreUrl;
+	}
+
+	/**
+	 * The key store type
+	 */
+	public void setKeyStoreType(final String keyStoreType) {
+		this.keyStoreType = keyStoreType;
+	}
+
+	public String getKeyStoreType() {
+		return this.keyStoreType;
+	}
+
+	/**
+	 * The name of the key in the keystore file
+	 */
+	public void setKeyAlias(final String keyAlias) {
+		this.keyAlias = keyAlias;
+	}
+
+	public String getKeyAlias() {
+		return this.keyAlias;
+	}
+
+	/**
+	 * The keystore password
+	 */
+	public void setKeyStorePassword(final String keyStorePassword) {
+		this.keyStorePassword = keyStorePassword;
+	}
+
+	public String getKeyStorePassword() {
+		return this.keyStorePassword;
+	}
+
+	/**
+	 * The key password
+	 */
+	public void setKeyPassword(final String keyPassword) {
+		this.keyPassword = keyPassword;
+	}
+
+	public String getKeyPassword() {
+		return this.keyPassword;
+	}
+
+	@Override
+	public MiloClientConfiguration clone() {
+		return new MiloClientConfiguration(this);
+	}
+
+	public String toCacheId() {
+		if (this.clientId != null && !this.clientId.isEmpty()) {
+			return this.endpointUri + "|" + this.clientId;
+		} else {
+			return this.endpointUri;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
new file mode 100644
index 0000000..bc67c88
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.client;
+
+import static java.util.Objects.requireNonNull;
+
+import java.util.function.Consumer;
+
+import org.apache.camel.component.milo.NamespaceId;
+import org.apache.camel.component.milo.PartialNodeId;
+import org.apache.camel.component.milo.client.internal.SubscriptionManager;
+import org.eclipse.milo.opcua.sdk.client.api.config.OpcUaClientConfigBuilder;
+import org.eclipse.milo.opcua.stack.core.Stack;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
+
+public class MiloClientConnection implements AutoCloseable {
+
+	private final MiloClientConfiguration configuration;
+
+	private SubscriptionManager manager;
+
+	private boolean initialized;
+
+	private final OpcUaClientConfigBuilder clientConfiguration;
+
+	public MiloClientConnection(final MiloClientConfiguration configuration,
+			final OpcUaClientConfigBuilder clientConfiguration) {
+		requireNonNull(configuration);
+
+		// make a copy since the configuration is mutable
+		this.configuration = configuration.clone();
+		this.clientConfiguration = clientConfiguration;
+	}
+
+	protected void init() throws Exception {
+		this.manager = new SubscriptionManager(this.configuration, this.clientConfiguration,
+				Stack.sharedScheduledExecutor(), 10_000);
+	}
+
+	@Override
+	public void close() throws Exception {
+		if (this.manager != null) {
+			this.manager.dispose();
+			this.manager = null;
+		}
+	}
+
+	protected synchronized void checkInit() {
+		if (this.initialized) {
+			return;
+		}
+
+		try {
+			init();
+		} catch (final Exception e) {
+			throw new RuntimeException(e);
+		}
+		this.initialized = true;
+	}
+
+	@FunctionalInterface
+	public interface MonitorHandle {
+		public void unregister();
+	}
+
+	public MonitorHandle monitorValue(final MiloClientItemConfiguration configuration,
+			final Consumer<DataValue> valueConsumer) {
+
+		requireNonNull(configuration);
+		requireNonNull(valueConsumer);
+
+		checkInit();
+
+		final NamespaceId namespaceId = configuration.makeNamespaceId();
+		final PartialNodeId partialNodeId = configuration.makePartialNodeId();
+
+		final UInteger handle = this.manager.registerItem(namespaceId, partialNodeId,
+				configuration.getSamplingInterval(), valueConsumer);
+
+		return () -> MiloClientConnection.this.manager.unregisterItem(handle);
+	}
+
+	public String getConnectionId() {
+		return this.configuration.toCacheId();
+	}
+
+	public void writeValue(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final Object value,
+			final boolean await) {
+		checkInit();
+
+		this.manager.write(namespaceId, partialNodeId, mapValue(value), await);
+	}
+
+	/**
+	 * Map the incoming value to some value writable to the milo client
+	 *
+	 * @param value
+	 *            the incoming value
+	 * @return the outgoing value
+	 */
+	private DataValue mapValue(final Object value) {
+		if (value instanceof DataValue) {
+			return (DataValue) value;
+		}
+		if (value instanceof Variant) {
+			return new DataValue((Variant) value);
+		}
+		return new DataValue(new Variant(value));
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
new file mode 100644
index 0000000..b0e5d75
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.client;
+
+import java.util.Objects;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.Processor;
+import org.apache.camel.component.milo.Messages;
+import org.apache.camel.component.milo.client.MiloClientConnection.MonitorHandle;
+import org.apache.camel.impl.DefaultConsumer;
+import org.apache.camel.impl.DefaultMessage;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MiloClientConsumer extends DefaultConsumer {
+
+	private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);
+
+	private final MiloClientConnection connection;
+
+	private final MiloClientItemConfiguration configuration;
+
+	private MonitorHandle handle;
+
+	public MiloClientConsumer(final MiloClientEndpoint endpoint, final Processor processor,
+			final MiloClientConnection connection, final MiloClientItemConfiguration configuration) {
+		super(endpoint, processor);
+
+		Objects.requireNonNull(connection);
+		Objects.requireNonNull(configuration);
+
+		this.connection = connection;
+		this.configuration = configuration;
+	}
+
+	@Override
+	protected void doStart() throws Exception {
+		super.doStart();
+
+		this.handle = this.connection.monitorValue(this.configuration, this::handleValueUpdate);
+	}
+
+	@Override
+	protected void doStop() throws Exception {
+		if (this.handle != null) {
+			this.handle.unregister();
+			this.handle = null;
+		}
+
+		super.doStop();
+	}
+
+	private void handleValueUpdate(final DataValue value) {
+		final Exchange exchange = getEndpoint().createExchange();
+		exchange.setIn(mapMessage(value));
+		try {
+			getAsyncProcessor().process(exchange);
+		} catch (final Exception e) {
+			LOG.debug("Failed to process message", e);
+		}
+	}
+
+	private Message mapMessage(final DataValue value) {
+		if (value == null) {
+			return null;
+		}
+
+		final DefaultMessage result = new DefaultMessage();
+
+		Messages.fillFromDataValue(value, result);
+
+		return result;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
new file mode 100644
index 0000000..3e0742d
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
@@ -0,0 +1,242 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.client;
+
+import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ushort;
+
+import java.util.Objects;
+
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.component.milo.NamespaceId;
+import org.apache.camel.component.milo.PartialNodeId;
+import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
+import org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId;
+
+@UriEndpoint(scheme = "milo-client", syntax = "milo-client:tcp://user:password@host:port/path/to/service?itemId=item.id&namespaceUri=urn:foo:bar", title = "Milo based OPC UA Client", consumerClass = MiloClientConsumer.class, label = "iot")
+public class MiloClientEndpoint extends DefaultEndpoint implements MiloClientItemConfiguration {
+
+	/**
+	 * The OPC UA server endpoint
+	 */
+	@UriPath
+	@Metadata(required = "true")
+	private final String endpointUri;
+
+	/**
+	 * The node ID as string ID **deprecated**
+	 *
+	 * @deprecated Use "node" instead
+	 */
+	@UriParam
+	@Deprecated
+	private String nodeId;
+
+	/**
+	 * The namespace as URI **deprecated**
+	 *
+	 * @deprecated Use "node" instead
+	 */
+	@UriParam
+	@Deprecated
+	private String namespaceUri;
+
+	/**
+	 * The namespace as numeric index **deprecated**
+	 *
+	 * @deprecated Use "node" instead
+	 */
+	@UriParam
+	@Deprecated
+	private Integer namespaceIndex;
+
+	/**
+	 * The node definition (see Node ID)
+	 */
+	@UriParam
+	private ExpandedNodeId node;
+
+	/**
+	 * The sampling interval in milliseconds
+	 */
+	@UriParam
+	private Double samplingInterval;
+
+	/**
+	 * The client configuration
+	 */
+	@UriParam
+	private MiloClientConfiguration client;
+
+	/**
+	 * Default "await" setting for writes
+	 */
+	@UriParam
+	private boolean defaultAwaitWrites = false;
+
+	private final MiloClientConnection connection;
+	private final MiloClientComponent component;
+
+	public MiloClientEndpoint(final String uri, final MiloClientComponent component,
+			final MiloClientConnection connection, final String endpointUri) {
+		super(uri, component);
+
+		Objects.requireNonNull(component);
+		Objects.requireNonNull(connection);
+		Objects.requireNonNull(endpointUri);
+
+		this.endpointUri = endpointUri;
+
+		this.component = component;
+		this.connection = connection;
+	}
+
+	@Override
+	protected void doStart() throws Exception {
+		super.doStart();
+	}
+
+	@Override
+	protected void doStop() throws Exception {
+		this.component.disposed(this);
+		super.doStop();
+	}
+
+	@Override
+	public Producer createProducer() throws Exception {
+		return new MiloClientProducer(this, this.connection, this, this.defaultAwaitWrites);
+	}
+
+	@Override
+	public Consumer createConsumer(final Processor processor) throws Exception {
+		return new MiloClientConsumer(this, processor, this.connection, this);
+	}
+
+	@Override
+	public boolean isSingleton() {
+		return true;
+	}
+
+	public MiloClientConnection getConnection() {
+		return this.connection;
+	}
+
+	// item configuration
+
+	@Override
+	public PartialNodeId makePartialNodeId() {
+		PartialNodeId result = null;
+
+		if (this.node != null) {
+			result = PartialNodeId.fromExpandedNodeId(this.node);
+		}
+
+		if (result == null && this.nodeId != null) {
+			result = new PartialNodeId(this.nodeId);
+		}
+
+		if (result == null) {
+			throw new IllegalStateException("Missing or invalid node id configuration");
+		} else {
+			return result;
+		}
+	}
+
+	@Override
+	public NamespaceId makeNamespaceId() {
+		NamespaceId result = null;
+
+		if (this.node != null) {
+			result = NamespaceId.fromExpandedNodeId(this.node);
+		}
+
+		if (result == null && this.namespaceIndex != null) {
+			result = new NamespaceId(ushort(this.namespaceIndex));
+		}
+		if (result == null && this.namespaceUri != null) {
+			result = new NamespaceId(this.namespaceUri);
+		}
+
+		if (result == null) {
+			throw new IllegalStateException("Missing or invalid node id configuration");
+		} else {
+			return result;
+		}
+	}
+
+	public String getNodeId() {
+		return this.nodeId;
+	}
+
+	public void setNodeId(final String nodeId) {
+		this.nodeId = nodeId;
+	}
+
+	public String getNamespaceUri() {
+		return this.namespaceUri;
+	}
+
+	public void setNamespaceUri(final String namespaceUri) {
+		this.namespaceUri = namespaceUri;
+	}
+
+	public Integer getNamespaceIndex() {
+		return this.namespaceIndex;
+	}
+
+	public void setNamespaceIndex(final int namespaceIndex) {
+		this.namespaceIndex = namespaceIndex;
+	}
+
+	public void setNode(final String node) {
+		if (node == null) {
+			this.node = null;
+		} else {
+			this.node = ExpandedNodeId.parse(node);
+		}
+	}
+
+	public String getNode() {
+		if (this.node != null) {
+			return this.node.toParseableString();
+		} else {
+			return null;
+		}
+	}
+
+	@Override
+	public Double getSamplingInterval() {
+		return this.samplingInterval;
+	}
+
+	public void setSamplingInterval(final Double samplingInterval) {
+		this.samplingInterval = samplingInterval;
+	}
+
+	public boolean isDefaultAwaitWrites() {
+		return this.defaultAwaitWrites;
+	}
+
+	public void setDefaultAwaitWrites(final boolean defaultAwaitWrites) {
+		this.defaultAwaitWrites = defaultAwaitWrites;
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
new file mode 100644
index 0000000..8664ef7
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.client;
+
+import org.apache.camel.component.milo.NamespaceId;
+import org.apache.camel.component.milo.PartialNodeId;
+
+public interface MiloClientItemConfiguration {
+	public NamespaceId makeNamespaceId();
+
+	public PartialNodeId makePartialNodeId();
+
+	public Double getSamplingInterval();
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
new file mode 100644
index 0000000..edc5718
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.client;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.component.milo.NamespaceId;
+import org.apache.camel.component.milo.PartialNodeId;
+import org.apache.camel.impl.DefaultProducer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MiloClientProducer extends DefaultProducer {
+
+	private static final Logger LOG = LoggerFactory.getLogger(MiloClientProducer.class);
+
+	private final MiloClientConnection connection;
+
+	private final NamespaceId namespaceId;
+
+	private final PartialNodeId partialNodeId;
+
+	private final boolean defaultAwaitWrites;
+
+	public MiloClientProducer(final Endpoint endpoint, final MiloClientConnection connection,
+			final MiloClientItemConfiguration configuration, final boolean defaultAwaitWrites) {
+		super(endpoint);
+
+		this.connection = connection;
+		this.defaultAwaitWrites = defaultAwaitWrites;
+
+		this.namespaceId = configuration.makeNamespaceId();
+		this.partialNodeId = configuration.makePartialNodeId();
+	}
+
+	@Override
+	public void process(final Exchange exchange) throws Exception {
+		final Message msg = exchange.getIn();
+		final Object value = msg.getBody();
+
+		LOG.debug("Processing message: {}", value);
+
+		final Boolean await = msg.getHeader("await", this.defaultAwaitWrites, Boolean.class);
+
+		this.connection.writeValue(this.namespaceId, this.partialNodeId, value, await != null ? await : false);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
new file mode 100644
index 0000000..95acfe4
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
@@ -0,0 +1,570 @@
+/*
+ * Copyright (C) 2016, 2017 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.client.internal;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Consumer;
+
+import org.apache.camel.component.milo.NamespaceId;
+import org.apache.camel.component.milo.PartialNodeId;
+import org.apache.camel.component.milo.client.MiloClientConfiguration;
+import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
+import org.eclipse.milo.opcua.sdk.client.api.config.OpcUaClientConfigBuilder;
+import org.eclipse.milo.opcua.sdk.client.api.identity.AnonymousProvider;
+import org.eclipse.milo.opcua.sdk.client.api.identity.CompositeProvider;
+import org.eclipse.milo.opcua.sdk.client.api.identity.IdentityProvider;
+import org.eclipse.milo.opcua.sdk.client.api.identity.UsernameProvider;
+import org.eclipse.milo.opcua.sdk.client.api.subscriptions.UaMonitoredItem;
+import org.eclipse.milo.opcua.sdk.client.api.subscriptions.UaSubscription;
+import org.eclipse.milo.opcua.sdk.client.api.subscriptions.UaSubscriptionManager.SubscriptionListener;
+import org.eclipse.milo.opcua.stack.client.UaTcpStackClient;
+import org.eclipse.milo.opcua.stack.core.AttributeId;
+import org.eclipse.milo.opcua.stack.core.Identifiers;
+import org.eclipse.milo.opcua.stack.core.StatusCodes;
+import org.eclipse.milo.opcua.stack.core.UaException;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DateTime;
+import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
+import org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName;
+import org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort;
+import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned;
+import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode;
+import org.eclipse.milo.opcua.stack.core.types.enumerated.TimestampsToReturn;
+import org.eclipse.milo.opcua.stack.core.types.structured.EndpointDescription;
+import org.eclipse.milo.opcua.stack.core.types.structured.MonitoredItemCreateRequest;
+import org.eclipse.milo.opcua.stack.core.types.structured.MonitoringParameters;
+import org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SubscriptionManager {
+
+	private final static Logger LOG = LoggerFactory.getLogger(SubscriptionManager.class);
+
+	private final AtomicLong clientHandleCounter = new AtomicLong(0);
+
+	private final class SubscriptionListenerImpl implements SubscriptionListener {
+		@Override
+		public void onSubscriptionTransferFailed(final UaSubscription subscription, final StatusCode statusCode) {
+			LOG.info("Transfer failed {} : {}", subscription.getSubscriptionId(), statusCode);
+
+			// we simply tear it down and build it up again
+			handleConnectionFailue(new RuntimeException("Subscription failed to reconnect"));
+		}
+
+		@Override
+		public void onStatusChanged(final UaSubscription subscription, final StatusCode status) {
+			LOG.info("Subscription status changed {} : {}", subscription.getSubscriptionId(), status);
+		}
+
+		@Override
+		public void onPublishFailure(final UaException exception) {
+		}
+
+		@Override
+		public void onNotificationDataLost(final UaSubscription subscription) {
+		}
+
+		@Override
+		public void onKeepAlive(final UaSubscription subscription, final DateTime publishTime) {
+		}
+	}
+
+	public interface Worker<T> {
+		public void work(T on) throws Exception;
+	}
+
+	private static class Subscription {
+		private final NamespaceId namespaceId;
+		private final PartialNodeId partialNodeId;
+		private final Double samplingInterval;
+
+		private final Consumer<DataValue> valueConsumer;
+
+		public Subscription(final NamespaceId namespaceId, final PartialNodeId partialNodeId,
+				final Double samplingInterval, final Consumer<DataValue> valueConsumer) {
+			this.namespaceId = namespaceId;
+			this.partialNodeId = partialNodeId;
+			this.samplingInterval = samplingInterval;
+			this.valueConsumer = valueConsumer;
+		}
+
+		public NamespaceId getNamespaceId() {
+			return this.namespaceId;
+		}
+
+		public PartialNodeId getPartialNodeId() {
+			return this.partialNodeId;
+		}
+
+		public Double getSamplingInterval() {
+			return this.samplingInterval;
+		}
+
+		public Consumer<DataValue> getValueConsumer() {
+			return this.valueConsumer;
+		}
+	}
+
+	private class Connected {
+		private OpcUaClient client;
+		private final UaSubscription manager;
+
+		private final Map<UInteger, Subscription> badSubscriptions = new HashMap<>();
+
+		private final Map<UInteger, UaMonitoredItem> goodSubscriptions = new HashMap<>();
+
+		private final Map<String, UShort> namespaceCache = new ConcurrentHashMap<>();
+
+		public Connected(final OpcUaClient client, final UaSubscription manager) {
+			this.client = client;
+			this.manager = manager;
+		}
+
+		public void putSubscriptions(final Map<UInteger, Subscription> subscriptions) throws Exception {
+
+			if (subscriptions.isEmpty()) {
+				return;
+			}
+
+			// convert to requests
+
+			final List<MonitoredItemCreateRequest> items = new ArrayList<>(subscriptions.size());
+
+			for (final Map.Entry<UInteger, Subscription> entry : subscriptions.entrySet()) {
+				final Subscription s = entry.getValue();
+
+				UShort namespaceIndex;
+				if (s.getNamespaceId().isNumeric()) {
+					namespaceIndex = s.getNamespaceId().getNumeric();
+				} else {
+					namespaceIndex = lookupNamespace(s.getNamespaceId().getUri());
+				}
+
+				if (namespaceIndex == null) {
+					handleSubscriptionError(new StatusCode(StatusCodes.Bad_InvalidArgument), entry.getKey(), s);
+				} else {
+					final NodeId nodeId = s.getPartialNodeId().toNodeId(namespaceIndex);
+					final ReadValueId itemId = new ReadValueId(nodeId, AttributeId.Value.uid(), null,
+							QualifiedName.NULL_VALUE);
+					final MonitoringParameters parameters = new MonitoringParameters(entry.getKey(),
+							s.getSamplingInterval(), null, null, null);
+					items.add(new MonitoredItemCreateRequest(itemId, MonitoringMode.Reporting, parameters));
+				}
+			}
+
+			if (!items.isEmpty())
+
+			{
+
+				// create monitors
+
+				this.manager.createMonitoredItems(TimestampsToReturn.Both, items, (item, idx) -> {
+
+					// set value listener
+
+					final Subscription s = subscriptions.get(item.getClientHandle());
+
+					if (item.getStatusCode().isBad()) {
+						handleSubscriptionError(item.getStatusCode(), item.getClientHandle(), s);
+					} else {
+						this.goodSubscriptions.put(item.getClientHandle(), item);
+						item.setValueConsumer(s.getValueConsumer());
+					}
+
+				}).get();
+			}
+
+			if (!this.badSubscriptions.isEmpty()) {
+				SubscriptionManager.this.executor.schedule(this::resubscribe, SubscriptionManager.this.reconnectTimeout,
+						TimeUnit.MILLISECONDS);
+			}
+		}
+
+		private void handleSubscriptionError(final StatusCode statusCode, final UInteger clientHandle,
+				final Subscription s) {
+			this.badSubscriptions.put(clientHandle, s);
+			s.getValueConsumer().accept(new DataValue(statusCode));
+		}
+
+		private void resubscribe() {
+			final Map<UInteger, Subscription> subscriptions = new HashMap<>(this.badSubscriptions);
+			this.badSubscriptions.clear();
+			try {
+				putSubscriptions(subscriptions);
+			} catch (final Exception e) {
+				handleConnectionFailue(e);
+			}
+		}
+
+		public void activate(final UInteger clientHandle, final Subscription subscription) throws Exception {
+			putSubscriptions(Collections.singletonMap(clientHandle, subscription));
+		}
+
+		public void deactivate(final UInteger clientHandle) throws Exception {
+			final UaMonitoredItem item = this.goodSubscriptions.remove(clientHandle);
+			if (item != null) {
+				this.manager.deleteMonitoredItems(Collections.singletonList(item)).get();
+			} else {
+				this.badSubscriptions.remove(clientHandle);
+			}
+		}
+
+		private UShort lookupNamespace(final String namespaceUri) throws Exception {
+			return lookupNamespaceIndex(namespaceUri).get();
+		}
+
+		private CompletableFuture<UShort> lookupNamespaceIndex(final String namespaceUri) {
+
+			LOG.trace("Looking up namespace: {}", namespaceUri);
+
+			// check cache
+			{
+				final UShort result = this.namespaceCache.get(namespaceUri);
+				if (result != null) {
+					LOG.trace("Found namespace in cache: {} -> {}", namespaceUri, result);
+					return CompletableFuture.completedFuture(result);
+				}
+			}
+
+			/*
+			 * We always read the server side table since the cache did not help
+			 * us and the namespace might have been added to the server at a
+			 * later time.
+			 */
+
+			LOG.debug("Looking up namespace on server: {}", namespaceUri);
+
+			final CompletableFuture<DataValue> future = this.client.readValue(0, TimestampsToReturn.Neither,
+					Identifiers.Server_NamespaceArray);
+
+			return future.thenApply(value -> {
+				final Object rawValue = value.getValue().getValue();
+
+				if (rawValue instanceof String[]) {
+					final String[] namespaces = (String[]) rawValue;
+					for (int i = 0; i < namespaces.length; i++) {
+						if (namespaces[i].equals(namespaceUri)) {
+							final UShort result = Unsigned.ushort(i);
+							this.namespaceCache.putIfAbsent(namespaceUri, result);
+							return result;
+						}
+					}
+				}
+				return null;
+			});
+		}
+
+		public void dispose() {
+			if (this.client != null) {
+				this.client.disconnect();
+				this.client = null;
+			}
+		}
+
+		public CompletableFuture<StatusCode> write(final NamespaceId namespaceId, final PartialNodeId partialNodeId,
+				final DataValue value) {
+
+			final CompletableFuture<UShort> future;
+
+			LOG.trace("Namespace: {}", namespaceId);
+			if (namespaceId.isNumeric()) {
+				LOG.trace("Using provided index: {}", namespaceId.getNumeric());
+				future = CompletableFuture.completedFuture(namespaceId.getNumeric());
+			} else {
+				LOG.trace("Looking up namespace: {}", namespaceId.getUri());
+				future = lookupNamespaceIndex(namespaceId.getUri());
+			}
+
+			return future.thenCompose(index -> {
+
+				final NodeId nodeId = partialNodeId.toNodeId(index);
+				LOG.debug("Node - partial: {}, full: {}", partialNodeId, nodeId);
+
+				return this.client.writeValue(nodeId, value).whenComplete((status, error) -> {
+					if (status != null) {
+						LOG.debug("Write to ns={}/{}, id={} = {} -> {}", namespaceId, index, nodeId, value, status);
+					} else {
+						LOG.debug("Failed to write", error);
+					}
+				});
+
+			});
+		}
+
+	}
+
+	private final MiloClientConfiguration configuration;
+	private final OpcUaClientConfigBuilder clientBuilder;
+	private final ScheduledExecutorService executor;
+	private final long reconnectTimeout;
+
+	private Connected connected;
+	private boolean disposed;
+	private Future<?> reconnectJob;
+	private final Map<UInteger, Subscription> subscriptions = new HashMap<>();
+
+	public SubscriptionManager(final MiloClientConfiguration configuration,
+			final OpcUaClientConfigBuilder clientBuilder, final ScheduledExecutorService executor,
+			final long reconnectTimeout) {
+
+		this.configuration = configuration;
+		this.clientBuilder = clientBuilder;
+		this.executor = executor;
+		this.reconnectTimeout = reconnectTimeout;
+
+		connect();
+	}
+
+	private synchronized void handleConnectionFailue(final Throwable e) {
+		if (this.connected != null) {
+			this.connected.dispose();
+			this.connected = null;
+		}
+
+		// log
+
+		LOG.info("Connection failed", e);
+
+		// always trigger re-connect
+
+		triggerReconnect(true);
+	}
+
+	private void connect() {
+		LOG.info("Starting connect");
+
+		synchronized (this) {
+			this.reconnectJob = null;
+
+			if (this.disposed) {
+				// we woke up disposed
+				return;
+			}
+		}
+
+		try {
+			final Connected connected = performConnect();
+			LOG.debug("Connect call done");
+			synchronized (this) {
+				if (this.disposed) {
+					// we got disposed during connect
+					return;
+				}
+
+				try {
+					LOG.debug("Setting subscriptions: {}", this.subscriptions.size());
+					connected.putSubscriptions(this.subscriptions);
+
+					LOG.debug("Update state : {} -> {}", this.connected, connected);
+					final Connected oldConnected = this.connected;
+					this.connected = connected;
+
+					if (oldConnected != null) {
+						LOG.debug("Dispose old state");
+						oldConnected.dispose();
+					}
+
+				} catch (final Exception e) {
+					LOG.info("Failed to set subscriptions", e);
+					connected.dispose();
+					throw e;
+				}
+			}
+		} catch (final Exception e) {
+			LOG.info("Failed to connect", e);
+			triggerReconnect(false);
+		}
+	}
+
+	public void dispose() {
+		Connected connected;
+
+		synchronized (this) {
+			if (this.disposed) {
+				return;
+			}
+			this.disposed = true;
+			connected = this.connected;
+		}
+
+		if (connected != null) {
+			// dispose outside of lock
+			connected.dispose();
+		}
+	}
+
+	private synchronized void triggerReconnect(final boolean immediate) {
+		LOG.info("Trigger re-connect (immediate: {})", immediate);
+
+		if (this.reconnectJob != null) {
+			LOG.info("Re-connect already scheduled");
+			return;
+		}
+
+		if (immediate) {
+			this.reconnectJob = this.executor.submit(this::connect);
+		} else {
+			this.reconnectJob = this.executor.schedule(this::connect, this.reconnectTimeout, TimeUnit.MILLISECONDS);
+		}
+	}
+
+	private Connected performConnect() throws Exception {
+		final EndpointDescription endpoint = UaTcpStackClient.getEndpoints(this.configuration.getEndpointUri())
+				.thenApply(endpoints -> {
+					if (LOG.isDebugEnabled()) {
+						LOG.debug("Found enpoints:");
+						for (final EndpointDescription ep : endpoints) {
+							LOG.debug("\t{}", ep);
+						}
+					}
+
+					return findEndpoint(endpoints);
+				}).get();
+
+		LOG.debug("Selected endpoint: {}", endpoint);
+
+		final URI uri = URI.create(this.configuration.getEndpointUri());
+
+		// set identity providers
+
+		final List<IdentityProvider> providers = new LinkedList<>();
+
+		final String user = uri.getUserInfo();
+		if (user != null && !user.isEmpty()) {
+			final String[] creds = user.split(":", 2);
+			if (creds != null && creds.length == 2) {
+				LOG.debug("Enable username/password provider: {}", creds[0]);
+			}
+			providers.add(new UsernameProvider(creds[0], creds[1]));
+		}
+
+		// FIXME: need a way to clone
+		final OpcUaClientConfigBuilder cfg = this.clientBuilder;
+
+		providers.add(new AnonymousProvider());
+		cfg.setIdentityProvider(new CompositeProvider(providers));
+
+		// set endpoint
+
+		cfg.setEndpoint(endpoint);
+
+		final OpcUaClient client = new OpcUaClient(cfg.build());
+
+		try {
+			final UaSubscription manager = client.getSubscriptionManager().createSubscription(1_000.0).get();
+			client.getSubscriptionManager().addSubscriptionListener(new SubscriptionListenerImpl());
+
+			return new Connected(client, manager);
+		} catch (final Throwable e) {
+			if (client != null) {
+				// clean up
+				client.disconnect();
+			}
+			throw e;
+		}
+	}
+
+	private EndpointDescription findEndpoint(final EndpointDescription[] endpoints) {
+		EndpointDescription best = null;
+		for (final EndpointDescription ep : endpoints) {
+			if (best == null || ep.getSecurityLevel().compareTo(best.getSecurityLevel()) > 0) {
+				best = ep;
+			}
+		}
+		return best;
+	}
+
+	protected synchronized void whenConnected(final Worker<Connected> worker) {
+		if (this.connected != null) {
+			try {
+				worker.work(this.connected);
+			} catch (final Exception e) {
+				handleConnectionFailue(e);
+			}
+		}
+	}
+
+	public UInteger registerItem(final NamespaceId namespaceId, final PartialNodeId partialNodeId,
+			final Double samplingInterval, final Consumer<DataValue> valueConsumer) {
+
+		final UInteger clientHandle = Unsigned.uint(this.clientHandleCounter.incrementAndGet());
+		final Subscription subscription = new Subscription(namespaceId, partialNodeId, samplingInterval, valueConsumer);
+
+		synchronized (this) {
+			this.subscriptions.put(clientHandle, subscription);
+
+			whenConnected(connected -> {
+				connected.activate(clientHandle, subscription);
+			});
+		}
+
+		return clientHandle;
+	}
+
+	public synchronized void unregisterItem(final UInteger clientHandle) {
+		if (this.subscriptions.remove(clientHandle) != null) {
+			whenConnected(connected -> {
+				connected.deactivate(clientHandle);
+			});
+		}
+	}
+
+	public void write(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final DataValue value,
+			final boolean await) {
+		CompletableFuture<Object> future = null;
+
+		synchronized (this) {
+			if (this.connected != null) {
+				future = this.connected.write(namespaceId, partialNodeId, value).handleAsync((status, e) -> {
+					// handle outside the lock, running using
+					// handleAsync
+					if (e != null) {
+						handleConnectionFailue(e);
+					}
+					return null;
+				}, this.executor);
+			}
+		}
+
+		if (await && future != null) {
+			try {
+				future.get();
+			} catch (InterruptedException | ExecutionException e) {
+				// should never happen since our previous handler should not
+				// fail
+				LOG.warn("Failed to wait for completion", e);
+			}
+		}
+	}
+
+}


[14/18] camel git commit: Apply code formatter

Posted by ac...@apache.org.
http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
index fb2e396..0350987 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
@@ -68,503 +68,492 @@ import org.slf4j.LoggerFactory;
 
 public class SubscriptionManager {
 
-	private final static Logger LOG = LoggerFactory.getLogger(SubscriptionManager.class);
+    private final static Logger LOG = LoggerFactory.getLogger(SubscriptionManager.class);
 
-	private final AtomicLong clientHandleCounter = new AtomicLong(0);
+    private final AtomicLong clientHandleCounter = new AtomicLong(0);
 
-	private final class SubscriptionListenerImpl implements SubscriptionListener {
-		@Override
-		public void onSubscriptionTransferFailed(final UaSubscription subscription, final StatusCode statusCode) {
-			LOG.info("Transfer failed {} : {}", subscription.getSubscriptionId(), statusCode);
+    private final class SubscriptionListenerImpl implements SubscriptionListener {
+        @Override
+        public void onSubscriptionTransferFailed(final UaSubscription subscription, final StatusCode statusCode) {
+            LOG.info("Transfer failed {} : {}", subscription.getSubscriptionId(), statusCode);
 
-			// we simply tear it down and build it up again
-			handleConnectionFailue(new RuntimeException("Subscription failed to reconnect"));
-		}
-
-		@Override
-		public void onStatusChanged(final UaSubscription subscription, final StatusCode status) {
-			LOG.info("Subscription status changed {} : {}", subscription.getSubscriptionId(), status);
-		}
+            // we simply tear it down and build it up again
+            handleConnectionFailue(new RuntimeException("Subscription failed to reconnect"));
+        }
 
-		@Override
-		public void onPublishFailure(final UaException exception) {
-		}
+        @Override
+        public void onStatusChanged(final UaSubscription subscription, final StatusCode status) {
+            LOG.info("Subscription status changed {} : {}", subscription.getSubscriptionId(), status);
+        }
 
-		@Override
-		public void onNotificationDataLost(final UaSubscription subscription) {
-		}
+        @Override
+        public void onPublishFailure(final UaException exception) {
+        }
 
-		@Override
-		public void onKeepAlive(final UaSubscription subscription, final DateTime publishTime) {
-		}
-	}
+        @Override
+        public void onNotificationDataLost(final UaSubscription subscription) {
+        }
 
-	public interface Worker<T> {
-		public void work(T on) throws Exception;
-	}
+        @Override
+        public void onKeepAlive(final UaSubscription subscription, final DateTime publishTime) {
+        }
+    }
 
-	private static class Subscription {
-		private final NamespaceId namespaceId;
-		private final PartialNodeId partialNodeId;
-		private final Double samplingInterval;
+    public interface Worker<T> {
+        public void work(T on) throws Exception;
+    }
 
-		private final Consumer<DataValue> valueConsumer;
+    private static class Subscription {
+        private final NamespaceId namespaceId;
+        private final PartialNodeId partialNodeId;
+        private final Double samplingInterval;
 
-		public Subscription(final NamespaceId namespaceId, final PartialNodeId partialNodeId,
-				final Double samplingInterval, final Consumer<DataValue> valueConsumer) {
-			this.namespaceId = namespaceId;
-			this.partialNodeId = partialNodeId;
-			this.samplingInterval = samplingInterval;
-			this.valueConsumer = valueConsumer;
-		}
+        private final Consumer<DataValue> valueConsumer;
 
-		public NamespaceId getNamespaceId() {
-			return this.namespaceId;
-		}
+        public Subscription(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final Double samplingInterval, final Consumer<DataValue> valueConsumer) {
+            this.namespaceId = namespaceId;
+            this.partialNodeId = partialNodeId;
+            this.samplingInterval = samplingInterval;
+            this.valueConsumer = valueConsumer;
+        }
 
-		public PartialNodeId getPartialNodeId() {
-			return this.partialNodeId;
-		}
+        public NamespaceId getNamespaceId() {
+            return this.namespaceId;
+        }
 
-		public Double getSamplingInterval() {
-			return this.samplingInterval;
-		}
+        public PartialNodeId getPartialNodeId() {
+            return this.partialNodeId;
+        }
 
-		public Consumer<DataValue> getValueConsumer() {
-			return this.valueConsumer;
-		}
-	}
-
-	private class Connected {
-		private OpcUaClient client;
-		private final UaSubscription manager;
-
-		private final Map<UInteger, Subscription> badSubscriptions = new HashMap<>();
-
-		private final Map<UInteger, UaMonitoredItem> goodSubscriptions = new HashMap<>();
-
-		private final Map<String, UShort> namespaceCache = new ConcurrentHashMap<>();
-
-		public Connected(final OpcUaClient client, final UaSubscription manager) {
-			this.client = client;
-			this.manager = manager;
-		}
-
-		public void putSubscriptions(final Map<UInteger, Subscription> subscriptions) throws Exception {
-
-			if (subscriptions.isEmpty()) {
-				return;
-			}
-
-			// convert to requests
-
-			final List<MonitoredItemCreateRequest> items = new ArrayList<>(subscriptions.size());
-
-			for (final Map.Entry<UInteger, Subscription> entry : subscriptions.entrySet()) {
-				final Subscription s = entry.getValue();
-
-				UShort namespaceIndex;
-				if (s.getNamespaceId().isNumeric()) {
-					namespaceIndex = s.getNamespaceId().getNumeric();
-				} else {
-					namespaceIndex = lookupNamespace(s.getNamespaceId().getUri());
-				}
-
-				if (namespaceIndex == null) {
-					handleSubscriptionError(new StatusCode(StatusCodes.Bad_InvalidArgument), entry.getKey(), s);
-				} else {
-					final NodeId nodeId = s.getPartialNodeId().toNodeId(namespaceIndex);
-					final ReadValueId itemId = new ReadValueId(nodeId, AttributeId.Value.uid(), null,
-							QualifiedName.NULL_VALUE);
-					final MonitoringParameters parameters = new MonitoringParameters(entry.getKey(),
-							s.getSamplingInterval(), null, null, null);
-					items.add(new MonitoredItemCreateRequest(itemId, MonitoringMode.Reporting, parameters));
-				}
-			}
-
-			if (!items.isEmpty())
-
-			{
-
-				// create monitors
-
-				this.manager.createMonitoredItems(TimestampsToReturn.Both, items, (item, idx) -> {
-
-					// set value listener
-
-					final Subscription s = subscriptions.get(item.getClientHandle());
-
-					if (item.getStatusCode().isBad()) {
-						handleSubscriptionError(item.getStatusCode(), item.getClientHandle(), s);
-					} else {
-						this.goodSubscriptions.put(item.getClientHandle(), item);
-						item.setValueConsumer(s.getValueConsumer());
-					}
-
-				}).get();
-			}
-
-			if (!this.badSubscriptions.isEmpty()) {
-				SubscriptionManager.this.executor.schedule(this::resubscribe, SubscriptionManager.this.reconnectTimeout,
-						TimeUnit.MILLISECONDS);
-			}
-		}
-
-		private void handleSubscriptionError(final StatusCode statusCode, final UInteger clientHandle,
-				final Subscription s) {
-			this.badSubscriptions.put(clientHandle, s);
-			s.getValueConsumer().accept(new DataValue(statusCode));
-		}
-
-		private void resubscribe() {
-			final Map<UInteger, Subscription> subscriptions = new HashMap<>(this.badSubscriptions);
-			this.badSubscriptions.clear();
-			try {
-				putSubscriptions(subscriptions);
-			} catch (final Exception e) {
-				handleConnectionFailue(e);
-			}
-		}
-
-		public void activate(final UInteger clientHandle, final Subscription subscription) throws Exception {
-			putSubscriptions(Collections.singletonMap(clientHandle, subscription));
-		}
-
-		public void deactivate(final UInteger clientHandle) throws Exception {
-			final UaMonitoredItem item = this.goodSubscriptions.remove(clientHandle);
-			if (item != null) {
-				this.manager.deleteMonitoredItems(Collections.singletonList(item)).get();
-			} else {
-				this.badSubscriptions.remove(clientHandle);
-			}
-		}
-
-		private UShort lookupNamespace(final String namespaceUri) throws Exception {
-			return lookupNamespaceIndex(namespaceUri).get();
-		}
-
-		private CompletableFuture<UShort> lookupNamespaceIndex(final String namespaceUri) {
-
-			LOG.trace("Looking up namespace: {}", namespaceUri);
-
-			// check cache
-			{
-				final UShort result = this.namespaceCache.get(namespaceUri);
-				if (result != null) {
-					LOG.trace("Found namespace in cache: {} -> {}", namespaceUri, result);
-					return CompletableFuture.completedFuture(result);
-				}
-			}
-
-			/*
-			 * We always read the server side table since the cache did not help
-			 * us and the namespace might have been added to the server at a
-			 * later time.
-			 */
-
-			LOG.debug("Looking up namespace on server: {}", namespaceUri);
-
-			final CompletableFuture<DataValue> future = this.client.readValue(0, TimestampsToReturn.Neither,
-					Identifiers.Server_NamespaceArray);
-
-			return future.thenApply(value -> {
-				final Object rawValue = value.getValue().getValue();
-
-				if (rawValue instanceof String[]) {
-					final String[] namespaces = (String[]) rawValue;
-					for (int i = 0; i < namespaces.length; i++) {
-						if (namespaces[i].equals(namespaceUri)) {
-							final UShort result = Unsigned.ushort(i);
-							this.namespaceCache.putIfAbsent(namespaceUri, result);
-							return result;
-						}
-					}
-				}
-				return null;
-			});
-		}
-
-		public void dispose() {
-			if (this.client != null) {
-				this.client.disconnect();
-				this.client = null;
-			}
-		}
-
-		public CompletableFuture<StatusCode> write(final NamespaceId namespaceId, final PartialNodeId partialNodeId,
-				final DataValue value) {
-
-			final CompletableFuture<UShort> future;
-
-			LOG.trace("Namespace: {}", namespaceId);
-			if (namespaceId.isNumeric()) {
-				LOG.trace("Using provided index: {}", namespaceId.getNumeric());
-				future = CompletableFuture.completedFuture(namespaceId.getNumeric());
-			} else {
-				LOG.trace("Looking up namespace: {}", namespaceId.getUri());
-				future = lookupNamespaceIndex(namespaceId.getUri());
-			}
-
-			return future.thenCompose(index -> {
-
-				final NodeId nodeId = partialNodeId.toNodeId(index);
-				LOG.debug("Node - partial: {}, full: {}", partialNodeId, nodeId);
-
-				return this.client.writeValue(nodeId, value).whenComplete((status, error) -> {
-					if (status != null) {
-						LOG.debug("Write to ns={}/{}, id={} = {} -> {}", namespaceId, index, nodeId, value, status);
-					} else {
-						LOG.debug("Failed to write", error);
-					}
-				});
-
-			});
-		}
-
-	}
-
-	private final MiloClientConfiguration configuration;
-	private final OpcUaClientConfigBuilder clientBuilder;
-	private final ScheduledExecutorService executor;
-	private final long reconnectTimeout;
-
-	private Connected connected;
-	private boolean disposed;
-	private Future<?> reconnectJob;
-	private final Map<UInteger, Subscription> subscriptions = new HashMap<>();
-
-	public SubscriptionManager(final MiloClientConfiguration configuration,
-			final OpcUaClientConfigBuilder clientBuilder, final ScheduledExecutorService executor,
-			final long reconnectTimeout) {
-
-		this.configuration = configuration;
-		this.clientBuilder = clientBuilder;
-		this.executor = executor;
-		this.reconnectTimeout = reconnectTimeout;
-
-		connect();
-	}
-
-	private synchronized void handleConnectionFailue(final Throwable e) {
-		if (this.connected != null) {
-			this.connected.dispose();
-			this.connected = null;
-		}
-
-		// log
-
-		LOG.info("Connection failed", e);
-
-		// always trigger re-connect
-
-		triggerReconnect(true);
-	}
-
-	private void connect() {
-		LOG.info("Starting connect");
-
-		synchronized (this) {
-			this.reconnectJob = null;
-
-			if (this.disposed) {
-				// we woke up disposed
-				return;
-			}
-		}
-
-		try {
-			final Connected connected = performConnect();
-			LOG.debug("Connect call done");
-			synchronized (this) {
-				if (this.disposed) {
-					// we got disposed during connect
-					return;
-				}
-
-				try {
-					LOG.debug("Setting subscriptions: {}", this.subscriptions.size());
-					connected.putSubscriptions(this.subscriptions);
-
-					LOG.debug("Update state : {} -> {}", this.connected, connected);
-					final Connected oldConnected = this.connected;
-					this.connected = connected;
-
-					if (oldConnected != null) {
-						LOG.debug("Dispose old state");
-						oldConnected.dispose();
-					}
-
-				} catch (final Exception e) {
-					LOG.info("Failed to set subscriptions", e);
-					connected.dispose();
-					throw e;
-				}
-			}
-		} catch (final Exception e) {
-			LOG.info("Failed to connect", e);
-			triggerReconnect(false);
-		}
-	}
-
-	public void dispose() {
-		Connected connected;
-
-		synchronized (this) {
-			if (this.disposed) {
-				return;
-			}
-			this.disposed = true;
-			connected = this.connected;
-		}
-
-		if (connected != null) {
-			// dispose outside of lock
-			connected.dispose();
-		}
-	}
-
-	private synchronized void triggerReconnect(final boolean immediate) {
-		LOG.info("Trigger re-connect (immediate: {})", immediate);
-
-		if (this.reconnectJob != null) {
-			LOG.info("Re-connect already scheduled");
-			return;
-		}
-
-		if (immediate) {
-			this.reconnectJob = this.executor.submit(this::connect);
-		} else {
-			this.reconnectJob = this.executor.schedule(this::connect, this.reconnectTimeout, TimeUnit.MILLISECONDS);
-		}
-	}
-
-	private Connected performConnect() throws Exception {
-		final EndpointDescription endpoint = UaTcpStackClient.getEndpoints(this.configuration.getEndpointUri())
-				.thenApply(endpoints -> {
-					if (LOG.isDebugEnabled()) {
-						LOG.debug("Found enpoints:");
-						for (final EndpointDescription ep : endpoints) {
-							LOG.debug("\t{}", ep);
-						}
-					}
-
-					return findEndpoint(endpoints);
-				}).get();
-
-		LOG.debug("Selected endpoint: {}", endpoint);
-
-		final URI uri = URI.create(this.configuration.getEndpointUri());
-
-		// set identity providers
-
-		final List<IdentityProvider> providers = new LinkedList<>();
-
-		final String user = uri.getUserInfo();
-		if (user != null && !user.isEmpty()) {
-			final String[] creds = user.split(":", 2);
-			if (creds != null && creds.length == 2) {
-				LOG.debug("Enable username/password provider: {}", creds[0]);
-			}
-			providers.add(new UsernameProvider(creds[0], creds[1]));
-		}
-
-		// FIXME: need a way to clone
-		final OpcUaClientConfigBuilder cfg = this.clientBuilder;
-
-		providers.add(new AnonymousProvider());
-		cfg.setIdentityProvider(new CompositeProvider(providers));
-
-		// set endpoint
-
-		cfg.setEndpoint(endpoint);
-
-		final OpcUaClient client = new OpcUaClient(cfg.build());
-
-		try {
-			final UaSubscription manager = client.getSubscriptionManager().createSubscription(1_000.0).get();
-			client.getSubscriptionManager().addSubscriptionListener(new SubscriptionListenerImpl());
-
-			return new Connected(client, manager);
-		} catch (final Throwable e) {
-			if (client != null) {
-				// clean up
-				client.disconnect();
-			}
-			throw e;
-		}
-	}
-
-	private EndpointDescription findEndpoint(final EndpointDescription[] endpoints) {
-		EndpointDescription best = null;
-		for (final EndpointDescription ep : endpoints) {
-			if (best == null || ep.getSecurityLevel().compareTo(best.getSecurityLevel()) > 0) {
-				best = ep;
-			}
-		}
-		return best;
-	}
-
-	protected synchronized void whenConnected(final Worker<Connected> worker) {
-		if (this.connected != null) {
-			try {
-				worker.work(this.connected);
-			} catch (final Exception e) {
-				handleConnectionFailue(e);
-			}
-		}
-	}
-
-	public UInteger registerItem(final NamespaceId namespaceId, final PartialNodeId partialNodeId,
-			final Double samplingInterval, final Consumer<DataValue> valueConsumer) {
-
-		final UInteger clientHandle = Unsigned.uint(this.clientHandleCounter.incrementAndGet());
-		final Subscription subscription = new Subscription(namespaceId, partialNodeId, samplingInterval, valueConsumer);
-
-		synchronized (this) {
-			this.subscriptions.put(clientHandle, subscription);
-
-			whenConnected(connected -> {
-				connected.activate(clientHandle, subscription);
-			});
-		}
-
-		return clientHandle;
-	}
-
-	public synchronized void unregisterItem(final UInteger clientHandle) {
-		if (this.subscriptions.remove(clientHandle) != null) {
-			whenConnected(connected -> {
-				connected.deactivate(clientHandle);
-			});
-		}
-	}
-
-	public void write(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final DataValue value,
-			final boolean await) {
-		CompletableFuture<Object> future = null;
-
-		synchronized (this) {
-			if (this.connected != null) {
-				future = this.connected.write(namespaceId, partialNodeId, value).handleAsync((status, e) -> {
-					// handle outside the lock, running using
-					// handleAsync
-					if (e != null) {
-						handleConnectionFailue(e);
-					}
-					return null;
-				}, this.executor);
-			}
-		}
-
-		if (await && future != null) {
-			try {
-				future.get();
-			} catch (InterruptedException | ExecutionException e) {
-				// should never happen since our previous handler should not
-				// fail
-				LOG.warn("Failed to wait for completion", e);
-			}
-		}
-	}
+        public Double getSamplingInterval() {
+            return this.samplingInterval;
+        }
+
+        public Consumer<DataValue> getValueConsumer() {
+            return this.valueConsumer;
+        }
+    }
+
+    private class Connected {
+        private OpcUaClient client;
+        private final UaSubscription manager;
+
+        private final Map<UInteger, Subscription> badSubscriptions = new HashMap<>();
+
+        private final Map<UInteger, UaMonitoredItem> goodSubscriptions = new HashMap<>();
+
+        private final Map<String, UShort> namespaceCache = new ConcurrentHashMap<>();
+
+        public Connected(final OpcUaClient client, final UaSubscription manager) {
+            this.client = client;
+            this.manager = manager;
+        }
+
+        public void putSubscriptions(final Map<UInteger, Subscription> subscriptions) throws Exception {
+
+            if (subscriptions.isEmpty()) {
+                return;
+            }
+
+            // convert to requests
+
+            final List<MonitoredItemCreateRequest> items = new ArrayList<>(subscriptions.size());
+
+            for (final Map.Entry<UInteger, Subscription> entry : subscriptions.entrySet()) {
+                final Subscription s = entry.getValue();
+
+                UShort namespaceIndex;
+                if (s.getNamespaceId().isNumeric()) {
+                    namespaceIndex = s.getNamespaceId().getNumeric();
+                } else {
+                    namespaceIndex = lookupNamespace(s.getNamespaceId().getUri());
+                }
+
+                if (namespaceIndex == null) {
+                    handleSubscriptionError(new StatusCode(StatusCodes.Bad_InvalidArgument), entry.getKey(), s);
+                } else {
+                    final NodeId nodeId = s.getPartialNodeId().toNodeId(namespaceIndex);
+                    final ReadValueId itemId = new ReadValueId(nodeId, AttributeId.Value.uid(), null, QualifiedName.NULL_VALUE);
+                    final MonitoringParameters parameters = new MonitoringParameters(entry.getKey(), s.getSamplingInterval(), null, null, null);
+                    items.add(new MonitoredItemCreateRequest(itemId, MonitoringMode.Reporting, parameters));
+                }
+            }
+
+            if (!items.isEmpty())
+
+            {
+
+                // create monitors
+
+                this.manager.createMonitoredItems(TimestampsToReturn.Both, items, (item, idx) -> {
+
+                    // set value listener
+
+                    final Subscription s = subscriptions.get(item.getClientHandle());
+
+                    if (item.getStatusCode().isBad()) {
+                        handleSubscriptionError(item.getStatusCode(), item.getClientHandle(), s);
+                    } else {
+                        this.goodSubscriptions.put(item.getClientHandle(), item);
+                        item.setValueConsumer(s.getValueConsumer());
+                    }
+
+                }).get();
+            }
+
+            if (!this.badSubscriptions.isEmpty()) {
+                SubscriptionManager.this.executor.schedule(this::resubscribe, SubscriptionManager.this.reconnectTimeout, TimeUnit.MILLISECONDS);
+            }
+        }
+
+        private void handleSubscriptionError(final StatusCode statusCode, final UInteger clientHandle, final Subscription s) {
+            this.badSubscriptions.put(clientHandle, s);
+            s.getValueConsumer().accept(new DataValue(statusCode));
+        }
+
+        private void resubscribe() {
+            final Map<UInteger, Subscription> subscriptions = new HashMap<>(this.badSubscriptions);
+            this.badSubscriptions.clear();
+            try {
+                putSubscriptions(subscriptions);
+            } catch (final Exception e) {
+                handleConnectionFailue(e);
+            }
+        }
+
+        public void activate(final UInteger clientHandle, final Subscription subscription) throws Exception {
+            putSubscriptions(Collections.singletonMap(clientHandle, subscription));
+        }
+
+        public void deactivate(final UInteger clientHandle) throws Exception {
+            final UaMonitoredItem item = this.goodSubscriptions.remove(clientHandle);
+            if (item != null) {
+                this.manager.deleteMonitoredItems(Collections.singletonList(item)).get();
+            } else {
+                this.badSubscriptions.remove(clientHandle);
+            }
+        }
+
+        private UShort lookupNamespace(final String namespaceUri) throws Exception {
+            return lookupNamespaceIndex(namespaceUri).get();
+        }
+
+        private CompletableFuture<UShort> lookupNamespaceIndex(final String namespaceUri) {
+
+            LOG.trace("Looking up namespace: {}", namespaceUri);
+
+            // check cache
+            {
+                final UShort result = this.namespaceCache.get(namespaceUri);
+                if (result != null) {
+                    LOG.trace("Found namespace in cache: {} -> {}", namespaceUri, result);
+                    return CompletableFuture.completedFuture(result);
+                }
+            }
+
+            /*
+             * We always read the server side table since the cache did not help
+             * us and the namespace might have been added to the server at a
+             * later time.
+             */
+
+            LOG.debug("Looking up namespace on server: {}", namespaceUri);
+
+            final CompletableFuture<DataValue> future = this.client.readValue(0, TimestampsToReturn.Neither, Identifiers.Server_NamespaceArray);
+
+            return future.thenApply(value -> {
+                final Object rawValue = value.getValue().getValue();
+
+                if (rawValue instanceof String[]) {
+                    final String[] namespaces = (String[])rawValue;
+                    for (int i = 0; i < namespaces.length; i++) {
+                        if (namespaces[i].equals(namespaceUri)) {
+                            final UShort result = Unsigned.ushort(i);
+                            this.namespaceCache.putIfAbsent(namespaceUri, result);
+                            return result;
+                        }
+                    }
+                }
+                return null;
+            });
+        }
+
+        public void dispose() {
+            if (this.client != null) {
+                this.client.disconnect();
+                this.client = null;
+            }
+        }
+
+        public CompletableFuture<StatusCode> write(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final DataValue value) {
+
+            final CompletableFuture<UShort> future;
+
+            LOG.trace("Namespace: {}", namespaceId);
+            if (namespaceId.isNumeric()) {
+                LOG.trace("Using provided index: {}", namespaceId.getNumeric());
+                future = CompletableFuture.completedFuture(namespaceId.getNumeric());
+            } else {
+                LOG.trace("Looking up namespace: {}", namespaceId.getUri());
+                future = lookupNamespaceIndex(namespaceId.getUri());
+            }
+
+            return future.thenCompose(index -> {
+
+                final NodeId nodeId = partialNodeId.toNodeId(index);
+                LOG.debug("Node - partial: {}, full: {}", partialNodeId, nodeId);
+
+                return this.client.writeValue(nodeId, value).whenComplete((status, error) -> {
+                    if (status != null) {
+                        LOG.debug("Write to ns={}/{}, id={} = {} -> {}", namespaceId, index, nodeId, value, status);
+                    } else {
+                        LOG.debug("Failed to write", error);
+                    }
+                });
+
+            });
+        }
+
+    }
+
+    private final MiloClientConfiguration configuration;
+    private final OpcUaClientConfigBuilder clientBuilder;
+    private final ScheduledExecutorService executor;
+    private final long reconnectTimeout;
+
+    private Connected connected;
+    private boolean disposed;
+    private Future<?> reconnectJob;
+    private final Map<UInteger, Subscription> subscriptions = new HashMap<>();
+
+    public SubscriptionManager(final MiloClientConfiguration configuration, final OpcUaClientConfigBuilder clientBuilder, final ScheduledExecutorService executor,
+                               final long reconnectTimeout) {
+
+        this.configuration = configuration;
+        this.clientBuilder = clientBuilder;
+        this.executor = executor;
+        this.reconnectTimeout = reconnectTimeout;
+
+        connect();
+    }
+
+    private synchronized void handleConnectionFailue(final Throwable e) {
+        if (this.connected != null) {
+            this.connected.dispose();
+            this.connected = null;
+        }
+
+        // log
+
+        LOG.info("Connection failed", e);
+
+        // always trigger re-connect
+
+        triggerReconnect(true);
+    }
+
+    private void connect() {
+        LOG.info("Starting connect");
+
+        synchronized (this) {
+            this.reconnectJob = null;
+
+            if (this.disposed) {
+                // we woke up disposed
+                return;
+            }
+        }
+
+        try {
+            final Connected connected = performConnect();
+            LOG.debug("Connect call done");
+            synchronized (this) {
+                if (this.disposed) {
+                    // we got disposed during connect
+                    return;
+                }
+
+                try {
+                    LOG.debug("Setting subscriptions: {}", this.subscriptions.size());
+                    connected.putSubscriptions(this.subscriptions);
+
+                    LOG.debug("Update state : {} -> {}", this.connected, connected);
+                    final Connected oldConnected = this.connected;
+                    this.connected = connected;
+
+                    if (oldConnected != null) {
+                        LOG.debug("Dispose old state");
+                        oldConnected.dispose();
+                    }
+
+                } catch (final Exception e) {
+                    LOG.info("Failed to set subscriptions", e);
+                    connected.dispose();
+                    throw e;
+                }
+            }
+        } catch (final Exception e) {
+            LOG.info("Failed to connect", e);
+            triggerReconnect(false);
+        }
+    }
+
+    public void dispose() {
+        Connected connected;
+
+        synchronized (this) {
+            if (this.disposed) {
+                return;
+            }
+            this.disposed = true;
+            connected = this.connected;
+        }
+
+        if (connected != null) {
+            // dispose outside of lock
+            connected.dispose();
+        }
+    }
+
+    private synchronized void triggerReconnect(final boolean immediate) {
+        LOG.info("Trigger re-connect (immediate: {})", immediate);
+
+        if (this.reconnectJob != null) {
+            LOG.info("Re-connect already scheduled");
+            return;
+        }
+
+        if (immediate) {
+            this.reconnectJob = this.executor.submit(this::connect);
+        } else {
+            this.reconnectJob = this.executor.schedule(this::connect, this.reconnectTimeout, TimeUnit.MILLISECONDS);
+        }
+    }
+
+    private Connected performConnect() throws Exception {
+        final EndpointDescription endpoint = UaTcpStackClient.getEndpoints(this.configuration.getEndpointUri()).thenApply(endpoints -> {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Found enpoints:");
+                for (final EndpointDescription ep : endpoints) {
+                    LOG.debug("\t{}", ep);
+                }
+            }
+
+            return findEndpoint(endpoints);
+        }).get();
+
+        LOG.debug("Selected endpoint: {}", endpoint);
+
+        final URI uri = URI.create(this.configuration.getEndpointUri());
+
+        // set identity providers
+
+        final List<IdentityProvider> providers = new LinkedList<>();
+
+        final String user = uri.getUserInfo();
+        if (user != null && !user.isEmpty()) {
+            final String[] creds = user.split(":", 2);
+            if (creds != null && creds.length == 2) {
+                LOG.debug("Enable username/password provider: {}", creds[0]);
+            }
+            providers.add(new UsernameProvider(creds[0], creds[1]));
+        }
+
+        // FIXME: need a way to clone
+        final OpcUaClientConfigBuilder cfg = this.clientBuilder;
+
+        providers.add(new AnonymousProvider());
+        cfg.setIdentityProvider(new CompositeProvider(providers));
+
+        // set endpoint
+
+        cfg.setEndpoint(endpoint);
+
+        final OpcUaClient client = new OpcUaClient(cfg.build());
+
+        try {
+            final UaSubscription manager = client.getSubscriptionManager().createSubscription(1_000.0).get();
+            client.getSubscriptionManager().addSubscriptionListener(new SubscriptionListenerImpl());
+
+            return new Connected(client, manager);
+        } catch (final Throwable e) {
+            if (client != null) {
+                // clean up
+                client.disconnect();
+            }
+            throw e;
+        }
+    }
+
+    private EndpointDescription findEndpoint(final EndpointDescription[] endpoints) {
+        EndpointDescription best = null;
+        for (final EndpointDescription ep : endpoints) {
+            if (best == null || ep.getSecurityLevel().compareTo(best.getSecurityLevel()) > 0) {
+                best = ep;
+            }
+        }
+        return best;
+    }
+
+    protected synchronized void whenConnected(final Worker<Connected> worker) {
+        if (this.connected != null) {
+            try {
+                worker.work(this.connected);
+            } catch (final Exception e) {
+                handleConnectionFailue(e);
+            }
+        }
+    }
+
+    public UInteger registerItem(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final Double samplingInterval, final Consumer<DataValue> valueConsumer) {
+
+        final UInteger clientHandle = Unsigned.uint(this.clientHandleCounter.incrementAndGet());
+        final Subscription subscription = new Subscription(namespaceId, partialNodeId, samplingInterval, valueConsumer);
+
+        synchronized (this) {
+            this.subscriptions.put(clientHandle, subscription);
+
+            whenConnected(connected -> {
+                connected.activate(clientHandle, subscription);
+            });
+        }
+
+        return clientHandle;
+    }
+
+    public synchronized void unregisterItem(final UInteger clientHandle) {
+        if (this.subscriptions.remove(clientHandle) != null) {
+            whenConnected(connected -> {
+                connected.deactivate(clientHandle);
+            });
+        }
+    }
+
+    public void write(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final DataValue value, final boolean await) {
+        CompletableFuture<Object> future = null;
+
+        synchronized (this) {
+            if (this.connected != null) {
+                future = this.connected.write(namespaceId, partialNodeId, value).handleAsync((status, e) -> {
+                    // handle outside the lock, running using
+                    // handleAsync
+                    if (e != null) {
+                        handleConnectionFailue(e);
+                    }
+                    return null;
+                }, this.executor);
+            }
+        }
+
+        if (await && future != null) {
+            try {
+                future.get();
+            } catch (InterruptedException | ExecutionException e) {
+                // should never happen since our previous handler should not
+                // fail
+                LOG.warn("Failed to wait for completion", e);
+            }
+        }
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
index f2b03d9..aec9af2 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/ValueConverter.java
@@ -23,16 +23,16 @@ import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
 
 @Converter
 public final class ValueConverter implements TypeConverters {
-	private ValueConverter() {
-	}
+    private ValueConverter() {
+    }
 
-	@Converter
-	public static Variant toVariant(final DataValue value) {
-		return value.getValue();
-	}
+    @Converter
+    public static Variant toVariant(final DataValue value) {
+        return value.getValue();
+    }
 
-	@Converter
-	public static DataValue toDataValue(final Variant value) {
-		return new DataValue(value);
-	}
+    @Converter
+    public static DataValue toDataValue(final Variant value) {
+        return new DataValue(value);
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
index ee8a1f4..a24a7e3 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/converter/package-info.java
@@ -17,4 +17,4 @@
 /**
  * Data conversion
  */
-package org.apache.camel.component.milo.converter;
\ No newline at end of file
+package org.apache.camel.component.milo.converter;

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
index 7b39f9a..be6665e 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
@@ -68,383 +68,374 @@ import org.slf4j.LoggerFactory;
  */
 public class MiloServerComponent extends DefaultComponent {
 
-	private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);
 
-	private final static class DenyAllCertificateValidator implements CertificateValidator {
-		public static final CertificateValidator INSTANCE = new DenyAllCertificateValidator();
+    private final static class DenyAllCertificateValidator implements CertificateValidator {
+        public static final CertificateValidator INSTANCE = new DenyAllCertificateValidator();
 
-		private DenyAllCertificateValidator() {
-		}
+        private DenyAllCertificateValidator() {
+        }
 
-		@Override
-		public void validate(final X509Certificate certificate) throws UaException {
-			throw new UaException(StatusCodes.Bad_CertificateUseNotAllowed);
-		}
+        @Override
+        public void validate(final X509Certificate certificate) throws UaException {
+            throw new UaException(StatusCodes.Bad_CertificateUseNotAllowed);
+        }
 
-		@Override
-		public void verifyTrustChain(final X509Certificate certificate, final List<X509Certificate> chain)
-				throws UaException {
-			throw new UaException(StatusCodes.Bad_CertificateUseNotAllowed);
-		}
-	}
+        @Override
+        public void verifyTrustChain(final X509Certificate certificate, final List<X509Certificate> chain) throws UaException {
+            throw new UaException(StatusCodes.Bad_CertificateUseNotAllowed);
+        }
+    }
 
-	private static final String URL_CHARSET = "UTF-8";
+    private static final String URL_CHARSET = "UTF-8";
 
-	public static final String DEFAULT_NAMESPACE_URI = "urn:org:apache:camel";
+    public static final String DEFAULT_NAMESPACE_URI = "urn:org:apache:camel";
 
-	private static final OpcUaServerConfig DEFAULT_SERVER_CONFIG;
-	
-	static {
-		final OpcUaServerConfigBuilder cfg = OpcUaServerConfig.builder();
-
-		cfg.setCertificateManager(new DefaultCertificateManager());
-		cfg.setCertificateValidator(DenyAllCertificateValidator.INSTANCE);
-		cfg.setSecurityPolicies(EnumSet.allOf(SecurityPolicy.class));
-		cfg.setApplicationName(LocalizedText.english("Apache Camel Milo Server"));
-		cfg.setApplicationUri("urn:org:apache:camel:milo:server");
-		cfg.setProductUri("urn:org:apache:camel:milo");
-
-		if (Boolean.getBoolean("org.apache.camel.milo.server.default.enableAnonymous")) {
-			cfg.setUserTokenPolicies(singletonList(USER_TOKEN_POLICY_ANONYMOUS));
-			cfg.setIdentityValidator(AnonymousIdentityValidator.INSTANCE);
-		}
-
-		DEFAULT_SERVER_CONFIG = cfg.build();
-	}
-
-	private String namespaceUri = DEFAULT_NAMESPACE_URI;
-
-	private final OpcUaServerConfigBuilder serverConfig;
-
-	private OpcUaServer server;
-	private CamelNamespace namespace;
-
-	private final Map<String, MiloServerEndpoint> endpoints = new HashMap<>();
-
-	private Boolean enableAnonymousAuthentication;
-
-	private Map<String, String> userMap;
-
-	private List<String> bindAddresses;
-
-	private Supplier<CertificateValidator> certificateValidator;
-
-	private final List<Runnable> runOnStop = new LinkedList<>();
-
-	public MiloServerComponent() {
-		this(DEFAULT_SERVER_CONFIG);
-	}
-
-	public MiloServerComponent(final OpcUaServerConfig serverConfig) {
-		this.serverConfig = OpcUaServerConfig.copy(serverConfig != null ? serverConfig : DEFAULT_SERVER_CONFIG);
-	}
-
-	@Override
-	protected void doStart() throws Exception {
-		this.server = new OpcUaServer(buildServerConfig());
-
-		this.namespace = this.server.getNamespaceManager().registerAndAdd(this.namespaceUri,
-				index -> new CamelNamespace(index, this.namespaceUri, this.server));
-
-		super.doStart();
-		this.server.startup();
-	}
-
-	/**
-	 * Build the final server configuration, apply all complex configuration
-	 *
-	 * @return the new server configuration, never returns {@code null}
-	 */
-	private OpcUaServerConfig buildServerConfig() {
-
-		if (this.userMap != null || this.enableAnonymousAuthentication != null) {
-			// set identity validator
-
-			final Map<String, String> userMap = this.userMap != null ? new HashMap<>(this.userMap)
-					: Collections.emptyMap();
-			final boolean allowAnonymous = this.enableAnonymousAuthentication != null
-					? this.enableAnonymousAuthentication : false;
-			final IdentityValidator identityValidator = new UsernameIdentityValidator(allowAnonymous, challenge -> {
-				final String pwd = userMap.get(challenge.getUsername());
-				if (pwd == null) {
-					return false;
-				}
-				return pwd.equals(challenge.getPassword());
-			});
-			this.serverConfig.setIdentityValidator(identityValidator);
-
-			// add token policies
-
-			final List<UserTokenPolicy> tokenPolicies = new LinkedList<>();
-			if (Boolean.TRUE.equals(this.enableAnonymousAuthentication)) {
-				tokenPolicies.add(OpcUaServerConfig.USER_TOKEN_POLICY_ANONYMOUS);
-			}
-			if (userMap != null) {
-				tokenPolicies.add(OpcUaServerConfig.USER_TOKEN_POLICY_USERNAME);
-			}
-			this.serverConfig.setUserTokenPolicies(tokenPolicies);
-		}
-
-		if (this.bindAddresses != null) {
-			this.serverConfig.setBindAddresses(new ArrayList<>(this.bindAddresses));
-		}
-
-		if (this.certificateValidator != null) {
-			final CertificateValidator validator = this.certificateValidator.get();
-			LOG.debug("Using validator: {}", validator);
-			if (validator instanceof Closeable) {
-				runOnStop(() -> {
-					try {
-						LOG.debug("Closing: {}", validator);
-						((Closeable) validator).close();
-					} catch (final IOException e) {
-						LOG.warn("Failed to close", e);
-					}
-				});
-			}
-			this.serverConfig.setCertificateValidator(validator);
-		}
-
-		// build final configuration
-
-		return this.serverConfig.build();
-	}
-
-	private void runOnStop(final Runnable runnable) {
-		this.runOnStop.add(runnable);
-	}
-
-	@Override
-	protected void doStop() throws Exception {
-		this.server.shutdown();
-		super.doStop();
-
-		this.runOnStop.forEach(runnable -> {
-			try {
-				runnable.run();
-			} catch (final Exception e) {
-				LOG.warn("Failed to run on stop", e);
-			}
-		});
-		this.runOnStop.clear();
-	}
-
-	@Override
-	protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters)
-			throws Exception {
-		synchronized (this) {
-			if (remaining == null || remaining.isEmpty()) {
-				return null;
-			}
-
-			MiloServerEndpoint endpoint = this.endpoints.get(remaining);
-
-			if (endpoint == null) {
-				endpoint = new MiloServerEndpoint(uri, remaining, this.namespace, this);
-				setProperties(endpoint, parameters);
-				this.endpoints.put(remaining, endpoint);
-			}
-
-			return endpoint;
-		}
-	}
-
-	/**
-	 * The URI of the namespace, defaults to <code>urn:org:apache:camel</code>
-	 */
-	public void setNamespaceUri(final String namespaceUri) {
-		this.namespaceUri = namespaceUri;
-	}
-
-	/**
-	 * The application name
-	 */
-	public void setApplicationName(final String applicationName) {
-		Objects.requireNonNull(applicationName);
-		this.serverConfig.setApplicationName(LocalizedText.english(applicationName));
-	}
-
-	/**
-	 * The application URI
-	 */
-	public void setApplicationUri(final String applicationUri) {
-		Objects.requireNonNull(applicationUri);
-		this.serverConfig.setApplicationUri(applicationUri);
-	}
-
-	/**
-	 * The product URI
-	 */
-	public void setProductUri(final String productUri) {
-		Objects.requireNonNull(productUri);
-		this.serverConfig.setProductUri(productUri);
-	}
-
-	/**
-	 * The TCP port the server binds to
-	 */
-	public void setBindPort(final int port) {
-		this.serverConfig.setBindPort(port);
-	}
-
-	/**
-	 * Set whether strict endpoint URLs are enforced
-	 */
-	public void setStrictEndpointUrlsEnabled(final boolean strictEndpointUrlsEnforced) {
-		this.serverConfig.setStrictEndpointUrlsEnabled(strictEndpointUrlsEnforced);
-	}
-
-	/**
-	 * Server name
-	 */
-	public void setServerName(final String serverName) {
-		this.serverConfig.setServerName(serverName);
-	}
-
-	/**
-	 * Server hostname
-	 */
-	public void setHostname(final String hostname) {
-		this.serverConfig.setHostname(hostname);
-	}
-
-	/**
-	 * Security policies
-	 */
-	public void setSecurityPolicies(final Set<SecurityPolicy> securityPolicies) {
-		if (securityPolicies == null || securityPolicies.isEmpty()) {
-			this.serverConfig.setSecurityPolicies(EnumSet.noneOf(SecurityPolicy.class));
-		} else {
-			this.serverConfig.setSecurityPolicies(EnumSet.copyOf(securityPolicies));
-		}
-	}
-
-	/**
-	 * Security policies by URI or name
-	 */
-	public void setSecurityPoliciesById(final Collection<String> securityPolicies) {
-		final EnumSet<SecurityPolicy> policies = EnumSet.noneOf(SecurityPolicy.class);
-
-		if (securityPolicies != null) {
-			for (final String policyName : securityPolicies) {
-				final SecurityPolicy policy = SecurityPolicy.fromUriSafe(policyName)
-						.orElseGet(() -> SecurityPolicy.valueOf(policyName));
-				policies.add(policy);
-			}
-		}
-
-		this.serverConfig.setSecurityPolicies(policies);
-	}
-
-	/**
-	 * Security policies by URI or name
-	 */
-	public void setSecurityPoliciesById(final String... ids) {
-		if (ids != null) {
-			setSecurityPoliciesById(Arrays.asList(ids));
-		} else {
-			setSecurityPoliciesById((Collection<String>) null);
-		}
-	}
-
-	/**
-	 * Set user password combinations in the form of "user1:pwd1,user2:pwd2"
-	 * <p>
-	 * Usernames and passwords will be URL decoded
-	 * </p>
-	 */
-	public void setUserAuthenticationCredentials(final String userAuthenticationCredentials) {
-		if (userAuthenticationCredentials != null) {
-			this.userMap = new HashMap<>();
-
-			for (final String creds : userAuthenticationCredentials.split(",")) {
-				final String[] toks = creds.split(":", 2);
-				if (toks.length == 2) {
-					try {
-						this.userMap.put(URLDecoder.decode(toks[0], URL_CHARSET),
-								URLDecoder.decode(toks[1], URL_CHARSET));
-					} catch (final UnsupportedEncodingException e) {
-						// FIXME: do log
-					}
-				}
-			}
-		} else {
-			this.userMap = null;
-		}
-	}
-
-	/**
-	 * Enable anonymous authentication, disabled by default
-	 */
-	public void setEnableAnonymousAuthentication(final boolean enableAnonymousAuthentication) {
-		this.enableAnonymousAuthentication = enableAnonymousAuthentication;
-	}
-
-	/**
-	 * Set the addresses of the local addresses the server should bind to
-	 */
-	public void setBindAddresses(final String bindAddresses) {
-		if (bindAddresses != null) {
-			this.bindAddresses = Arrays.asList(bindAddresses.split(","));
-		} else {
-			this.bindAddresses = null;
-		}
-	}
-
-	/**
-	 * Server build info
-	 */
-	public void setBuildInfo(final BuildInfo buildInfo) {
-		this.serverConfig.setBuildInfo(buildInfo);
-	}
-
-	/**
-	 * Server certificate
-	 */
-	public void setServerCertificate(final KeyStoreLoader.Result result) {
-		/*
-		 * We are not implicitly deactivating the server certificate manager. If
-		 * the key could not be found by the KeyStoreLoader, it will return
-		 * "null" from the load() method.
-		 *
-		 * So if someone calls setServerCertificate ( loader.load () ); he may,
-		 * by accident, disable the server certificate.
-		 *
-		 * If disabling the server certificate is desired, do it explicitly.
-		 */
-		Objects.requireNonNull(result, "Setting a null is not supported. call setCertificateManager(null) instead.)");
-		setServerCertificate(result.getKeyPair(), result.getCertificate());
-	}
-
-	/**
-	 * Server certificate
-	 */
-	public void setServerCertificate(final KeyPair keyPair, final X509Certificate certificate) {
-		setCertificateManager(new DefaultCertificateManager(keyPair, certificate));
-	}
-
-	/**
-	 * Server certificate manager
-	 */
-	public void setCertificateManager(final CertificateManager certificateManager) {
-		if (certificateManager != null) {
-			this.serverConfig.setCertificateManager(certificateManager);
-		} else {
-			this.serverConfig.setCertificateManager(new DefaultCertificateManager());
-		}
-	}
-
-	/**
-	 * Validator for client certificates
-	 */
-	public void setCertificateValidator(final Supplier<CertificateValidator> certificateValidator) {
-		this.certificateValidator = certificateValidator;
-	}
-
-	/**
-	 * Validator for client certificates using default file based approach
-	 */
-	public void setDefaultCertificateValidator(final File certificatesBaseDir) {
-		this.certificateValidator = () -> new DefaultCertificateValidator(certificatesBaseDir);
-	}
+    private static final OpcUaServerConfig DEFAULT_SERVER_CONFIG;
+
+    static {
+        final OpcUaServerConfigBuilder cfg = OpcUaServerConfig.builder();
+
+        cfg.setCertificateManager(new DefaultCertificateManager());
+        cfg.setCertificateValidator(DenyAllCertificateValidator.INSTANCE);
+        cfg.setSecurityPolicies(EnumSet.allOf(SecurityPolicy.class));
+        cfg.setApplicationName(LocalizedText.english("Apache Camel Milo Server"));
+        cfg.setApplicationUri("urn:org:apache:camel:milo:server");
+        cfg.setProductUri("urn:org:apache:camel:milo");
+
+        if (Boolean.getBoolean("org.apache.camel.milo.server.default.enableAnonymous")) {
+            cfg.setUserTokenPolicies(singletonList(USER_TOKEN_POLICY_ANONYMOUS));
+            cfg.setIdentityValidator(AnonymousIdentityValidator.INSTANCE);
+        }
+
+        DEFAULT_SERVER_CONFIG = cfg.build();
+    }
+
+    private String namespaceUri = DEFAULT_NAMESPACE_URI;
+
+    private final OpcUaServerConfigBuilder serverConfig;
+
+    private OpcUaServer server;
+    private CamelNamespace namespace;
+
+    private final Map<String, MiloServerEndpoint> endpoints = new HashMap<>();
+
+    private Boolean enableAnonymousAuthentication;
+
+    private Map<String, String> userMap;
+
+    private List<String> bindAddresses;
+
+    private Supplier<CertificateValidator> certificateValidator;
+
+    private final List<Runnable> runOnStop = new LinkedList<>();
+
+    public MiloServerComponent() {
+        this(DEFAULT_SERVER_CONFIG);
+    }
+
+    public MiloServerComponent(final OpcUaServerConfig serverConfig) {
+        this.serverConfig = OpcUaServerConfig.copy(serverConfig != null ? serverConfig : DEFAULT_SERVER_CONFIG);
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        this.server = new OpcUaServer(buildServerConfig());
+
+        this.namespace = this.server.getNamespaceManager().registerAndAdd(this.namespaceUri, index -> new CamelNamespace(index, this.namespaceUri, this.server));
+
+        super.doStart();
+        this.server.startup();
+    }
+
+    /**
+     * Build the final server configuration, apply all complex configuration
+     *
+     * @return the new server configuration, never returns {@code null}
+     */
+    private OpcUaServerConfig buildServerConfig() {
+
+        if (this.userMap != null || this.enableAnonymousAuthentication != null) {
+            // set identity validator
+
+            final Map<String, String> userMap = this.userMap != null ? new HashMap<>(this.userMap) : Collections.emptyMap();
+            final boolean allowAnonymous = this.enableAnonymousAuthentication != null ? this.enableAnonymousAuthentication : false;
+            final IdentityValidator identityValidator = new UsernameIdentityValidator(allowAnonymous, challenge -> {
+                final String pwd = userMap.get(challenge.getUsername());
+                if (pwd == null) {
+                    return false;
+                }
+                return pwd.equals(challenge.getPassword());
+            });
+            this.serverConfig.setIdentityValidator(identityValidator);
+
+            // add token policies
+
+            final List<UserTokenPolicy> tokenPolicies = new LinkedList<>();
+            if (Boolean.TRUE.equals(this.enableAnonymousAuthentication)) {
+                tokenPolicies.add(OpcUaServerConfig.USER_TOKEN_POLICY_ANONYMOUS);
+            }
+            if (userMap != null) {
+                tokenPolicies.add(OpcUaServerConfig.USER_TOKEN_POLICY_USERNAME);
+            }
+            this.serverConfig.setUserTokenPolicies(tokenPolicies);
+        }
+
+        if (this.bindAddresses != null) {
+            this.serverConfig.setBindAddresses(new ArrayList<>(this.bindAddresses));
+        }
+
+        if (this.certificateValidator != null) {
+            final CertificateValidator validator = this.certificateValidator.get();
+            LOG.debug("Using validator: {}", validator);
+            if (validator instanceof Closeable) {
+                runOnStop(() -> {
+                    try {
+                        LOG.debug("Closing: {}", validator);
+                        ((Closeable)validator).close();
+                    } catch (final IOException e) {
+                        LOG.warn("Failed to close", e);
+                    }
+                });
+            }
+            this.serverConfig.setCertificateValidator(validator);
+        }
+
+        // build final configuration
+
+        return this.serverConfig.build();
+    }
+
+    private void runOnStop(final Runnable runnable) {
+        this.runOnStop.add(runnable);
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        this.server.shutdown();
+        super.doStop();
+
+        this.runOnStop.forEach(runnable -> {
+            try {
+                runnable.run();
+            } catch (final Exception e) {
+                LOG.warn("Failed to run on stop", e);
+            }
+        });
+        this.runOnStop.clear();
+    }
+
+    @Override
+    protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters) throws Exception {
+        synchronized (this) {
+            if (remaining == null || remaining.isEmpty()) {
+                return null;
+            }
+
+            MiloServerEndpoint endpoint = this.endpoints.get(remaining);
+
+            if (endpoint == null) {
+                endpoint = new MiloServerEndpoint(uri, remaining, this.namespace, this);
+                setProperties(endpoint, parameters);
+                this.endpoints.put(remaining, endpoint);
+            }
+
+            return endpoint;
+        }
+    }
+
+    /**
+     * The URI of the namespace, defaults to <code>urn:org:apache:camel</code>
+     */
+    public void setNamespaceUri(final String namespaceUri) {
+        this.namespaceUri = namespaceUri;
+    }
+
+    /**
+     * The application name
+     */
+    public void setApplicationName(final String applicationName) {
+        Objects.requireNonNull(applicationName);
+        this.serverConfig.setApplicationName(LocalizedText.english(applicationName));
+    }
+
+    /**
+     * The application URI
+     */
+    public void setApplicationUri(final String applicationUri) {
+        Objects.requireNonNull(applicationUri);
+        this.serverConfig.setApplicationUri(applicationUri);
+    }
+
+    /**
+     * The product URI
+     */
+    public void setProductUri(final String productUri) {
+        Objects.requireNonNull(productUri);
+        this.serverConfig.setProductUri(productUri);
+    }
+
+    /**
+     * The TCP port the server binds to
+     */
+    public void setBindPort(final int port) {
+        this.serverConfig.setBindPort(port);
+    }
+
+    /**
+     * Set whether strict endpoint URLs are enforced
+     */
+    public void setStrictEndpointUrlsEnabled(final boolean strictEndpointUrlsEnforced) {
+        this.serverConfig.setStrictEndpointUrlsEnabled(strictEndpointUrlsEnforced);
+    }
+
+    /**
+     * Server name
+     */
+    public void setServerName(final String serverName) {
+        this.serverConfig.setServerName(serverName);
+    }
+
+    /**
+     * Server hostname
+     */
+    public void setHostname(final String hostname) {
+        this.serverConfig.setHostname(hostname);
+    }
+
+    /**
+     * Security policies
+     */
+    public void setSecurityPolicies(final Set<SecurityPolicy> securityPolicies) {
+        if (securityPolicies == null || securityPolicies.isEmpty()) {
+            this.serverConfig.setSecurityPolicies(EnumSet.noneOf(SecurityPolicy.class));
+        } else {
+            this.serverConfig.setSecurityPolicies(EnumSet.copyOf(securityPolicies));
+        }
+    }
+
+    /**
+     * Security policies by URI or name
+     */
+    public void setSecurityPoliciesById(final Collection<String> securityPolicies) {
+        final EnumSet<SecurityPolicy> policies = EnumSet.noneOf(SecurityPolicy.class);
+
+        if (securityPolicies != null) {
+            for (final String policyName : securityPolicies) {
+                final SecurityPolicy policy = SecurityPolicy.fromUriSafe(policyName).orElseGet(() -> SecurityPolicy.valueOf(policyName));
+                policies.add(policy);
+            }
+        }
+
+        this.serverConfig.setSecurityPolicies(policies);
+    }
+
+    /**
+     * Security policies by URI or name
+     */
+    public void setSecurityPoliciesById(final String... ids) {
+        if (ids != null) {
+            setSecurityPoliciesById(Arrays.asList(ids));
+        } else {
+            setSecurityPoliciesById((Collection<String>)null);
+        }
+    }
+
+    /**
+     * Set user password combinations in the form of "user1:pwd1,user2:pwd2"
+     * <p>
+     * Usernames and passwords will be URL decoded
+     * </p>
+     */
+    public void setUserAuthenticationCredentials(final String userAuthenticationCredentials) {
+        if (userAuthenticationCredentials != null) {
+            this.userMap = new HashMap<>();
+
+            for (final String creds : userAuthenticationCredentials.split(",")) {
+                final String[] toks = creds.split(":", 2);
+                if (toks.length == 2) {
+                    try {
+                        this.userMap.put(URLDecoder.decode(toks[0], URL_CHARSET), URLDecoder.decode(toks[1], URL_CHARSET));
+                    } catch (final UnsupportedEncodingException e) {
+                        // FIXME: do log
+                    }
+                }
+            }
+        } else {
+            this.userMap = null;
+        }
+    }
+
+    /**
+     * Enable anonymous authentication, disabled by default
+     */
+    public void setEnableAnonymousAuthentication(final boolean enableAnonymousAuthentication) {
+        this.enableAnonymousAuthentication = enableAnonymousAuthentication;
+    }
+
+    /**
+     * Set the addresses of the local addresses the server should bind to
+     */
+    public void setBindAddresses(final String bindAddresses) {
+        if (bindAddresses != null) {
+            this.bindAddresses = Arrays.asList(bindAddresses.split(","));
+        } else {
+            this.bindAddresses = null;
+        }
+    }
+
+    /**
+     * Server build info
+     */
+    public void setBuildInfo(final BuildInfo buildInfo) {
+        this.serverConfig.setBuildInfo(buildInfo);
+    }
+
+    /**
+     * Server certificate
+     */
+    public void setServerCertificate(final KeyStoreLoader.Result result) {
+        /*
+         * We are not implicitly deactivating the server certificate manager. If
+         * the key could not be found by the KeyStoreLoader, it will return
+         * "null" from the load() method. So if someone calls
+         * setServerCertificate ( loader.load () ); he may, by accident, disable
+         * the server certificate. If disabling the server certificate is
+         * desired, do it explicitly.
+         */
+        Objects.requireNonNull(result, "Setting a null is not supported. call setCertificateManager(null) instead.)");
+        setServerCertificate(result.getKeyPair(), result.getCertificate());
+    }
+
+    /**
+     * Server certificate
+     */
+    public void setServerCertificate(final KeyPair keyPair, final X509Certificate certificate) {
+        setCertificateManager(new DefaultCertificateManager(keyPair, certificate));
+    }
+
+    /**
+     * Server certificate manager
+     */
+    public void setCertificateManager(final CertificateManager certificateManager) {
+        if (certificateManager != null) {
+            this.serverConfig.setCertificateManager(certificateManager);
+        } else {
+            this.serverConfig.setCertificateManager(new DefaultCertificateManager());
+        }
+    }
+
+    /**
+     * Validator for client certificates
+     */
+    public void setCertificateValidator(final Supplier<CertificateValidator> certificateValidator) {
+        this.certificateValidator = certificateValidator;
+    }
+
+    /**
+     * Validator for client certificates using default file based approach
+     */
+    public void setDefaultCertificateValidator(final File certificatesBaseDir) {
+        this.certificateValidator = () -> new DefaultCertificateValidator(certificatesBaseDir);
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
index 07537cd..5f6e925 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
@@ -29,50 +29,50 @@ import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
 
 class MiloServerConsumer extends DefaultConsumer {
 
-	private final CamelServerItem item;
-	private final Consumer<DataValue> writeHandler = this::performWrite;
+    private final CamelServerItem item;
+    private final Consumer<DataValue> writeHandler = this::performWrite;
 
-	public MiloServerConsumer(final Endpoint endpoint, final Processor processor, final CamelServerItem item) {
-		super(endpoint, processor);
-		this.item = item;
-	}
+    public MiloServerConsumer(final Endpoint endpoint, final Processor processor, final CamelServerItem item) {
+        super(endpoint, processor);
+        this.item = item;
+    }
 
-	@Override
-	protected void doStart() throws Exception {
-		super.doStart();
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
 
-		this.item.addWriteListener(this.writeHandler);
-	}
+        this.item.addWriteListener(this.writeHandler);
+    }
 
-	@Override
-	protected void doStop() throws Exception {
-		this.item.removeWriteListener(this.writeHandler);
+    @Override
+    protected void doStop() throws Exception {
+        this.item.removeWriteListener(this.writeHandler);
 
-		super.doStop();
-	}
+        super.doStop();
+    }
 
-	protected void performWrite(final DataValue value) {
+    protected void performWrite(final DataValue value) {
 
-		final Exchange exchange = getEndpoint().createExchange();
-		exchange.setIn(mapToMessage(value));
+        final Exchange exchange = getEndpoint().createExchange();
+        exchange.setIn(mapToMessage(value));
 
-		try {
-			getAsyncProcessor().process(exchange);
-		} catch (final Exception e) {
-			throw new RuntimeException(e);
-		}
-	}
+        try {
+            getAsyncProcessor().process(exchange);
+        } catch (final Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
 
-	private DefaultMessage mapToMessage(final DataValue value) {
-		if (value == null) {
-			return null;
-		}
+    private DefaultMessage mapToMessage(final DataValue value) {
+        if (value == null) {
+            return null;
+        }
 
-		final DefaultMessage result = new DefaultMessage();
+        final DefaultMessage result = new DefaultMessage();
 
-		Messages.fillFromDataValue(value, result);
+        Messages.fillFromDataValue(value, result);
 
-		return result;
-	}
+        return result;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
index 7045286..df67226 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
@@ -33,67 +33,65 @@ import org.apache.camel.spi.UriPath;
 @UriEndpoint(scheme = "milo-server", syntax = "milo-server:itemId", title = "OPC UA Server", consumerClass = MiloServerConsumer.class, label = "iot")
 class MiloServerEndpoint extends DefaultEndpoint {
 
-	@UriPath
-	@Metadata(required = "true")
-	private String itemId;
+    @UriPath
+    @Metadata(required = "true")
+    private String itemId;
 
-	private final CamelNamespace namespace;
+    private final CamelNamespace namespace;
 
-	private CamelServerItem item;
+    private CamelServerItem item;
 
-	public MiloServerEndpoint(final String uri, final String itemId, final CamelNamespace namespace,
-			final Component component) {
-		super(uri, component);
-		this.itemId = itemId;
-		this.namespace = namespace;
-	}
+    public MiloServerEndpoint(final String uri, final String itemId, final CamelNamespace namespace, final Component component) {
+        super(uri, component);
+        this.itemId = itemId;
+        this.namespace = namespace;
+    }
 
-	@Override
-	protected void doStart() throws Exception {
-		super.doStart();
-		this.item = this.namespace.getOrAddItem(this.itemId);
-	}
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+        this.item = this.namespace.getOrAddItem(this.itemId);
+    }
 
-	@Override
-	protected void doStop() throws Exception {
-		if (this.item != null) {
-			this.item.dispose();
-			this.item = null;
-		}
-		super.doStop();
-	}
+    @Override
+    protected void doStop() throws Exception {
+        if (this.item != null) {
+            this.item.dispose();
+            this.item = null;
+        }
+        super.doStop();
+    }
 
-	@Override
-	public Producer createProducer() throws Exception {
-		return new MiloServerProducer(this, this.item);
-	}
+    @Override
+    public Producer createProducer() throws Exception {
+        return new MiloServerProducer(this, this.item);
+    }
 
-	@Override
-	public Consumer createConsumer(final Processor processor) throws Exception {
-		return new MiloServerConsumer(this, processor, this.item);
-	}
+    @Override
+    public Consumer createConsumer(final Processor processor) throws Exception {
+        return new MiloServerConsumer(this, processor, this.item);
+    }
 
-	@Override
-	public boolean isSingleton() {
-		return true;
-	}
+    @Override
+    public boolean isSingleton() {
+        return true;
+    }
 
-	/**
-	 * ID of the item
-	 *
-	 * @param itemId
-	 *            the new ID of the item
-	 */
-	public void setItemId(final String itemId) {
-		this.itemId = itemId;
-	}
+    /**
+     * ID of the item
+     *
+     * @param itemId the new ID of the item
+     */
+    public void setItemId(final String itemId) {
+        this.itemId = itemId;
+    }
 
-	/**
-	 * Get the ID of the item
-	 *
-	 * @return the ID of the item
-	 */
-	public String getItemId() {
-		return this.itemId;
-	}
+    /**
+     * Get the ID of the item
+     *
+     * @return the ID of the item
+     */
+    public String getItemId() {
+        return this.itemId;
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
index ef38848..6f71a12 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
@@ -23,16 +23,16 @@ import org.apache.camel.impl.DefaultProducer;
 
 class MiloServerProducer extends DefaultProducer {
 
-	private final CamelServerItem item;
+    private final CamelServerItem item;
 
-	public MiloServerProducer(final Endpoint endpoint, final CamelServerItem item) {
-		super(endpoint);
-		this.item = item;
-	}
+    public MiloServerProducer(final Endpoint endpoint, final CamelServerItem item) {
+        super(endpoint);
+        this.item = item;
+    }
 
-	@Override
-	public void process(final Exchange exchange) throws Exception {
-		final Object value = exchange.getIn().getBody();
-		this.item.update(value);
-	}
+    @Override
+    public void process(final Exchange exchange) throws Exception {
+        final Object value = exchange.getIn().getBody();
+        this.item.update(value);
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
index 1cb345f..0445803 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelNamespace.java
@@ -55,159 +55,153 @@ import com.google.common.collect.Lists;
 
 public class CamelNamespace implements Namespace {
 
-	private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);
 
-	private final UShort namespaceIndex;
-
-	private final String namespaceUri;
+    private final UShort namespaceIndex;
 
-	private final ServerNodeMap nodeManager;
-	private final SubscriptionModel subscriptionModel;
+    private final String namespaceUri;
 
-	private final UaFolderNode folder;
-	private final UaObjectNode itemsObject;
-
-	private final Map<String, CamelServerItem> itemMap = new HashMap<>();
-
-	public CamelNamespace(final UShort namespaceIndex, final String namespaceUri, final OpcUaServer server) {
-		this.namespaceIndex = namespaceIndex;
-		this.namespaceUri = namespaceUri;
-
-		this.nodeManager = server.getNodeMap();
-		this.subscriptionModel = new SubscriptionModel(server, this);
-
-		// create structure
-
-		{
-			final NodeId nodeId = new NodeId(namespaceIndex, "camel");
-			final QualifiedName name = new QualifiedName(namespaceIndex, "camel");
-			final LocalizedText displayName = LocalizedText.english("Camel");
-
-			this.folder = new UaFolderNode(this.nodeManager, nodeId, name, displayName);
-			this.nodeManager.addNode(this.folder);
-		}
-
-		{
-			final NodeId nodeId = new NodeId(namespaceIndex, "items");
-			final QualifiedName name = new QualifiedName(namespaceIndex, "items");
-			final LocalizedText displayName = LocalizedText.english("Items");
-			this.itemsObject = new UaObjectNode(this.nodeManager, nodeId, name, displayName);
-			this.folder.addComponent(this.itemsObject);
-		}
-
-		// register reference to structure
-
-		try {
-			server.getUaNamespace().addReference(Identifiers.ObjectsFolder, Identifiers.Organizes, true,
-					this.folder.getNodeId().expanded(), NodeClass.Object);
-		} catch (final UaException e) {
-			throw new RuntimeException("Failed to register folder", e);
-		}
-	}
-
-	@Override
-	public UShort getNamespaceIndex() {
-		return this.namespaceIndex;
-	}
-
-	@Override
-	public String getNamespaceUri() {
-		return this.namespaceUri;
-	}
-
-	@Override
-	public CompletableFuture<List<Reference>> browse(final AccessContext context, final NodeId nodeId) {
-		final ServerNode node = this.nodeManager.get(nodeId);
-
-		if (node != null) {
-			return CompletableFuture.completedFuture(node.getReferences());
-		} else {
-			final CompletableFuture<List<Reference>> f = new CompletableFuture<>();
-			f.completeExceptionally(new UaException(StatusCodes.Bad_NodeIdUnknown));
-			return f;
-		}
-	}
-
-	@Override
-	public void read(final ReadContext context, final Double maxAge, final TimestampsToReturn timestamps,
-			final List<ReadValueId> readValueIds) {
-		final List<DataValue> results = Lists.newArrayListWithCapacity(readValueIds.size());
-
-		for (final ReadValueId id : readValueIds) {
-			final ServerNode node = this.nodeManager.get(id.getNodeId());
-
-			final DataValue value;
-
-			if (node != null) {
-				value = node.readAttribute(new AttributeContext(context), id.getAttributeId(), timestamps,
-						id.getIndexRange());
-			} else {
-				value = new DataValue(StatusCodes.Bad_NodeIdUnknown);
-			}
-
-			results.add(value);
-		}
-
-		context.complete(results);
-	}
-
-	@Override
-	public void write(final WriteContext context, final List<WriteValue> writeValues) {
-		final List<StatusCode> results = Lists.newArrayListWithCapacity(writeValues.size());
-
-		for (final WriteValue writeValue : writeValues) {
-			try {
-				final ServerNode node = this.nodeManager.getNode(writeValue.getNodeId())
-						.orElseThrow(() -> new UaException(StatusCodes.Bad_NodeIdUnknown));
-
-				node.writeAttribute(new AttributeContext(context), writeValue.getAttributeId(), writeValue.getValue(),
-						writeValue.getIndexRange());
-
-				if (LOG.isTraceEnabled()) {
-					final Variant variant = writeValue.getValue().getValue();
-					final Object o = variant != null ? variant.getValue() : null;
-					LOG.trace("Wrote value={} to attributeId={} of {}", o, writeValue.getAttributeId(),
-							writeValue.getNodeId());
-				}
-
-				results.add(StatusCode.GOOD);
-			} catch (final UaException e) {
-				results.add(e.getStatusCode());
-			}
-		}
-
-		context.complete(results);
-	}
-
-	@Override
-	public void onDataItemsCreated(final List<DataItem> dataItems) {
-		this.subscriptionModel.onDataItemsCreated(dataItems);
-	}
-
-	@Override
-	public void onDataItemsModified(final List<DataItem> dataItems) {
-		this.subscriptionModel.onDataItemsModified(dataItems);
-	}
-
-	@Override
-	public void onDataItemsDeleted(final List<DataItem> dataItems) {
-		this.subscriptionModel.onDataItemsDeleted(dataItems);
-	}
-
-	@Override
-	public void onMonitoringModeChanged(final List<MonitoredItem> monitoredItems) {
-		this.subscriptionModel.onMonitoringModeChanged(monitoredItems);
-	}
-
-	public CamelServerItem getOrAddItem(final String itemId) {
-		synchronized (this) {
-			CamelServerItem item = this.itemMap.get(itemId);
-			if (item == null) {
-				item = new CamelServerItem(itemId, this.nodeManager, this.namespaceIndex, this.itemsObject);
-				this.itemMap.put(itemId, item);
-			}
-			return item;
-		}
-	}
+    private final ServerNodeMap nodeManager;
+    private final SubscriptionModel subscriptionModel;
+
+    private final UaFolderNode folder;
+    private final UaObjectNode itemsObject;
+
+    private final Map<String, CamelServerItem> itemMap = new HashMap<>();
+
+    public CamelNamespace(final UShort namespaceIndex, final String namespaceUri, final OpcUaServer server) {
+        this.namespaceIndex = namespaceIndex;
+        this.namespaceUri = namespaceUri;
+
+        this.nodeManager = server.getNodeMap();
+        this.subscriptionModel = new SubscriptionModel(server, this);
+
+        // create structure
+
+        {
+            final NodeId nodeId = new NodeId(namespaceIndex, "camel");
+            final QualifiedName name = new QualifiedName(namespaceIndex, "camel");
+            final LocalizedText displayName = LocalizedText.english("Camel");
+
+            this.folder = new UaFolderNode(this.nodeManager, nodeId, name, displayName);
+            this.nodeManager.addNode(this.folder);
+        }
+
+        {
+            final NodeId nodeId = new NodeId(namespaceIndex, "items");
+            final QualifiedName name = new QualifiedName(namespaceIndex, "items");
+            final LocalizedText displayName = LocalizedText.english("Items");
+            this.itemsObject = new UaObjectNode(this.nodeManager, nodeId, name, displayName);
+            this.folder.addComponent(this.itemsObject);
+        }
+
+        // register reference to structure
+
+        try {
+            server.getUaNamespace().addReference(Identifiers.ObjectsFolder, Identifiers.Organizes, true, this.folder.getNodeId().expanded(), NodeClass.Object);
+        } catch (final UaException e) {
+            throw new RuntimeException("Failed to register folder", e);
+        }
+    }
+
+    @Override
+    public UShort getNamespaceIndex() {
+        return this.namespaceIndex;
+    }
+
+    @Override
+    public String getNamespaceUri() {
+        return this.namespaceUri;
+    }
+
+    @Override
+    public CompletableFuture<List<Reference>> browse(final AccessContext context, final NodeId nodeId) {
+        final ServerNode node = this.nodeManager.get(nodeId);
+
+        if (node != null) {
+            return CompletableFuture.completedFuture(node.getReferences());
+        } else {
+            final CompletableFuture<List<Reference>> f = new CompletableFuture<>();
+            f.completeExceptionally(new UaException(StatusCodes.Bad_NodeIdUnknown));
+            return f;
+        }
+    }
+
+    @Override
+    public void read(final ReadContext context, final Double maxAge, final TimestampsToReturn timestamps, final List<ReadValueId> readValueIds) {
+        final List<DataValue> results = Lists.newArrayListWithCapacity(readValueIds.size());
+
+        for (final ReadValueId id : readValueIds) {
+            final ServerNode node = this.nodeManager.get(id.getNodeId());
+
+            final DataValue value;
+
+            if (node != null) {
+                value = node.readAttribute(new AttributeContext(context), id.getAttributeId(), timestamps, id.getIndexRange());
+            } else {
+                value = new DataValue(StatusCodes.Bad_NodeIdUnknown);
+            }
+
+            results.add(value);
+        }
+
+        context.complete(results);
+    }
+
+    @Override
+    public void write(final WriteContext context, final List<WriteValue> writeValues) {
+        final List<StatusCode> results = Lists.newArrayListWithCapacity(writeValues.size());
+
+        for (final WriteValue writeValue : writeValues) {
+            try {
+                final ServerNode node = this.nodeManager.getNode(writeValue.getNodeId()).orElseThrow(() -> new UaException(StatusCodes.Bad_NodeIdUnknown));
+
+                node.writeAttribute(new AttributeContext(context), writeValue.getAttributeId(), writeValue.getValue(), writeValue.getIndexRange());
+
+                if (LOG.isTraceEnabled()) {
+                    final Variant variant = writeValue.getValue().getValue();
+                    final Object o = variant != null ? variant.getValue() : null;
+                    LOG.trace("Wrote value={} to attributeId={} of {}", o, writeValue.getAttributeId(), writeValue.getNodeId());
+                }
+
+                results.add(StatusCode.GOOD);
+            } catch (final UaException e) {
+                results.add(e.getStatusCode());
+            }
+        }
+
+        context.complete(results);
+    }
+
+    @Override
+    public void onDataItemsCreated(final List<DataItem> dataItems) {
+        this.subscriptionModel.onDataItemsCreated(dataItems);
+    }
+
+    @Override
+    public void onDataItemsModified(final List<DataItem> dataItems) {
+        this.subscriptionModel.onDataItemsModified(dataItems);
+    }
+
+    @Override
+    public void onDataItemsDeleted(final List<DataItem> dataItems) {
+        this.subscriptionModel.onDataItemsDeleted(dataItems);
+    }
+
+    @Override
+    public void onMonitoringModeChanged(final List<MonitoredItem> monitoredItems) {
+        this.subscriptionModel.onMonitoringModeChanged(monitoredItems);
+    }
+
+    public CamelServerItem getOrAddItem(final String itemId) {
+        synchronized (this) {
+            CamelServerItem item = this.itemMap.get(itemId);
+            if (item == null) {
+                item = new CamelServerItem(itemId, this.nodeManager, this.namespaceIndex, this.itemsObject);
+                this.itemMap.put(itemId, item);
+            }
+            return item;
+        }
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
index 8130943..a8df20b 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/internal/CamelServerItem.java
@@ -40,107 +40,103 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class CamelServerItem {
-	private static final Logger LOG = LoggerFactory.getLogger(CamelServerItem.class);
-
-	private UaObjectNode baseNode;
-	private UaVariableNode item;
-
-	private DataValue value = new DataValue(StatusCode.BAD);
-	private final Set<Consumer<DataValue>> listeners = new CopyOnWriteArraySet<>();
-
-	public CamelServerItem(final String itemId, final ServerNodeMap nodeManager, final UShort namespaceIndex,
-			final UaObjectNode baseNode) {
-
-		this.baseNode = baseNode;
-
-		final NodeId nodeId = new NodeId(namespaceIndex, "items-" + itemId);
-		final QualifiedName qname = new QualifiedName(namespaceIndex, itemId);
-		final LocalizedText displayName = LocalizedText.english(itemId);
-
-		// create variable node
-
-		this.item = new UaVariableNode(nodeManager, nodeId, qname, displayName) {
-
-			@Override
-			public DataValue getValue() {
-				return getDataValue();
-			}
-
-			@Override
-			public synchronized void setValue(final DataValue value) {
-				setDataValue(value);
-			}
-
-		};
-
-		// item.setDataType();
-		this.item.setAccessLevel(ubyte(AccessLevel.getMask(AccessLevel.READ_WRITE)));
-		this.item.setUserAccessLevel(ubyte(AccessLevel.getMask(AccessLevel.READ_WRITE)));
-
-		baseNode.addComponent(this.item);
-	}
-
-	public void dispose() {
-		this.baseNode.removeComponent(this.item);
-		this.listeners.clear();
-	}
-
-	public void addWriteListener(final Consumer<DataValue> consumer) {
-		this.listeners.add(consumer);
-	}
-
-	public void removeWriteListener(final Consumer<DataValue> consumer) {
-		this.listeners.remove(consumer);
-	}
-
-	protected void setDataValue(final DataValue value) {
-		LOG.debug("setValue -> {}", value);
-		runThrough(this.listeners, c -> c.accept(value));
-	}
-
-	/**
-	 * Run through a list, aggregating errors
-	 *
-	 * <p>
-	 * The consumer is called for each list item, regardless if the consumer did
-	 * through an exception. All exceptions are caught and thrown in one
-	 * RuntimeException. The first exception being wrapped directly while the
-	 * latter ones, if any, are added as suppressed exceptions.
-	 * </p>
-	 *
-	 * @param list
-	 *            the list to run through
-	 * @param consumer
-	 *            the consumer processing list elements
-	 */
-	protected <T> void runThrough(final Collection<Consumer<T>> list, final Consumer<Consumer<T>> consumer) {
-		LinkedList<Throwable> errors = null;
-
-		for (final Consumer<T> listener : list) {
-			try {
-				consumer.accept(listener);
-			} catch (final Throwable e) {
-				if (errors == null) {
-					errors = new LinkedList<>();
-				}
-				errors.add(e);
-			}
-		}
-
-		if (errors == null || errors.isEmpty()) {
-			return;
-		}
-
-		final RuntimeException ex = new RuntimeException(errors.pollFirst());
-		errors.forEach(ex::addSuppressed);
-		throw ex;
-	}
-
-	protected DataValue getDataValue() {
-		return this.value;
-	}
-
-	public void update(final Object value) {
-		this.value = new DataValue(new Variant(value), StatusCode.GOOD, DateTime.now());
-	}
+    private static final Logger LOG = LoggerFactory.getLogger(CamelServerItem.class);
+
+    private UaObjectNode baseNode;
+    private UaVariableNode item;
+
+    private DataValue value = new DataValue(StatusCode.BAD);
+    private final Set<Consumer<DataValue>> listeners = new CopyOnWriteArraySet<>();
+
+    public CamelServerItem(final String itemId, final ServerNodeMap nodeManager, final UShort namespaceIndex, final UaObjectNode baseNode) {
+
+        this.baseNode = baseNode;
+
+        final NodeId nodeId = new NodeId(namespaceIndex, "items-" + itemId);
+        final QualifiedName qname = new QualifiedName(namespaceIndex, itemId);
+        final LocalizedText displayName = LocalizedText.english(itemId);
+
+        // create variable node
+
+        this.item = new UaVariableNode(nodeManager, nodeId, qname, displayName) {
+
+            @Override
+            public DataValue getValue() {
+                return getDataValue();
+            }
+
+            @Override
+            public synchronized void setValue(final DataValue value) {
+                setDataValue(value);
+            }
+
+        };
+
+        // item.setDataType();
+        this.item.setAccessLevel(ubyte(AccessLevel.getMask(AccessLevel.READ_WRITE)));
+        this.item.setUserAccessLevel(ubyte(AccessLevel.getMask(AccessLevel.READ_WRITE)));
+
+        baseNode.addComponent(this.item);
+    }
+
+    public void dispose() {
+        this.baseNode.removeComponent(this.item);
+        this.listeners.clear();
+    }
+
+    public void addWriteListener(final Consumer<DataValue> consumer) {
+        this.listeners.add(consumer);
+    }
+
+    public void removeWriteListener(final Consumer<DataValue> consumer) {
+        this.listeners.remove(consumer);
+    }
+
+    protected void setDataValue(final DataValue value) {
+        LOG.debug("setValue -> {}", value);
+        runThrough(this.listeners, c -> c.accept(value));
+    }
+
+    /**
+     * Run through a list, aggregating errors
+     * <p>
+     * The consumer is called for each list item, regardless if the consumer did
+     * through an exception. All exceptions are caught and thrown in one
+     * RuntimeException. The first exception being wrapped directly while the
+     * latter ones, if any, are added as suppressed exceptions.
+     * </p>
+     *
+     * @param list the list to run through
+     * @param consumer the consumer processing list elements
+     */
+    protected <T> void runThrough(final Collection<Consumer<T>> list, final Consumer<Consumer<T>> consumer) {
+        LinkedList<Throwable> errors = null;
+
+        for (final Consumer<T> listener : list) {
+            try {
+                consumer.accept(listener);
+            } catch (final Throwable e) {
+                if (errors == null) {
+                    errors = new LinkedList<>();
+                }
+                errors.add(e);
+            }
+        }
+
+        if (errors == null || errors.isEmpty()) {
+            return;
+        }
+
+        final RuntimeException ex = new RuntimeException(errors.pollFirst());
+        errors.forEach(ex::addSuppressed);
+        throw ex;
+    }
+
+    protected DataValue getDataValue() {
+        return this.value;
+    }
+
+    public void update(final Object value) {
+        this.value = new DataValue(new Variant(value), StatusCode.GOOD, DateTime.now());
+    }
 }


[17/18] camel git commit: Code generated by maven build

Posted by ac...@apache.org.
Code generated by maven build


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0f35f553
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0f35f553
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0f35f553

Branch: refs/heads/master
Commit: 0f35f553c9ec911e22ed7afd82d741465ab14a04
Parents: a867b3c
Author: Jens Reimann <jr...@redhat.com>
Authored: Wed Apr 12 09:32:10 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:27 2017 +0200

----------------------------------------------------------------------
 .../MiloClientComponentAutoConfiguration.java   | 111 +++++++
 .../MiloClientComponentConfiguration.java       | 300 +++++++++++++++++++
 .../MiloServerComponentAutoConfiguration.java   | 111 +++++++
 .../MiloServerComponentConfiguration.java       | 277 +++++++++++++++++
 ...dditional-spring-configuration-metadata.json |  16 +
 .../main/resources/META-INF/spring.factories    |  21 ++
 6 files changed, 836 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0f35f553/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentAutoConfiguration.java
new file mode 100644
index 0000000..36e6961
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentAutoConfiguration.java
@@ -0,0 +1,111 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.milo.client.springboot;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.milo.client.MiloClientComponent;
+import org.apache.camel.util.IntrospectionSupport;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionMessage;
+import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
+import org.springframework.boot.bind.RelaxedPropertyResolver;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ConditionContext;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.core.type.AnnotatedTypeMetadata;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@Conditional(MiloClientComponentAutoConfiguration.Condition.class)
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@EnableConfigurationProperties(MiloClientComponentConfiguration.class)
+public class MiloClientComponentAutoConfiguration {
+
+    @Lazy
+    @Bean(name = "milo-client-component")
+    @ConditionalOnClass(CamelContext.class)
+    @ConditionalOnMissingBean(MiloClientComponent.class)
+    public MiloClientComponent configureMiloClientComponent(
+            CamelContext camelContext,
+            MiloClientComponentConfiguration configuration) throws Exception {
+        MiloClientComponent component = new MiloClientComponent();
+        component.setCamelContext(camelContext);
+        Map<String, Object> parameters = new HashMap<>();
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
+        for (Map.Entry<String, Object> entry : parameters.entrySet()) {
+            Object value = entry.getValue();
+            Class<?> paramClass = value.getClass();
+            if (paramClass.getName().endsWith("NestedConfiguration")) {
+                Class nestedClass = null;
+                try {
+                    nestedClass = (Class) paramClass.getDeclaredField(
+                            "CAMEL_NESTED_CLASS").get(null);
+                    HashMap<String, Object> nestedParameters = new HashMap<>();
+                    IntrospectionSupport.getProperties(value, nestedParameters,
+                            null, false);
+                    Object nestedProperty = nestedClass.newInstance();
+                    IntrospectionSupport.setProperties(camelContext,
+                            camelContext.getTypeConverter(), nestedProperty,
+                            nestedParameters);
+                    entry.setValue(nestedProperty);
+                } catch (NoSuchFieldException e) {
+                }
+            }
+        }
+        IntrospectionSupport.setProperties(camelContext,
+                camelContext.getTypeConverter(), component, parameters);
+        return component;
+    }
+
+    public static class Condition extends SpringBootCondition {
+        @Override
+        public ConditionOutcome getMatchOutcome(
+                ConditionContext conditionContext,
+                AnnotatedTypeMetadata annotatedTypeMetadata) {
+            boolean groupEnabled = isEnabled(conditionContext,
+                    "camel.component.", true);
+            ConditionMessage.Builder message = ConditionMessage
+                    .forCondition("camel.component.milo-client");
+            if (isEnabled(conditionContext, "camel.component.milo-client.",
+                    groupEnabled)) {
+                return ConditionOutcome.match(message.because("enabled"));
+            }
+            return ConditionOutcome.noMatch(message.because("not enabled"));
+        }
+
+        private boolean isEnabled(
+                org.springframework.context.annotation.ConditionContext context,
+                java.lang.String prefix, boolean defaultValue) {
+            RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(
+                    context.getEnvironment(), prefix);
+            return resolver.getProperty("enabled", Boolean.class, defaultValue);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0f35f553/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentConfiguration.java
new file mode 100644
index 0000000..7597469
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentConfiguration.java
@@ -0,0 +1,300 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.milo.client.springboot;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * Camel OPC UA support
+ * 
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@ConfigurationProperties(prefix = "camel.component.milo-client")
+public class MiloClientComponentConfiguration {
+
+    /**
+     * All default options for client
+     */
+    private MiloClientConfigurationNestedConfiguration defaultConfiguration;
+    /**
+     * Default application name
+     */
+    private String applicationName;
+    /**
+     * Default application URI
+     */
+    private String applicationUri;
+    /**
+     * Default product URI
+     */
+    private String productUri;
+    /**
+     * Default reconnect timeout
+     */
+    private Long reconnectTimeout;
+    /**
+     * Whether the component should resolve property placeholders on itself when
+     * starting. Only properties which are of String type can use property
+     * placeholders.
+     */
+    private Boolean resolvePropertyPlaceholders = true;
+
+    public MiloClientConfigurationNestedConfiguration getDefaultConfiguration() {
+        return defaultConfiguration;
+    }
+
+    public void setDefaultConfiguration(
+            MiloClientConfigurationNestedConfiguration defaultConfiguration) {
+        this.defaultConfiguration = defaultConfiguration;
+    }
+
+    public String getApplicationName() {
+        return applicationName;
+    }
+
+    public void setApplicationName(String applicationName) {
+        this.applicationName = applicationName;
+    }
+
+    public String getApplicationUri() {
+        return applicationUri;
+    }
+
+    public void setApplicationUri(String applicationUri) {
+        this.applicationUri = applicationUri;
+    }
+
+    public String getProductUri() {
+        return productUri;
+    }
+
+    public void setProductUri(String productUri) {
+        this.productUri = productUri;
+    }
+
+    public Long getReconnectTimeout() {
+        return reconnectTimeout;
+    }
+
+    public void setReconnectTimeout(Long reconnectTimeout) {
+        this.reconnectTimeout = reconnectTimeout;
+    }
+
+    public Boolean getResolvePropertyPlaceholders() {
+        return resolvePropertyPlaceholders;
+    }
+
+    public void setResolvePropertyPlaceholders(
+            Boolean resolvePropertyPlaceholders) {
+        this.resolvePropertyPlaceholders = resolvePropertyPlaceholders;
+    }
+
+    public static class MiloClientConfigurationNestedConfiguration {
+        public static final Class CAMEL_NESTED_CLASS = org.apache.camel.component.milo.client.MiloClientConfiguration.class;
+        private String endpointUri;
+        /**
+         * A virtual client id to force the creation of a new connection
+         * instance
+         */
+        private String clientId;
+        /**
+         * The application name
+         */
+        private String applicationName = "Apache Camel adapter for Eclipse Milo";
+        /**
+         * The application URI
+         */
+        private String applicationUri = "http://camel.apache.org/EclipseMilo/Client";
+        /**
+         * The product URI
+         */
+        private String productUri = "http://camel.apache.org/EclipseMilo";
+        /**
+         * Request timeout in milliseconds
+         */
+        private Long requestTimeout;
+        /**
+         * Channel lifetime in milliseconds
+         */
+        private Long channelLifetime;
+        /**
+         * Session name
+         */
+        private String sessionName;
+        /**
+         * Session timeout in milliseconds
+         */
+        private Long sessionTimeout;
+        /**
+         * The maximum number of pending publish requests
+         */
+        private Long maxPendingPublishRequests;
+        /**
+         * The maximum number of bytes a response message may have
+         */
+        private Long maxResponseMessageSize;
+        /**
+         * Whether secure channel re-authentication is enabled
+         */
+        private Boolean secureChannelReauthenticationEnabled;
+        /**
+         * The key store type
+         */
+        private String keyStoreType;
+        /**
+         * The name of the key in the keystore file
+         */
+        private String keyAlias;
+        /**
+         * The keystore password
+         */
+        private String keyStorePassword;
+        /**
+         * The key password
+         */
+        private String keyPassword;
+
+        public String getEndpointUri() {
+            return endpointUri;
+        }
+
+        public void setEndpointUri(String endpointUri) {
+            this.endpointUri = endpointUri;
+        }
+
+        public String getClientId() {
+            return clientId;
+        }
+
+        public void setClientId(String clientId) {
+            this.clientId = clientId;
+        }
+
+        public String getApplicationName() {
+            return applicationName;
+        }
+
+        public void setApplicationName(String applicationName) {
+            this.applicationName = applicationName;
+        }
+
+        public String getApplicationUri() {
+            return applicationUri;
+        }
+
+        public void setApplicationUri(String applicationUri) {
+            this.applicationUri = applicationUri;
+        }
+
+        public String getProductUri() {
+            return productUri;
+        }
+
+        public void setProductUri(String productUri) {
+            this.productUri = productUri;
+        }
+
+        public Long getRequestTimeout() {
+            return requestTimeout;
+        }
+
+        public void setRequestTimeout(Long requestTimeout) {
+            this.requestTimeout = requestTimeout;
+        }
+
+        public Long getChannelLifetime() {
+            return channelLifetime;
+        }
+
+        public void setChannelLifetime(Long channelLifetime) {
+            this.channelLifetime = channelLifetime;
+        }
+
+        public String getSessionName() {
+            return sessionName;
+        }
+
+        public void setSessionName(String sessionName) {
+            this.sessionName = sessionName;
+        }
+
+        public Long getSessionTimeout() {
+            return sessionTimeout;
+        }
+
+        public void setSessionTimeout(Long sessionTimeout) {
+            this.sessionTimeout = sessionTimeout;
+        }
+
+        public Long getMaxPendingPublishRequests() {
+            return maxPendingPublishRequests;
+        }
+
+        public void setMaxPendingPublishRequests(Long maxPendingPublishRequests) {
+            this.maxPendingPublishRequests = maxPendingPublishRequests;
+        }
+
+        public Long getMaxResponseMessageSize() {
+            return maxResponseMessageSize;
+        }
+
+        public void setMaxResponseMessageSize(Long maxResponseMessageSize) {
+            this.maxResponseMessageSize = maxResponseMessageSize;
+        }
+
+        public Boolean getSecureChannelReauthenticationEnabled() {
+            return secureChannelReauthenticationEnabled;
+        }
+
+        public void setSecureChannelReauthenticationEnabled(
+                Boolean secureChannelReauthenticationEnabled) {
+            this.secureChannelReauthenticationEnabled = secureChannelReauthenticationEnabled;
+        }
+
+        public String getKeyStoreType() {
+            return keyStoreType;
+        }
+
+        public void setKeyStoreType(String keyStoreType) {
+            this.keyStoreType = keyStoreType;
+        }
+
+        public String getKeyAlias() {
+            return keyAlias;
+        }
+
+        public void setKeyAlias(String keyAlias) {
+            this.keyAlias = keyAlias;
+        }
+
+        public String getKeyStorePassword() {
+            return keyStorePassword;
+        }
+
+        public void setKeyStorePassword(String keyStorePassword) {
+            this.keyStorePassword = keyStorePassword;
+        }
+
+        public String getKeyPassword() {
+            return keyPassword;
+        }
+
+        public void setKeyPassword(String keyPassword) {
+            this.keyPassword = keyPassword;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0f35f553/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentAutoConfiguration.java
new file mode 100644
index 0000000..46d80a9
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentAutoConfiguration.java
@@ -0,0 +1,111 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.milo.server.springboot;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.milo.server.MiloServerComponent;
+import org.apache.camel.util.IntrospectionSupport;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionMessage;
+import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
+import org.springframework.boot.bind.RelaxedPropertyResolver;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ConditionContext;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.core.type.AnnotatedTypeMetadata;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@Conditional(MiloServerComponentAutoConfiguration.Condition.class)
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@EnableConfigurationProperties(MiloServerComponentConfiguration.class)
+public class MiloServerComponentAutoConfiguration {
+
+    @Lazy
+    @Bean(name = "milo-server-component")
+    @ConditionalOnClass(CamelContext.class)
+    @ConditionalOnMissingBean(MiloServerComponent.class)
+    public MiloServerComponent configureMiloServerComponent(
+            CamelContext camelContext,
+            MiloServerComponentConfiguration configuration) throws Exception {
+        MiloServerComponent component = new MiloServerComponent();
+        component.setCamelContext(camelContext);
+        Map<String, Object> parameters = new HashMap<>();
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
+        for (Map.Entry<String, Object> entry : parameters.entrySet()) {
+            Object value = entry.getValue();
+            Class<?> paramClass = value.getClass();
+            if (paramClass.getName().endsWith("NestedConfiguration")) {
+                Class nestedClass = null;
+                try {
+                    nestedClass = (Class) paramClass.getDeclaredField(
+                            "CAMEL_NESTED_CLASS").get(null);
+                    HashMap<String, Object> nestedParameters = new HashMap<>();
+                    IntrospectionSupport.getProperties(value, nestedParameters,
+                            null, false);
+                    Object nestedProperty = nestedClass.newInstance();
+                    IntrospectionSupport.setProperties(camelContext,
+                            camelContext.getTypeConverter(), nestedProperty,
+                            nestedParameters);
+                    entry.setValue(nestedProperty);
+                } catch (NoSuchFieldException e) {
+                }
+            }
+        }
+        IntrospectionSupport.setProperties(camelContext,
+                camelContext.getTypeConverter(), component, parameters);
+        return component;
+    }
+
+    public static class Condition extends SpringBootCondition {
+        @Override
+        public ConditionOutcome getMatchOutcome(
+                ConditionContext conditionContext,
+                AnnotatedTypeMetadata annotatedTypeMetadata) {
+            boolean groupEnabled = isEnabled(conditionContext,
+                    "camel.component.", true);
+            ConditionMessage.Builder message = ConditionMessage
+                    .forCondition("camel.component.milo-server");
+            if (isEnabled(conditionContext, "camel.component.milo-server.",
+                    groupEnabled)) {
+                return ConditionOutcome.match(message.because("enabled"));
+            }
+            return ConditionOutcome.noMatch(message.because("not enabled"));
+        }
+
+        private boolean isEnabled(
+                org.springframework.context.annotation.ConditionContext context,
+                java.lang.String prefix, boolean defaultValue) {
+            RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(
+                    context.getEnvironment(), prefix);
+            return resolver.getProperty("enabled", Boolean.class, defaultValue);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0f35f553/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentConfiguration.java
new file mode 100644
index 0000000..0aee3db
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentConfiguration.java
@@ -0,0 +1,277 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.milo.server.springboot;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.Set;
+import java.util.function.Supplier;
+import org.apache.camel.component.milo.KeyStoreLoader.Result;
+import org.eclipse.milo.opcua.stack.core.application.CertificateManager;
+import org.eclipse.milo.opcua.stack.core.application.CertificateValidator;
+import org.eclipse.milo.opcua.stack.core.security.SecurityPolicy;
+import org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.NestedConfigurationProperty;
+
+/**
+ * OPC UA Server based endpoint
+ * 
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@ConfigurationProperties(prefix = "camel.component.milo-server")
+public class MiloServerComponentConfiguration {
+
+    /**
+     * The URI of the namespace defaults to urn:org:apache:camel
+     */
+    private String namespaceUri;
+    /**
+     * The application name
+     */
+    private String applicationName;
+    /**
+     * The application URI
+     */
+    private String applicationUri;
+    /**
+     * The product URI
+     */
+    private String productUri;
+    /**
+     * The TCP port the server binds to
+     */
+    private Integer bindPort;
+    /**
+     * Set whether strict endpoint URLs are enforced
+     */
+    private Boolean strictEndpointUrlsEnabled = false;
+    /**
+     * Server name
+     */
+    private String serverName;
+    /**
+     * Server hostname
+     */
+    private String hostname;
+    /**
+     * Security policies
+     */
+    private Set<SecurityPolicy> securityPolicies;
+    /**
+     * Security policies by URI or name
+     */
+    private Collection<String> securityPoliciesById;
+    /**
+     * Set user password combinations in the form of user1:pwd1user2:pwd2
+     * Usernames and passwords will be URL decoded
+     */
+    private String userAuthenticationCredentials;
+    /**
+     * Enable anonymous authentication disabled by default
+     */
+    private Boolean enableAnonymousAuthentication = false;
+    /**
+     * Set the addresses of the local addresses the server should bind to
+     */
+    private String bindAddresses;
+    /**
+     * Server build info
+     */
+    @NestedConfigurationProperty
+    private BuildInfo buildInfo;
+    /**
+     * Server certificate
+     */
+    @NestedConfigurationProperty
+    private Result serverCertificate;
+    /**
+     * Server certificate manager
+     */
+    @NestedConfigurationProperty
+    private CertificateManager certificateManager;
+    /**
+     * Validator for client certificates
+     */
+    private Supplier<CertificateValidator> certificateValidator;
+    /**
+     * Validator for client certificates using default file based approach
+     */
+    private File defaultCertificateValidator;
+    /**
+     * Whether the component should resolve property placeholders on itself when
+     * starting. Only properties which are of String type can use property
+     * placeholders.
+     */
+    private Boolean resolvePropertyPlaceholders = true;
+
+    public String getNamespaceUri() {
+        return namespaceUri;
+    }
+
+    public void setNamespaceUri(String namespaceUri) {
+        this.namespaceUri = namespaceUri;
+    }
+
+    public String getApplicationName() {
+        return applicationName;
+    }
+
+    public void setApplicationName(String applicationName) {
+        this.applicationName = applicationName;
+    }
+
+    public String getApplicationUri() {
+        return applicationUri;
+    }
+
+    public void setApplicationUri(String applicationUri) {
+        this.applicationUri = applicationUri;
+    }
+
+    public String getProductUri() {
+        return productUri;
+    }
+
+    public void setProductUri(String productUri) {
+        this.productUri = productUri;
+    }
+
+    public Integer getBindPort() {
+        return bindPort;
+    }
+
+    public void setBindPort(Integer bindPort) {
+        this.bindPort = bindPort;
+    }
+
+    public Boolean getStrictEndpointUrlsEnabled() {
+        return strictEndpointUrlsEnabled;
+    }
+
+    public void setStrictEndpointUrlsEnabled(Boolean strictEndpointUrlsEnabled) {
+        this.strictEndpointUrlsEnabled = strictEndpointUrlsEnabled;
+    }
+
+    public String getServerName() {
+        return serverName;
+    }
+
+    public void setServerName(String serverName) {
+        this.serverName = serverName;
+    }
+
+    public String getHostname() {
+        return hostname;
+    }
+
+    public void setHostname(String hostname) {
+        this.hostname = hostname;
+    }
+
+    public Set<SecurityPolicy> getSecurityPolicies() {
+        return securityPolicies;
+    }
+
+    public void setSecurityPolicies(Set<SecurityPolicy> securityPolicies) {
+        this.securityPolicies = securityPolicies;
+    }
+
+    public Collection<String> getSecurityPoliciesById() {
+        return securityPoliciesById;
+    }
+
+    public void setSecurityPoliciesById(Collection<String> securityPoliciesById) {
+        this.securityPoliciesById = securityPoliciesById;
+    }
+
+    public String getUserAuthenticationCredentials() {
+        return userAuthenticationCredentials;
+    }
+
+    public void setUserAuthenticationCredentials(
+            String userAuthenticationCredentials) {
+        this.userAuthenticationCredentials = userAuthenticationCredentials;
+    }
+
+    public Boolean getEnableAnonymousAuthentication() {
+        return enableAnonymousAuthentication;
+    }
+
+    public void setEnableAnonymousAuthentication(
+            Boolean enableAnonymousAuthentication) {
+        this.enableAnonymousAuthentication = enableAnonymousAuthentication;
+    }
+
+    public String getBindAddresses() {
+        return bindAddresses;
+    }
+
+    public void setBindAddresses(String bindAddresses) {
+        this.bindAddresses = bindAddresses;
+    }
+
+    public BuildInfo getBuildInfo() {
+        return buildInfo;
+    }
+
+    public void setBuildInfo(BuildInfo buildInfo) {
+        this.buildInfo = buildInfo;
+    }
+
+    public Result getServerCertificate() {
+        return serverCertificate;
+    }
+
+    public void setServerCertificate(Result serverCertificate) {
+        this.serverCertificate = serverCertificate;
+    }
+
+    public CertificateManager getCertificateManager() {
+        return certificateManager;
+    }
+
+    public void setCertificateManager(CertificateManager certificateManager) {
+        this.certificateManager = certificateManager;
+    }
+
+    public Supplier<CertificateValidator> getCertificateValidator() {
+        return certificateValidator;
+    }
+
+    public void setCertificateValidator(
+            Supplier<CertificateValidator> certificateValidator) {
+        this.certificateValidator = certificateValidator;
+    }
+
+    public File getDefaultCertificateValidator() {
+        return defaultCertificateValidator;
+    }
+
+    public void setDefaultCertificateValidator(File defaultCertificateValidator) {
+        this.defaultCertificateValidator = defaultCertificateValidator;
+    }
+
+    public Boolean getResolvePropertyPlaceholders() {
+        return resolvePropertyPlaceholders;
+    }
+
+    public void setResolvePropertyPlaceholders(
+            Boolean resolvePropertyPlaceholders) {
+        this.resolvePropertyPlaceholders = resolvePropertyPlaceholders;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0f35f553/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 0000000..c370957
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,16 @@
+{
+  "properties": [
+    {
+      "defaultValue": true,
+      "name": "camel.component.milo-server.enabled",
+      "description": "Enable milo-server component",
+      "type": "java.lang.Boolean"
+    },
+    {
+      "defaultValue": true,
+      "name": "camel.component.milo-client.enabled",
+      "description": "Enable milo-client component",
+      "type": "java.lang.Boolean"
+    }
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0f35f553/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/spring.factories
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/spring.factories b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/spring.factories
new file mode 100644
index 0000000..a0065a0
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,21 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+org.apache.camel.component.milo.server.springboot.MiloServerComponentAutoConfiguration,\
+org.apache.camel.component.milo.client.springboot.MiloClientComponentAutoConfiguration
+


[09/18] camel git commit: Mark secrets as secret

Posted by ac...@apache.org.
Mark secrets as secret


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/80211658
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/80211658
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/80211658

Branch: refs/heads/master
Commit: 8021165843617ac27357aed55e4d4d8609304e5b
Parents: 47a9019
Author: Jens Reimann <jr...@redhat.com>
Authored: Tue Apr 11 19:33:28 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:26 2017 +0200

----------------------------------------------------------------------
 .../camel/component/milo/client/MiloClientConfiguration.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/80211658/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
index e1e7301..037a109 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
@@ -76,10 +76,10 @@ public class MiloClientConfiguration implements Cloneable {
 	@UriParam(label = "client")
 	private String keyAlias;
 
-	@UriParam(label = "client")
+	@UriParam(label = "client", secret = true)
 	private String keyStorePassword;
 
-	@UriParam(label = "client")
+	@UriParam(label = "client", secret = true)
 	private String keyPassword;
 
 	public MiloClientConfiguration() {


[15/18] camel git commit: Apply code formatter

Posted by ac...@apache.org.
Apply code formatter


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/19db14d7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/19db14d7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/19db14d7

Branch: refs/heads/master
Commit: 19db14d76cb74533c06e610c1593c13348bdd9c0
Parents: 0f35f55
Author: Jens Reimann <jr...@redhat.com>
Authored: Wed Apr 12 09:37:23 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:27 2017 +0200

----------------------------------------------------------------------
 .../camel/component/milo/KeyStoreLoader.java    | 216 +++--
 .../apache/camel/component/milo/Messages.java   |  26 +-
 .../camel/component/milo/NamespaceId.java       | 112 +--
 .../apache/camel/component/milo/NodeIds.java    | 368 ++++---
 .../camel/component/milo/PartialNodeId.java     | 164 ++--
 .../milo/client/MiloClientComponent.java        | 290 +++---
 .../milo/client/MiloClientConfiguration.java    | 486 +++++-----
 .../milo/client/MiloClientConnection.java       | 178 ++--
 .../milo/client/MiloClientConsumer.java         |  84 +-
 .../milo/client/MiloClientEndpoint.java         | 283 +++---
 .../client/MiloClientItemConfiguration.java     |   6 +-
 .../milo/client/MiloClientProducer.java         |  41 +-
 .../client/internal/SubscriptionManager.java    | 957 +++++++++----------
 .../milo/converter/ValueConverter.java          |  20 +-
 .../component/milo/converter/package-info.java  |   2 +-
 .../milo/server/MiloServerComponent.java        | 735 +++++++-------
 .../milo/server/MiloServerConsumer.java         |  66 +-
 .../milo/server/MiloServerEndpoint.java         | 104 +-
 .../milo/server/MiloServerProducer.java         |  20 +-
 .../milo/server/internal/CamelNamespace.java    | 296 +++---
 .../milo/server/internal/CamelServerItem.java   | 202 ++--
 .../component/milo/AbstractMiloServerTest.java  | 101 +-
 .../MonitorItemMultiConnectionsCertTest.java    | 169 ++--
 .../milo/MonitorItemMultiConnectionsTest.java   |  97 +-
 .../camel/component/milo/MonitorItemTest.java   |  87 +-
 .../apache/camel/component/milo/NodeIdTest.java | 106 +-
 .../camel/component/milo/WriteClientTest.java   | 236 ++---
 .../component/milo/converter/ConverterTest.java |  38 +-
 .../component/milo/server/ServerLocalTest.java  |  80 +-
 .../server/ServerSetCertificateManagerTest.java |  27 +-
 .../server/ServerSetSecurityPoliciesTest.java   |  40 +-
 .../component/milo/testing/Application.java     |  61 +-
 .../milo/testing/Application2Client.java        |  45 +-
 .../milo/testing/Application2Server.java        |  63 +-
 34 files changed, 2865 insertions(+), 2941 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
index fa1f970..b745bb7 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/KeyStoreLoader.java
@@ -30,116 +30,114 @@ import java.security.cert.X509Certificate;
 import java.util.NoSuchElementException;
 
 public class KeyStoreLoader {
-	public static final String DEFAULT_KEY_STORE_TYPE = "PKCS12";
+    public static final String DEFAULT_KEY_STORE_TYPE = "PKCS12";
 
-	private String type = DEFAULT_KEY_STORE_TYPE;
-	private URL url;
-	private String keyStorePassword;
-	private String keyPassword;
-	private String keyAlias;
-
-	public static class Result {
+    private String type = DEFAULT_KEY_STORE_TYPE;
+    private URL url;
+    private String keyStorePassword;
+    private String keyPassword;
+    private String keyAlias;
 
-		private final X509Certificate certificate;
-		private final KeyPair keyPair;
-
-		public Result(final X509Certificate certificate, final KeyPair keyPair) {
-			this.certificate = certificate;
-			this.keyPair = keyPair;
-		}
-
-		public X509Certificate getCertificate() {
-			return this.certificate;
-		}
-
-		public KeyPair getKeyPair() {
-			return this.keyPair;
-		}
-	}
-
-	public KeyStoreLoader() {
-	}
-
-	public void setType(final String type) {
-		this.type = type != null ? type : DEFAULT_KEY_STORE_TYPE;
-	}
-
-	public String getType() {
-		return this.type;
-	}
-
-	public void setUrl(final URL url) {
-		this.url = url;
-	}
-
-	public URL getUrl() {
-		return this.url;
-	}
-
-	public void setUrl(final String url) throws MalformedURLException {
-		this.url = new URL(url);
-	}
-
-	public void setKeyStorePassword(final String keyStorePassword) {
-		this.keyStorePassword = keyStorePassword;
-	}
-
-	public String getKeyStorePassword() {
-		return this.keyStorePassword;
-	}
-
-	public void setKeyPassword(final String keyPassword) {
-		this.keyPassword = keyPassword;
-	}
-
-	public String getKeyPassword() {
-		return this.keyPassword;
-	}
-
-	public void setKeyAlias(final String keyAlias) {
-		this.keyAlias = keyAlias;
-	}
-
-	public String getKeyAlias() {
-		return this.keyAlias;
-	}
-
-	public Result load() throws GeneralSecurityException, IOException {
-
-		final KeyStore keyStore = KeyStore.getInstance(this.type);
-
-		try (InputStream stream = this.url.openStream()) {
-			keyStore.load(stream, this.keyStorePassword != null ? this.keyStorePassword.toCharArray() : null);
-		}
-
-		String effectiveKeyAlias = this.keyAlias;
-
-		if (effectiveKeyAlias == null) {
-			if (keyStore.size() != 1) {
-				throw new IllegalArgumentException(
-						"Key store contains more than one key. The use of the 'keyAlias' parameter is required.");
-			}
-			try {
-				effectiveKeyAlias = keyStore.aliases().nextElement();
-			} catch (final NoSuchElementException e) {
-				throw new RuntimeException("Failed to enumerate key alias", e);
-			}
-		}
-
-		final Key privateKey = keyStore.getKey(effectiveKeyAlias,
-				this.keyPassword != null ? this.keyPassword.toCharArray() : null);
-
-		if (privateKey instanceof PrivateKey) {
-			final X509Certificate certificate = (X509Certificate) keyStore.getCertificate(effectiveKeyAlias);
-			if (certificate == null) {
-				return null;
-			}
-
-			final PublicKey publicKey = certificate.getPublicKey();
-			final KeyPair keyPair = new KeyPair(publicKey, (PrivateKey) privateKey);
-			return new Result(certificate, keyPair);
-		}
+    public static class Result {
 
-		return null;
-	}
+        private final X509Certificate certificate;
+        private final KeyPair keyPair;
+
+        public Result(final X509Certificate certificate, final KeyPair keyPair) {
+            this.certificate = certificate;
+            this.keyPair = keyPair;
+        }
+
+        public X509Certificate getCertificate() {
+            return this.certificate;
+        }
+
+        public KeyPair getKeyPair() {
+            return this.keyPair;
+        }
+    }
+
+    public KeyStoreLoader() {
+    }
+
+    public void setType(final String type) {
+        this.type = type != null ? type : DEFAULT_KEY_STORE_TYPE;
+    }
+
+    public String getType() {
+        return this.type;
+    }
+
+    public void setUrl(final URL url) {
+        this.url = url;
+    }
+
+    public URL getUrl() {
+        return this.url;
+    }
+
+    public void setUrl(final String url) throws MalformedURLException {
+        this.url = new URL(url);
+    }
+
+    public void setKeyStorePassword(final String keyStorePassword) {
+        this.keyStorePassword = keyStorePassword;
+    }
+
+    public String getKeyStorePassword() {
+        return this.keyStorePassword;
+    }
+
+    public void setKeyPassword(final String keyPassword) {
+        this.keyPassword = keyPassword;
+    }
+
+    public String getKeyPassword() {
+        return this.keyPassword;
+    }
+
+    public void setKeyAlias(final String keyAlias) {
+        this.keyAlias = keyAlias;
+    }
+
+    public String getKeyAlias() {
+        return this.keyAlias;
+    }
+
+    public Result load() throws GeneralSecurityException, IOException {
+
+        final KeyStore keyStore = KeyStore.getInstance(this.type);
+
+        try (InputStream stream = this.url.openStream()) {
+            keyStore.load(stream, this.keyStorePassword != null ? this.keyStorePassword.toCharArray() : null);
+        }
+
+        String effectiveKeyAlias = this.keyAlias;
+
+        if (effectiveKeyAlias == null) {
+            if (keyStore.size() != 1) {
+                throw new IllegalArgumentException("Key store contains more than one key. The use of the 'keyAlias' parameter is required.");
+            }
+            try {
+                effectiveKeyAlias = keyStore.aliases().nextElement();
+            } catch (final NoSuchElementException e) {
+                throw new RuntimeException("Failed to enumerate key alias", e);
+            }
+        }
+
+        final Key privateKey = keyStore.getKey(effectiveKeyAlias, this.keyPassword != null ? this.keyPassword.toCharArray() : null);
+
+        if (privateKey instanceof PrivateKey) {
+            final X509Certificate certificate = (X509Certificate)keyStore.getCertificate(effectiveKeyAlias);
+            if (certificate == null) {
+                return null;
+            }
+
+            final PublicKey publicKey = certificate.getPublicKey();
+            final KeyPair keyPair = new KeyPair(publicKey, (PrivateKey)privateKey);
+            return new Result(certificate, keyPair);
+        }
+
+        return null;
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
index f696fda..5c9be28 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/Messages.java
@@ -20,19 +20,17 @@ import org.apache.camel.impl.DefaultMessage;
 import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
 
 public final class Messages {
-	private Messages() {
-	}
+    private Messages() {
+    }
 
-	/**
-	 * Fill a Message from a DataValue
-	 *
-	 * @param value
-	 *            the value to feed from
-	 * @param result
-	 *            the result to feed to
-	 */
-	public static void fillFromDataValue(final DataValue value, final DefaultMessage result) {
-		result.setBody(value);
-		result.setFault(value.getStatusCode().isBad());
-	}
+    /**
+     * Fill a Message from a DataValue
+     *
+     * @param value the value to feed from
+     * @param result the result to feed to
+     */
+    public static void fillFromDataValue(final DataValue value, final DefaultMessage result) {
+        result.setBody(value);
+        result.setFault(value.getStatusCode().isBad());
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
index 4960b75..ac5bf9f 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NamespaceId.java
@@ -24,60 +24,60 @@ import org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId;
 import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort;
 
 public class NamespaceId {
-	private final String uri;
-	private final UShort numeric;
-
-	public NamespaceId(final String uri) {
-		requireNonNull(uri);
-
-		this.uri = uri;
-		this.numeric = null;
-	}
-
-	public NamespaceId(final UShort numeric) {
-		requireNonNull(numeric);
-
-		this.uri = null;
-		this.numeric = numeric;
-	}
-
-	public String getUri() {
-		return this.uri;
-	}
-
-	public UShort getNumeric() {
-		return this.numeric;
-	}
-
-	public boolean isNumeric() {
-		return this.numeric != null;
-	}
-
-	@Override
-	public String toString() {
-		if (isNumeric()) {
-			return String.format("[Namespace - numeric: %s]", this.numeric);
-		} else {
-			return String.format("[Namespace - URI: %s]", this.uri);
-		}
-	}
-
-	public Serializable getValue() {
-		return this.uri != null ? this.uri : this.numeric;
-	}
-
-	public static NamespaceId fromExpandedNodeId(final ExpandedNodeId id) {
-		if (id == null) {
-			return null;
-		}
-
-		if (id.getNamespaceUri() != null) {
-			return new NamespaceId(id.getNamespaceUri());
-		}
-		if (id.getNamespaceIndex() != null) {
-			return new NamespaceId(id.getNamespaceIndex());
-		}
-
-		throw new IllegalStateException(String.format("Unknown namespace type"));
-	}
+    private final String uri;
+    private final UShort numeric;
+
+    public NamespaceId(final String uri) {
+        requireNonNull(uri);
+
+        this.uri = uri;
+        this.numeric = null;
+    }
+
+    public NamespaceId(final UShort numeric) {
+        requireNonNull(numeric);
+
+        this.uri = null;
+        this.numeric = numeric;
+    }
+
+    public String getUri() {
+        return this.uri;
+    }
+
+    public UShort getNumeric() {
+        return this.numeric;
+    }
+
+    public boolean isNumeric() {
+        return this.numeric != null;
+    }
+
+    @Override
+    public String toString() {
+        if (isNumeric()) {
+            return String.format("[Namespace - numeric: %s]", this.numeric);
+        } else {
+            return String.format("[Namespace - URI: %s]", this.uri);
+        }
+    }
+
+    public Serializable getValue() {
+        return this.uri != null ? this.uri : this.numeric;
+    }
+
+    public static NamespaceId fromExpandedNodeId(final ExpandedNodeId id) {
+        if (id == null) {
+            return null;
+        }
+
+        if (id.getNamespaceUri() != null) {
+            return new NamespaceId(id.getNamespaceUri());
+        }
+        if (id.getNamespaceIndex() != null) {
+            return new NamespaceId(id.getNamespaceIndex());
+        }
+
+        throw new IllegalStateException(String.format("Unknown namespace type"));
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/NodeIds.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/NodeIds.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NodeIds.java
index 1f61ebb..0dad418 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/NodeIds.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NodeIds.java
@@ -26,197 +26,181 @@ import org.eclipse.milo.opcua.stack.core.types.builtin.ByteString;
  * Helper class to work with node IDs
  */
 public final class NodeIds {
-	private NodeIds() {
-	}
-
-	/**
-	 * Create an attribute value for the "node" attribute
-	 * 
-	 * @param namespace
-	 *            the namespace to use
-	 * @param node
-	 *            the node ID
-	 * @return the value ready to append to a "node" URI attribute
-	 */
-	public static String nodeValue(final String namespace, final String node) {
-		Objects.requireNonNull(namespace);
-		Objects.requireNonNull(node);
-
-		final StringBuilder builder = new StringBuilder("RAW(");
-		appendNamespace(builder, namespace);
-		builder.append(';');
-		appendNodeId(builder, node);
-		builder.append(')');
-		return builder.toString();
-	}
-
-	/**
-	 * Create an attribute value for the "node" attribute
-	 * 
-	 * @param namespace
-	 *            the namespace to use
-	 * @param node
-	 *            the node ID
-	 * @return the value ready to append to a "node" URI attribute
-	 */
-	public static String nodeValue(final String namespace, final int node) {
-		Objects.requireNonNull(namespace);
-
-		final StringBuilder builder = new StringBuilder("RAW(");
-		appendNamespace(builder, namespace);
-		builder.append(';');
-		appendNodeId(builder, node);
-		builder.append(')');
-		return builder.toString();
-	}
-
-	/**
-	 * Create an attribute value for the "node" attribute
-	 * 
-	 * @param namespace
-	 *            the namespace to use
-	 * @param node
-	 *            the node ID
-	 * @return the value ready to append to a "node" URI attribute
-	 */
-	public static String nodeValue(final String namespace, final UUID node) {
-		Objects.requireNonNull(namespace);
-		Objects.requireNonNull(node);
-
-		final StringBuilder builder = new StringBuilder("RAW(");
-		appendNamespace(builder, namespace);
-		builder.append(';');
-		appendNodeId(builder, node);
-		builder.append(')');
-		return builder.toString();
-	}
-
-	/**
-	 * Create an attribute value for the "node" attribute
-	 * 
-	 * @param namespace
-	 *            the namespace to use
-	 * @param node
-	 *            the node ID
-	 * @return the value ready to append to a "node" URI attribute
-	 */
-	public static String nodeValue(final String namespace, final ByteString node) {
-		Objects.requireNonNull(namespace);
-		Objects.requireNonNull(node);
-
-		final StringBuilder builder = new StringBuilder("RAW(");
-		appendNamespace(builder, namespace);
-		builder.append(';');
-		appendNodeId(builder, node);
-		builder.append(')');
-		return builder.toString();
-	}
-
-	/**
-	 * Create an attribute value for the "node" attribute
-	 * 
-	 * @param namespace
-	 *            the namespace to use
-	 * @param node
-	 *            the node ID
-	 * @return the value ready to append to a "node" URI attribute
-	 */
-	public static String nodeValue(final int namespace, final String node) {
-		Objects.requireNonNull(namespace);
-		Objects.requireNonNull(node);
-
-		final StringBuilder builder = new StringBuilder("RAW(");
-		appendNamespace(builder, namespace);
-		builder.append(';');
-		appendNodeId(builder, node);
-		builder.append(')');
-		return builder.toString();
-	}
-
-	/**
-	 * Create an attribute value for the "node" attribute
-	 * 
-	 * @param namespace
-	 *            the namespace to use
-	 * @param node
-	 *            the node ID
-	 * @return the value ready to append to a "node" URI attribute
-	 */
-	public static String nodeValue(final int namespace, final int node) {
-		Objects.requireNonNull(namespace);
-
-		final StringBuilder builder = new StringBuilder("RAW(");
-		appendNamespace(builder, namespace);
-		builder.append(';');
-		appendNodeId(builder, node);
-		builder.append(')');
-		return builder.toString();
-	}
-
-	/**
-	 * Create an attribute value for the "node" attribute
-	 * 
-	 * @param namespace
-	 *            the namespace to use
-	 * @param node
-	 *            the node ID
-	 * @return the value ready to append to a "node" URI attribute
-	 */
-	public static String nodeValue(final int namespace, final UUID node) {
-		Objects.requireNonNull(namespace);
-		Objects.requireNonNull(node);
-
-		final StringBuilder builder = new StringBuilder("RAW(");
-		appendNamespace(builder, namespace);
-		builder.append(';');
-		appendNodeId(builder, node);
-		builder.append(')');
-		return builder.toString();
-	}
-
-	/**
-	 * Create an attribute value for the "node" attribute
-	 * 
-	 * @param namespace
-	 *            the namespace to use
-	 * @param node
-	 *            the node ID
-	 * @return the value ready to append to a "node" URI attribute
-	 */
-	public static String nodeValue(final int namespace, final ByteString node) {
-		Objects.requireNonNull(namespace);
-		Objects.requireNonNull(node);
-
-		final StringBuilder builder = new StringBuilder("RAW(");
-		appendNamespace(builder, namespace);
-		builder.append(';');
-		appendNodeId(builder, node);
-		builder.append(')');
-		return builder.toString();
-	}
-
-	private static void appendNamespace(final StringBuilder builder, final String namespace) {
-		builder.append("nsu=").append(namespace);
-	}
-
-	private static void appendNamespace(final StringBuilder builder, final int namespace) {
-		builder.append("ns=").append(Integer.toUnsignedString(namespace));
-	}
-
-	private static void appendNodeId(final StringBuilder builder, final String nodeId) {
-		builder.append("s=").append(nodeId);
-	}
-
-	private static void appendNodeId(final StringBuilder builder, final int nodeId) {
-		builder.append("i=").append(Integer.toUnsignedString(nodeId));
-	}
-
-	private static void appendNodeId(final StringBuilder builder, final UUID nodeId) {
-		builder.append("g=").append(nodeId);
-	}
-
-	private static void appendNodeId(final StringBuilder builder, final ByteString nodeId) {
-		builder.append("b=").append(Base64.getEncoder().encodeToString(nodeId.bytes()));
-	}
+    private NodeIds() {
+    }
+
+    /**
+     * Create an attribute value for the "node" attribute
+     * 
+     * @param namespace the namespace to use
+     * @param node the node ID
+     * @return the value ready to append to a "node" URI attribute
+     */
+    public static String nodeValue(final String namespace, final String node) {
+        Objects.requireNonNull(namespace);
+        Objects.requireNonNull(node);
+
+        final StringBuilder builder = new StringBuilder("RAW(");
+        appendNamespace(builder, namespace);
+        builder.append(';');
+        appendNodeId(builder, node);
+        builder.append(')');
+        return builder.toString();
+    }
+
+    /**
+     * Create an attribute value for the "node" attribute
+     * 
+     * @param namespace the namespace to use
+     * @param node the node ID
+     * @return the value ready to append to a "node" URI attribute
+     */
+    public static String nodeValue(final String namespace, final int node) {
+        Objects.requireNonNull(namespace);
+
+        final StringBuilder builder = new StringBuilder("RAW(");
+        appendNamespace(builder, namespace);
+        builder.append(';');
+        appendNodeId(builder, node);
+        builder.append(')');
+        return builder.toString();
+    }
+
+    /**
+     * Create an attribute value for the "node" attribute
+     * 
+     * @param namespace the namespace to use
+     * @param node the node ID
+     * @return the value ready to append to a "node" URI attribute
+     */
+    public static String nodeValue(final String namespace, final UUID node) {
+        Objects.requireNonNull(namespace);
+        Objects.requireNonNull(node);
+
+        final StringBuilder builder = new StringBuilder("RAW(");
+        appendNamespace(builder, namespace);
+        builder.append(';');
+        appendNodeId(builder, node);
+        builder.append(')');
+        return builder.toString();
+    }
+
+    /**
+     * Create an attribute value for the "node" attribute
+     * 
+     * @param namespace the namespace to use
+     * @param node the node ID
+     * @return the value ready to append to a "node" URI attribute
+     */
+    public static String nodeValue(final String namespace, final ByteString node) {
+        Objects.requireNonNull(namespace);
+        Objects.requireNonNull(node);
+
+        final StringBuilder builder = new StringBuilder("RAW(");
+        appendNamespace(builder, namespace);
+        builder.append(';');
+        appendNodeId(builder, node);
+        builder.append(')');
+        return builder.toString();
+    }
+
+    /**
+     * Create an attribute value for the "node" attribute
+     * 
+     * @param namespace the namespace to use
+     * @param node the node ID
+     * @return the value ready to append to a "node" URI attribute
+     */
+    public static String nodeValue(final int namespace, final String node) {
+        Objects.requireNonNull(namespace);
+        Objects.requireNonNull(node);
+
+        final StringBuilder builder = new StringBuilder("RAW(");
+        appendNamespace(builder, namespace);
+        builder.append(';');
+        appendNodeId(builder, node);
+        builder.append(')');
+        return builder.toString();
+    }
+
+    /**
+     * Create an attribute value for the "node" attribute
+     * 
+     * @param namespace the namespace to use
+     * @param node the node ID
+     * @return the value ready to append to a "node" URI attribute
+     */
+    public static String nodeValue(final int namespace, final int node) {
+        Objects.requireNonNull(namespace);
+
+        final StringBuilder builder = new StringBuilder("RAW(");
+        appendNamespace(builder, namespace);
+        builder.append(';');
+        appendNodeId(builder, node);
+        builder.append(')');
+        return builder.toString();
+    }
+
+    /**
+     * Create an attribute value for the "node" attribute
+     * 
+     * @param namespace the namespace to use
+     * @param node the node ID
+     * @return the value ready to append to a "node" URI attribute
+     */
+    public static String nodeValue(final int namespace, final UUID node) {
+        Objects.requireNonNull(namespace);
+        Objects.requireNonNull(node);
+
+        final StringBuilder builder = new StringBuilder("RAW(");
+        appendNamespace(builder, namespace);
+        builder.append(';');
+        appendNodeId(builder, node);
+        builder.append(')');
+        return builder.toString();
+    }
+
+    /**
+     * Create an attribute value for the "node" attribute
+     * 
+     * @param namespace the namespace to use
+     * @param node the node ID
+     * @return the value ready to append to a "node" URI attribute
+     */
+    public static String nodeValue(final int namespace, final ByteString node) {
+        Objects.requireNonNull(namespace);
+        Objects.requireNonNull(node);
+
+        final StringBuilder builder = new StringBuilder("RAW(");
+        appendNamespace(builder, namespace);
+        builder.append(';');
+        appendNodeId(builder, node);
+        builder.append(')');
+        return builder.toString();
+    }
+
+    private static void appendNamespace(final StringBuilder builder, final String namespace) {
+        builder.append("nsu=").append(namespace);
+    }
+
+    private static void appendNamespace(final StringBuilder builder, final int namespace) {
+        builder.append("ns=").append(Integer.toUnsignedString(namespace));
+    }
+
+    private static void appendNodeId(final StringBuilder builder, final String nodeId) {
+        builder.append("s=").append(nodeId);
+    }
+
+    private static void appendNodeId(final StringBuilder builder, final int nodeId) {
+        builder.append("i=").append(Integer.toUnsignedString(nodeId));
+    }
+
+    private static void appendNodeId(final StringBuilder builder, final UUID nodeId) {
+        builder.append("g=").append(nodeId);
+    }
+
+    private static void appendNodeId(final StringBuilder builder, final ByteString nodeId) {
+        builder.append("b=").append(Base64.getEncoder().encodeToString(nodeId.bytes()));
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
index 21d2834..172702a 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/PartialNodeId.java
@@ -34,86 +34,86 @@ import com.google.common.base.MoreObjects;
 
 public class PartialNodeId {
 
-	private IdType type;
-
-	private final Serializable id;
-
-	public PartialNodeId(final int id) {
-		this(uint(id));
-	}
-
-	public PartialNodeId(final UInteger id) {
-		requireNonNull(id);
-		this.id = id;
-	}
-
-	public PartialNodeId(final String id) {
-		requireNonNull(id);
-		this.id = id;
-	}
-
-	public PartialNodeId(final UUID id) {
-		requireNonNull(id);
-		this.id = id;
-	}
-
-	public PartialNodeId(final ByteString id) {
-		requireNonNull(id);
-		this.id = id;
-	}
-
-	public NodeId toNodeId(final int namespaceIndex) {
-		if (this.id instanceof String) {
-			return new NodeId(namespaceIndex, (String) this.id);
-		} else if (this.id instanceof UInteger) {
-			return new NodeId(ushort(namespaceIndex), (UInteger) this.id);
-		} else if (this.id instanceof ByteString) {
-			return new NodeId(namespaceIndex, (ByteString) this.id);
-		} else if (this.id instanceof UUID) {
-			return new NodeId(namespaceIndex, (UUID) this.id);
-		}
-		throw new IllegalStateException("Invalid id type: " + this.id);
-	}
-
-	public NodeId toNodeId(final UShort namespaceIndex) {
-		if (this.id instanceof String) {
-			return new NodeId(namespaceIndex, (String) this.id);
-		} else if (this.id instanceof UInteger) {
-			return new NodeId(namespaceIndex, (UInteger) this.id);
-		} else if (this.id instanceof ByteString) {
-			return new NodeId(namespaceIndex, (ByteString) this.id);
-		} else if (this.id instanceof UUID) {
-			return new NodeId(namespaceIndex, (UUID) this.id);
-		}
-		throw new IllegalStateException("Invalid id type: " + this.id);
-	}
-
-	@Override
-	public String toString() {
-		return MoreObjects.toStringHelper(this).add("type", this.type).add("id", this.id).toString();
-	}
-
-	public Serializable getValue() {
-		return this.id;
-	}
-
-	public static PartialNodeId fromExpandedNodeId(final ExpandedNodeId node) {
-		if (node == null) {
-			return null;
-		}
-
-		final Object value = node.getIdentifier();
-
-		if (value instanceof String) {
-			return new PartialNodeId((String) value);
-		} else if (value instanceof UInteger) {
-			return new PartialNodeId((UInteger) value);
-		} else if (value instanceof UUID) {
-			return new PartialNodeId((UUID) value);
-		} else if (value instanceof ByteString) {
-			return new PartialNodeId((ByteString) value);
-		}
-
-		throw new IllegalStateException(String.format("Unknown node id type: " + value));
-	}
+    private IdType type;
+
+    private final Serializable id;
+
+    public PartialNodeId(final int id) {
+        this(uint(id));
+    }
+
+    public PartialNodeId(final UInteger id) {
+        requireNonNull(id);
+        this.id = id;
+    }
+
+    public PartialNodeId(final String id) {
+        requireNonNull(id);
+        this.id = id;
+    }
+
+    public PartialNodeId(final UUID id) {
+        requireNonNull(id);
+        this.id = id;
+    }
+
+    public PartialNodeId(final ByteString id) {
+        requireNonNull(id);
+        this.id = id;
+    }
+
+    public NodeId toNodeId(final int namespaceIndex) {
+        if (this.id instanceof String) {
+            return new NodeId(namespaceIndex, (String)this.id);
+        } else if (this.id instanceof UInteger) {
+            return new NodeId(ushort(namespaceIndex), (UInteger)this.id);
+        } else if (this.id instanceof ByteString) {
+            return new NodeId(namespaceIndex, (ByteString)this.id);
+        } else if (this.id instanceof UUID) {
+            return new NodeId(namespaceIndex, (UUID)this.id);
+        }
+        throw new IllegalStateException("Invalid id type: " + this.id);
+    }
+
+    public NodeId toNodeId(final UShort namespaceIndex) {
+        if (this.id instanceof String) {
+            return new NodeId(namespaceIndex, (String)this.id);
+        } else if (this.id instanceof UInteger) {
+            return new NodeId(namespaceIndex, (UInteger)this.id);
+        } else if (this.id instanceof ByteString) {
+            return new NodeId(namespaceIndex, (ByteString)this.id);
+        } else if (this.id instanceof UUID) {
+            return new NodeId(namespaceIndex, (UUID)this.id);
+        }
+        throw new IllegalStateException("Invalid id type: " + this.id);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this).add("type", this.type).add("id", this.id).toString();
+    }
+
+    public Serializable getValue() {
+        return this.id;
+    }
+
+    public static PartialNodeId fromExpandedNodeId(final ExpandedNodeId node) {
+        if (node == null) {
+            return null;
+        }
+
+        final Object value = node.getIdentifier();
+
+        if (value instanceof String) {
+            return new PartialNodeId((String)value);
+        } else if (value instanceof UInteger) {
+            return new PartialNodeId((UInteger)value);
+        } else if (value instanceof UUID) {
+            return new PartialNodeId((UUID)value);
+        } else if (value instanceof ByteString) {
+            return new PartialNodeId((ByteString)value);
+        }
+
+        throw new IllegalStateException(String.format("Unknown node id type: " + value));
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
index 94520e5..580d5e9 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java
@@ -39,181 +39,177 @@ import com.google.common.collect.Multimap;
 
 public class MiloClientComponent extends DefaultComponent {
 
-	private static final Logger LOG = LoggerFactory.getLogger(MiloClientComponent.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MiloClientComponent.class);
 
-	private final Map<String, MiloClientConnection> cache = new HashMap<>();
-	private final Multimap<String, MiloClientEndpoint> connectionMap = HashMultimap.create();
+    private final Map<String, MiloClientConnection> cache = new HashMap<>();
+    private final Multimap<String, MiloClientEndpoint> connectionMap = HashMultimap.create();
 
-	private MiloClientConfiguration defaultConfiguration = new MiloClientConfiguration();
+    private MiloClientConfiguration defaultConfiguration = new MiloClientConfiguration();
 
-	@Override
-	protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters)
-			throws Exception {
+    @Override
+    protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters) throws Exception {
 
-		final MiloClientConfiguration configuration = new MiloClientConfiguration(this.defaultConfiguration);
-		configuration.setEndpointUri(remaining);
-		setProperties(configuration, parameters);
+        final MiloClientConfiguration configuration = new MiloClientConfiguration(this.defaultConfiguration);
+        configuration.setEndpointUri(remaining);
+        setProperties(configuration, parameters);
 
-		return createEndpoint(uri, configuration, parameters);
-	}
+        return createEndpoint(uri, configuration, parameters);
+    }
 
-	private synchronized MiloClientEndpoint createEndpoint(final String uri,
-			final MiloClientConfiguration configuration, final Map<String, Object> parameters) throws Exception {
+    private synchronized MiloClientEndpoint createEndpoint(final String uri, final MiloClientConfiguration configuration, final Map<String, Object> parameters) throws Exception {
 
-		MiloClientConnection connection = this.cache.get(configuration.toCacheId());
+        MiloClientConnection connection = this.cache.get(configuration.toCacheId());
 
-		if (connection == null) {
-			LOG.info("Cache miss - creating new connection instance: {}", configuration.toCacheId());
+        if (connection == null) {
+            LOG.info("Cache miss - creating new connection instance: {}", configuration.toCacheId());
 
-			connection = new MiloClientConnection(configuration, mapToClientConfiguration(configuration));
-			this.cache.put(configuration.toCacheId(), connection);
-		}
+            connection = new MiloClientConnection(configuration, mapToClientConfiguration(configuration));
+            this.cache.put(configuration.toCacheId(), connection);
+        }
 
-		final MiloClientEndpoint endpoint = new MiloClientEndpoint(uri, this, connection,
-				configuration.getEndpointUri());
+        final MiloClientEndpoint endpoint = new MiloClientEndpoint(uri, this, connection, configuration.getEndpointUri());
 
-		setProperties(endpoint, parameters);
+        setProperties(endpoint, parameters);
 
-		// register connection with endpoint
+        // register connection with endpoint
 
-		this.connectionMap.put(configuration.toCacheId(), endpoint);
+        this.connectionMap.put(configuration.toCacheId(), endpoint);
 
-		return endpoint;
-	}
-
-	private OpcUaClientConfigBuilder mapToClientConfiguration(final MiloClientConfiguration configuration) {
-		final OpcUaClientConfigBuilder builder = new OpcUaClientConfigBuilder();
-
-		whenHasText(configuration::getApplicationName,
-				value -> builder.setApplicationName(LocalizedText.english(value)));
-		whenHasText(configuration::getApplicationUri, builder::setApplicationUri);
-		whenHasText(configuration::getProductUri, builder::setProductUri);
-
-		if (configuration.getRequestTimeout() != null) {
-			builder.setRequestTimeout(Unsigned.uint(configuration.getRequestTimeout()));
-		}
-		if (configuration.getChannelLifetime() != null) {
-			builder.setChannelLifetime(Unsigned.uint(configuration.getChannelLifetime()));
-		}
+        return endpoint;
+    }
 
-		whenHasText(configuration::getSessionName, value -> builder.setSessionName(() -> value));
-		if (configuration.getSessionTimeout() != null) {
-			builder.setSessionTimeout(UInteger.valueOf(configuration.getSessionTimeout()));
-		}
+    private OpcUaClientConfigBuilder mapToClientConfiguration(final MiloClientConfiguration configuration) {
+        final OpcUaClientConfigBuilder builder = new OpcUaClientConfigBuilder();
 
-		if (configuration.getMaxPendingPublishRequests() != null) {
-			builder.setMaxPendingPublishRequests(UInteger.valueOf(configuration.getMaxPendingPublishRequests()));
-		}
+        whenHasText(configuration::getApplicationName, value -> builder.setApplicationName(LocalizedText.english(value)));
+        whenHasText(configuration::getApplicationUri, builder::setApplicationUri);
+        whenHasText(configuration::getProductUri, builder::setProductUri);
 
-		if (configuration.getMaxResponseMessageSize() != null) {
-			builder.setMaxResponseMessageSize(UInteger.valueOf(configuration.getMaxPendingPublishRequests()));
-		}
+        if (configuration.getRequestTimeout() != null) {
+            builder.setRequestTimeout(Unsigned.uint(configuration.getRequestTimeout()));
+        }
+        if (configuration.getChannelLifetime() != null) {
+            builder.setChannelLifetime(Unsigned.uint(configuration.getChannelLifetime()));
+        }
 
-		if (configuration.getSecureChannelReauthenticationEnabled() != null) {
-			builder.setSecureChannelReauthenticationEnabled(configuration.getSecureChannelReauthenticationEnabled());
-		}
+        whenHasText(configuration::getSessionName, value -> builder.setSessionName(() -> value));
+        if (configuration.getSessionTimeout() != null) {
+            builder.setSessionTimeout(UInteger.valueOf(configuration.getSessionTimeout()));
+        }
 
-		if (configuration.getKeyStoreUrl() != null) {
-			setKey(configuration, builder);
-		}
+        if (configuration.getMaxPendingPublishRequests() != null) {
+            builder.setMaxPendingPublishRequests(UInteger.valueOf(configuration.getMaxPendingPublishRequests()));
+        }
 
-		return builder;
-	}
+        if (configuration.getMaxResponseMessageSize() != null) {
+            builder.setMaxResponseMessageSize(UInteger.valueOf(configuration.getMaxPendingPublishRequests()));
+        }
 
-	private void setKey(final MiloClientConfiguration configuration, final OpcUaClientConfigBuilder builder) {
-		final KeyStoreLoader loader = new KeyStoreLoader();
+        if (configuration.getSecureChannelReauthenticationEnabled() != null) {
+            builder.setSecureChannelReauthenticationEnabled(configuration.getSecureChannelReauthenticationEnabled());
+        }
 
-		final Result result;
-		try {
-			// key store properties
-			loader.setType(configuration.getKeyStoreType());
-			loader.setUrl(configuration.getKeyStoreUrl());
-			loader.setKeyStorePassword(configuration.getKeyStorePassword());
+        if (configuration.getKeyStoreUrl() != null) {
+            setKey(configuration, builder);
+        }
 
-			// key properties
-			loader.setKeyAlias(configuration.getKeyAlias());
-			loader.setKeyPassword(configuration.getKeyPassword());
+        return builder;
+    }
 
-			result = loader.load();
-		} catch (GeneralSecurityException | IOException e) {
-			throw new IllegalStateException("Failed to load key", e);
-		}
+    private void setKey(final MiloClientConfiguration configuration, final OpcUaClientConfigBuilder builder) {
+        final KeyStoreLoader loader = new KeyStoreLoader();
 
-		if (result == null) {
-			throw new IllegalStateException("Key not found in keystore");
-		}
+        final Result result;
+        try {
+            // key store properties
+            loader.setType(configuration.getKeyStoreType());
+            loader.setUrl(configuration.getKeyStoreUrl());
+            loader.setKeyStorePassword(configuration.getKeyStorePassword());
 
-		builder.setCertificate(result.getCertificate());
-		builder.setKeyPair(result.getKeyPair());
-	}
+            // key properties
+            loader.setKeyAlias(configuration.getKeyAlias());
+            loader.setKeyPassword(configuration.getKeyPassword());
 
-	private void whenHasText(final Supplier<String> valueSupplier, final Consumer<String> valueConsumer) {
-		final String value = valueSupplier.get();
-		if (value != null && !value.isEmpty()) {
-			valueConsumer.accept(value);
-		}
-	}
+            result = loader.load();
+        } catch (GeneralSecurityException | IOException e) {
+            throw new IllegalStateException("Failed to load key", e);
+        }
 
-	/**
-	 * All default options for client
-	 */
-	public void setDefaultConfiguration(final MiloClientConfiguration defaultConfiguration) {
-		this.defaultConfiguration = defaultConfiguration;
-	}
+        if (result == null) {
+            throw new IllegalStateException("Key not found in keystore");
+        }
 
-	/**
-	 * Default application name
-	 */
-	public void setApplicationName(final String applicationName) {
-		this.defaultConfiguration.setApplicationName(applicationName);
-	}
+        builder.setCertificate(result.getCertificate());
+        builder.setKeyPair(result.getKeyPair());
+    }
 
-	/**
-	 * Default application URI
-	 */
-	public void setApplicationUri(final String applicationUri) {
-		this.defaultConfiguration.setApplicationUri(applicationUri);
-	}
-
-	/**
-	 * Default product URI
-	 */
-	public void setProductUri(final String productUri) {
-		this.defaultConfiguration.setProductUri(productUri);
-	}
-
-	/**
-	 * Default reconnect timeout
-	 */
-	public void setReconnectTimeout(final Long reconnectTimeout) {
-		this.defaultConfiguration.setRequestTimeout(reconnectTimeout);
-	}
-
-	public synchronized void disposed(final MiloClientEndpoint endpoint) {
-
-		final MiloClientConnection connection = endpoint.getConnection();
-
-		// unregister usage of connection
-
-		this.connectionMap.remove(connection.getConnectionId(), endpoint);
-
-		// test if this was the last endpoint using this connection
-
-		if (!this.connectionMap.containsKey(connection.getConnectionId())) {
-
-			// this was the last endpoint using the connection ...
-
-			// ... remove from the cache
-
-			this.cache.remove(connection.getConnectionId());
-
-			// ... and close
-
-			try {
-				connection.close();
-			} catch (final Exception e) {
-				LOG.warn("Failed to close connection", e);
-			}
-		}
-	}
+    private void whenHasText(final Supplier<String> valueSupplier, final Consumer<String> valueConsumer) {
+        final String value = valueSupplier.get();
+        if (value != null && !value.isEmpty()) {
+            valueConsumer.accept(value);
+        }
+    }
+
+    /**
+     * All default options for client
+     */
+    public void setDefaultConfiguration(final MiloClientConfiguration defaultConfiguration) {
+        this.defaultConfiguration = defaultConfiguration;
+    }
+
+    /**
+     * Default application name
+     */
+    public void setApplicationName(final String applicationName) {
+        this.defaultConfiguration.setApplicationName(applicationName);
+    }
+
+    /**
+     * Default application URI
+     */
+    public void setApplicationUri(final String applicationUri) {
+        this.defaultConfiguration.setApplicationUri(applicationUri);
+    }
+
+    /**
+     * Default product URI
+     */
+    public void setProductUri(final String productUri) {
+        this.defaultConfiguration.setProductUri(productUri);
+    }
+
+    /**
+     * Default reconnect timeout
+     */
+    public void setReconnectTimeout(final Long reconnectTimeout) {
+        this.defaultConfiguration.setRequestTimeout(reconnectTimeout);
+    }
+
+    public synchronized void disposed(final MiloClientEndpoint endpoint) {
+
+        final MiloClientConnection connection = endpoint.getConnection();
+
+        // unregister usage of connection
+
+        this.connectionMap.remove(connection.getConnectionId(), endpoint);
+
+        // test if this was the last endpoint using this connection
+
+        if (!this.connectionMap.containsKey(connection.getConnectionId())) {
+
+            // this was the last endpoint using the connection ...
+
+            // ... remove from the cache
+
+            this.cache.remove(connection.getConnectionId());
+
+            // ... and close
+
+            try {
+                connection.close();
+            } catch (final Exception e) {
+                LOG.warn("Failed to close connection", e);
+            }
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
index 037a109..b390c08 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
@@ -26,267 +26,267 @@ import org.apache.camel.spi.UriParams;
 @UriParams
 public class MiloClientConfiguration implements Cloneable {
 
-	private static final String DEFAULT_APPLICATION_URI = "http://camel.apache.org/EclipseMilo/Client";
+    private static final String DEFAULT_APPLICATION_URI = "http://camel.apache.org/EclipseMilo/Client";
 
-	private static final String DEFAULT_APPLICATION_NAME = "Apache Camel adapter for Eclipse Milo";
+    private static final String DEFAULT_APPLICATION_NAME = "Apache Camel adapter for Eclipse Milo";
 
-	private static final String DEFAULT_PRODUCT_URI = "http://camel.apache.org/EclipseMilo";
+    private static final String DEFAULT_PRODUCT_URI = "http://camel.apache.org/EclipseMilo";
 
-	private String endpointUri;
+    private String endpointUri;
 
-	@UriParam
-	private String clientId;
+    @UriParam
+    private String clientId;
 
-	@UriParam(label = "client", defaultValue = DEFAULT_APPLICATION_NAME)
-	private String applicationName = DEFAULT_APPLICATION_NAME;
+    @UriParam(label = "client", defaultValue = DEFAULT_APPLICATION_NAME)
+    private String applicationName = DEFAULT_APPLICATION_NAME;
 
-	@UriParam(label = "client", defaultValue = DEFAULT_APPLICATION_URI)
-	private String applicationUri = DEFAULT_APPLICATION_URI;
+    @UriParam(label = "client", defaultValue = DEFAULT_APPLICATION_URI)
+    private String applicationUri = DEFAULT_APPLICATION_URI;
 
-	@UriParam(label = "client", defaultValue = DEFAULT_PRODUCT_URI)
-	private String productUri = DEFAULT_PRODUCT_URI;
+    @UriParam(label = "client", defaultValue = DEFAULT_PRODUCT_URI)
+    private String productUri = DEFAULT_PRODUCT_URI;
 
-	@UriParam(label = "client")
-	private Long requestTimeout;
+    @UriParam(label = "client")
+    private Long requestTimeout;
 
-	@UriParam(label = "client")
-	private Long channelLifetime;
+    @UriParam(label = "client")
+    private Long channelLifetime;
 
-	@UriParam(label = "client")
-	private String sessionName;
+    @UriParam(label = "client")
+    private String sessionName;
 
-	@UriParam(label = "client")
-	private Long sessionTimeout;
+    @UriParam(label = "client")
+    private Long sessionTimeout;
 
-	@UriParam(label = "client")
-	private Long maxPendingPublishRequests;
+    @UriParam(label = "client")
+    private Long maxPendingPublishRequests;
 
-	@UriParam(label = "client")
-	private Long maxResponseMessageSize;
+    @UriParam(label = "client")
+    private Long maxResponseMessageSize;
 
-	@UriParam(label = "client")
-	private Boolean secureChannelReauthenticationEnabled;
+    @UriParam(label = "client")
+    private Boolean secureChannelReauthenticationEnabled;
 
-	@UriParam(label = "client")
-	private URL keyStoreUrl;
+    @UriParam(label = "client")
+    private URL keyStoreUrl;
 
-	@UriParam(label = "client")
-	private String keyStoreType = KeyStoreLoader.DEFAULT_KEY_STORE_TYPE;
+    @UriParam(label = "client")
+    private String keyStoreType = KeyStoreLoader.DEFAULT_KEY_STORE_TYPE;
 
-	@UriParam(label = "client")
-	private String keyAlias;
+    @UriParam(label = "client")
+    private String keyAlias;
 
-	@UriParam(label = "client", secret = true)
-	private String keyStorePassword;
+    @UriParam(label = "client", secret = true)
+    private String keyStorePassword;
 
-	@UriParam(label = "client", secret = true)
-	private String keyPassword;
-
-	public MiloClientConfiguration() {
-	}
+    @UriParam(label = "client", secret = true)
+    private String keyPassword;
+
+    public MiloClientConfiguration() {
+    }
 
-	public MiloClientConfiguration(final MiloClientConfiguration other) {
-		this.clientId = other.clientId;
-		this.endpointUri = other.endpointUri;
-		this.applicationName = other.applicationName;
-		this.productUri = other.productUri;
-		this.requestTimeout = other.requestTimeout;
-	}
-
-	public void setEndpointUri(final String endpointUri) {
-		this.endpointUri = endpointUri;
-	}
-
-	public String getEndpointUri() {
-		return this.endpointUri;
-	}
-
-	/**
-	 * A virtual client id to force the creation of a new connection instance
-	 */
-	public void setClientId(final String clientId) {
-		this.clientId = clientId;
-	}
-
-	public String getClientId() {
-		return this.clientId;
-	}
-
-	/**
-	 * The application name
-	 */
-	public void setApplicationName(final String applicationName) {
-		this.applicationName = applicationName;
-	}
-
-	public String getApplicationName() {
-		return this.applicationName;
-	}
-
-	/**
-	 * The application URI
-	 */
-	public void setApplicationUri(final String applicationUri) {
-		this.applicationUri = applicationUri;
-	}
-
-	public String getApplicationUri() {
-		return this.applicationUri;
-	}
-
-	/**
-	 * The product URI
-	 */
-	public void setProductUri(final String productUri) {
-		this.productUri = productUri;
-	}
-
-	public String getProductUri() {
-		return this.productUri;
-	}
-
-	/**
-	 * Request timeout in milliseconds
-	 */
-	public void setRequestTimeout(final Long reconnectTimeout) {
-		this.requestTimeout = reconnectTimeout;
-	}
-
-	public Long getRequestTimeout() {
-		return this.requestTimeout;
-	}
-
-	/**
-	 * Channel lifetime in milliseconds
-	 */
-	public void setChannelLifetime(final Long channelLifetime) {
-		this.channelLifetime = channelLifetime;
-	}
-
-	public Long getChannelLifetime() {
-		return this.channelLifetime;
-	}
-
-	/**
-	 * Session name
-	 */
-	public void setSessionName(final String sessionName) {
-		this.sessionName = sessionName;
-	}
-
-	public String getSessionName() {
-		return this.sessionName;
-	}
-
-	/**
-	 * Session timeout in milliseconds
-	 */
-	public void setSessionTimeout(final Long sessionTimeout) {
-		this.sessionTimeout = sessionTimeout;
-	}
-
-	public Long getSessionTimeout() {
-		return this.sessionTimeout;
-	}
-
-	/**
-	 * The maximum number of pending publish requests
-	 */
-	public void setMaxPendingPublishRequests(final Long maxPendingPublishRequests) {
-		this.maxPendingPublishRequests = maxPendingPublishRequests;
-	}
-
-	public Long getMaxPendingPublishRequests() {
-		return this.maxPendingPublishRequests;
-	}
-
-	/**
-	 * The maximum number of bytes a response message may have
-	 */
-	public void setMaxResponseMessageSize(final Long maxResponseMessageSize) {
-		this.maxResponseMessageSize = maxResponseMessageSize;
-	}
-
-	public Long getMaxResponseMessageSize() {
-		return this.maxResponseMessageSize;
-	}
-
-	/**
-	 * Whether secure channel re-authentication is enabled
-	 */
-	public void setSecureChannelReauthenticationEnabled(final Boolean secureChannelReauthenticationEnabled) {
-		this.secureChannelReauthenticationEnabled = secureChannelReauthenticationEnabled;
-	}
-
-	public Boolean getSecureChannelReauthenticationEnabled() {
-		return this.secureChannelReauthenticationEnabled;
-	}
-
-	/**
-	 * The URL where the key should be loaded from
-	 */
-	public void setKeyStoreUrl(final String keyStoreUrl) throws MalformedURLException {
-		this.keyStoreUrl = keyStoreUrl != null ? new URL(keyStoreUrl) : null;
-	}
-
-	public URL getKeyStoreUrl() {
-		return this.keyStoreUrl;
-	}
-
-	/**
-	 * The key store type
-	 */
-	public void setKeyStoreType(final String keyStoreType) {
-		this.keyStoreType = keyStoreType;
-	}
-
-	public String getKeyStoreType() {
-		return this.keyStoreType;
-	}
-
-	/**
-	 * The name of the key in the keystore file
-	 */
-	public void setKeyAlias(final String keyAlias) {
-		this.keyAlias = keyAlias;
-	}
-
-	public String getKeyAlias() {
-		return this.keyAlias;
-	}
-
-	/**
-	 * The keystore password
-	 */
-	public void setKeyStorePassword(final String keyStorePassword) {
-		this.keyStorePassword = keyStorePassword;
-	}
-
-	public String getKeyStorePassword() {
-		return this.keyStorePassword;
-	}
-
-	/**
-	 * The key password
-	 */
-	public void setKeyPassword(final String keyPassword) {
-		this.keyPassword = keyPassword;
-	}
-
-	public String getKeyPassword() {
-		return this.keyPassword;
-	}
-
-	@Override
-	public MiloClientConfiguration clone() {
-		return new MiloClientConfiguration(this);
-	}
-
-	public String toCacheId() {
-		if (this.clientId != null && !this.clientId.isEmpty()) {
-			return this.endpointUri + "|" + this.clientId;
-		} else {
-			return this.endpointUri;
-		}
-	}
+    public MiloClientConfiguration(final MiloClientConfiguration other) {
+        this.clientId = other.clientId;
+        this.endpointUri = other.endpointUri;
+        this.applicationName = other.applicationName;
+        this.productUri = other.productUri;
+        this.requestTimeout = other.requestTimeout;
+    }
+
+    public void setEndpointUri(final String endpointUri) {
+        this.endpointUri = endpointUri;
+    }
+
+    public String getEndpointUri() {
+        return this.endpointUri;
+    }
+
+    /**
+     * A virtual client id to force the creation of a new connection instance
+     */
+    public void setClientId(final String clientId) {
+        this.clientId = clientId;
+    }
+
+    public String getClientId() {
+        return this.clientId;
+    }
+
+    /**
+     * The application name
+     */
+    public void setApplicationName(final String applicationName) {
+        this.applicationName = applicationName;
+    }
+
+    public String getApplicationName() {
+        return this.applicationName;
+    }
+
+    /**
+     * The application URI
+     */
+    public void setApplicationUri(final String applicationUri) {
+        this.applicationUri = applicationUri;
+    }
+
+    public String getApplicationUri() {
+        return this.applicationUri;
+    }
+
+    /**
+     * The product URI
+     */
+    public void setProductUri(final String productUri) {
+        this.productUri = productUri;
+    }
+
+    public String getProductUri() {
+        return this.productUri;
+    }
+
+    /**
+     * Request timeout in milliseconds
+     */
+    public void setRequestTimeout(final Long reconnectTimeout) {
+        this.requestTimeout = reconnectTimeout;
+    }
+
+    public Long getRequestTimeout() {
+        return this.requestTimeout;
+    }
+
+    /**
+     * Channel lifetime in milliseconds
+     */
+    public void setChannelLifetime(final Long channelLifetime) {
+        this.channelLifetime = channelLifetime;
+    }
+
+    public Long getChannelLifetime() {
+        return this.channelLifetime;
+    }
+
+    /**
+     * Session name
+     */
+    public void setSessionName(final String sessionName) {
+        this.sessionName = sessionName;
+    }
+
+    public String getSessionName() {
+        return this.sessionName;
+    }
+
+    /**
+     * Session timeout in milliseconds
+     */
+    public void setSessionTimeout(final Long sessionTimeout) {
+        this.sessionTimeout = sessionTimeout;
+    }
+
+    public Long getSessionTimeout() {
+        return this.sessionTimeout;
+    }
+
+    /**
+     * The maximum number of pending publish requests
+     */
+    public void setMaxPendingPublishRequests(final Long maxPendingPublishRequests) {
+        this.maxPendingPublishRequests = maxPendingPublishRequests;
+    }
+
+    public Long getMaxPendingPublishRequests() {
+        return this.maxPendingPublishRequests;
+    }
+
+    /**
+     * The maximum number of bytes a response message may have
+     */
+    public void setMaxResponseMessageSize(final Long maxResponseMessageSize) {
+        this.maxResponseMessageSize = maxResponseMessageSize;
+    }
+
+    public Long getMaxResponseMessageSize() {
+        return this.maxResponseMessageSize;
+    }
+
+    /**
+     * Whether secure channel re-authentication is enabled
+     */
+    public void setSecureChannelReauthenticationEnabled(final Boolean secureChannelReauthenticationEnabled) {
+        this.secureChannelReauthenticationEnabled = secureChannelReauthenticationEnabled;
+    }
+
+    public Boolean getSecureChannelReauthenticationEnabled() {
+        return this.secureChannelReauthenticationEnabled;
+    }
+
+    /**
+     * The URL where the key should be loaded from
+     */
+    public void setKeyStoreUrl(final String keyStoreUrl) throws MalformedURLException {
+        this.keyStoreUrl = keyStoreUrl != null ? new URL(keyStoreUrl) : null;
+    }
+
+    public URL getKeyStoreUrl() {
+        return this.keyStoreUrl;
+    }
+
+    /**
+     * The key store type
+     */
+    public void setKeyStoreType(final String keyStoreType) {
+        this.keyStoreType = keyStoreType;
+    }
+
+    public String getKeyStoreType() {
+        return this.keyStoreType;
+    }
+
+    /**
+     * The name of the key in the keystore file
+     */
+    public void setKeyAlias(final String keyAlias) {
+        this.keyAlias = keyAlias;
+    }
+
+    public String getKeyAlias() {
+        return this.keyAlias;
+    }
+
+    /**
+     * The keystore password
+     */
+    public void setKeyStorePassword(final String keyStorePassword) {
+        this.keyStorePassword = keyStorePassword;
+    }
+
+    public String getKeyStorePassword() {
+        return this.keyStorePassword;
+    }
+
+    /**
+     * The key password
+     */
+    public void setKeyPassword(final String keyPassword) {
+        this.keyPassword = keyPassword;
+    }
+
+    public String getKeyPassword() {
+        return this.keyPassword;
+    }
+
+    @Override
+    public MiloClientConfiguration clone() {
+        return new MiloClientConfiguration(this);
+    }
+
+    public String toCacheId() {
+        if (this.clientId != null && !this.clientId.isEmpty()) {
+            return this.endpointUri + "|" + this.clientId;
+        } else {
+            return this.endpointUri;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
index dd90f80..7abf159 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
@@ -31,97 +31,91 @@ import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
 
 public class MiloClientConnection implements AutoCloseable {
 
-	private final MiloClientConfiguration configuration;
-
-	private SubscriptionManager manager;
-
-	private boolean initialized;
-
-	private final OpcUaClientConfigBuilder clientConfiguration;
-
-	public MiloClientConnection(final MiloClientConfiguration configuration,
-			final OpcUaClientConfigBuilder clientConfiguration) {
-		requireNonNull(configuration);
-
-		// make a copy since the configuration is mutable
-		this.configuration = configuration.clone();
-		this.clientConfiguration = clientConfiguration;
-	}
-
-	protected void init() throws Exception {
-		this.manager = new SubscriptionManager(this.configuration, this.clientConfiguration,
-				Stack.sharedScheduledExecutor(), 10_000);
-	}
-
-	@Override
-	public void close() throws Exception {
-		if (this.manager != null) {
-			this.manager.dispose();
-			this.manager = null;
-		}
-	}
-
-	protected synchronized void checkInit() {
-		if (this.initialized) {
-			return;
-		}
-
-		try {
-			init();
-		} catch (final Exception e) {
-			throw new RuntimeException(e);
-		}
-		this.initialized = true;
-	}
-
-	@FunctionalInterface
-	public interface MonitorHandle {
-		public void unregister();
-	}
-
-	public MonitorHandle monitorValue(final MiloClientItemConfiguration configuration,
-			final Consumer<DataValue> valueConsumer) {
-
-		requireNonNull(configuration);
-		requireNonNull(valueConsumer);
-
-		checkInit();
-
-		final NamespaceId namespaceId = configuration.makeNamespaceId();
-		final PartialNodeId partialNodeId = configuration.makePartialNodeId();
-
-		final UInteger handle = this.manager.registerItem(namespaceId, partialNodeId,
-				configuration.getSamplingInterval(), valueConsumer);
-
-		return () -> MiloClientConnection.this.manager.unregisterItem(handle);
-	}
-
-	public String getConnectionId() {
-		return this.configuration.toCacheId();
-	}
-
-	public void writeValue(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final Object value,
-			final boolean await) {
-		checkInit();
-
-		this.manager.write(namespaceId, partialNodeId, mapValue(value), await);
-	}
-
-	/**
-	 * Map the incoming value to some value writable to the milo client
-	 *
-	 * @param value
-	 *            the incoming value
-	 * @return the outgoing value
-	 */
-	private DataValue mapValue(final Object value) {
-		if (value instanceof DataValue) {
-			return (DataValue) value;
-		}
-		if (value instanceof Variant) {
-			return new DataValue((Variant) value);
-		}
-		return new DataValue(new Variant(value));
-	}
+    private final MiloClientConfiguration configuration;
+
+    private SubscriptionManager manager;
+
+    private boolean initialized;
+
+    private final OpcUaClientConfigBuilder clientConfiguration;
+
+    public MiloClientConnection(final MiloClientConfiguration configuration, final OpcUaClientConfigBuilder clientConfiguration) {
+        requireNonNull(configuration);
+
+        // make a copy since the configuration is mutable
+        this.configuration = configuration.clone();
+        this.clientConfiguration = clientConfiguration;
+    }
+
+    protected void init() throws Exception {
+        this.manager = new SubscriptionManager(this.configuration, this.clientConfiguration, Stack.sharedScheduledExecutor(), 10_000);
+    }
+
+    @Override
+    public void close() throws Exception {
+        if (this.manager != null) {
+            this.manager.dispose();
+            this.manager = null;
+        }
+    }
+
+    protected synchronized void checkInit() {
+        if (this.initialized) {
+            return;
+        }
+
+        try {
+            init();
+        } catch (final Exception e) {
+            throw new RuntimeException(e);
+        }
+        this.initialized = true;
+    }
+
+    @FunctionalInterface
+    public interface MonitorHandle {
+        public void unregister();
+    }
+
+    public MonitorHandle monitorValue(final MiloClientItemConfiguration configuration, final Consumer<DataValue> valueConsumer) {
+
+        requireNonNull(configuration);
+        requireNonNull(valueConsumer);
+
+        checkInit();
+
+        final NamespaceId namespaceId = configuration.makeNamespaceId();
+        final PartialNodeId partialNodeId = configuration.makePartialNodeId();
+
+        final UInteger handle = this.manager.registerItem(namespaceId, partialNodeId, configuration.getSamplingInterval(), valueConsumer);
+
+        return () -> MiloClientConnection.this.manager.unregisterItem(handle);
+    }
+
+    public String getConnectionId() {
+        return this.configuration.toCacheId();
+    }
+
+    public void writeValue(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final Object value, final boolean await) {
+        checkInit();
+
+        this.manager.write(namespaceId, partialNodeId, mapValue(value), await);
+    }
+
+    /**
+     * Map the incoming value to some value writable to the milo client
+     *
+     * @param value the incoming value
+     * @return the outgoing value
+     */
+    private DataValue mapValue(final Object value) {
+        if (value instanceof DataValue) {
+            return (DataValue)value;
+        }
+        if (value instanceof Variant) {
+            return new DataValue((Variant)value);
+        }
+        return new DataValue(new Variant(value));
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
index a57609e..b05ce87 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConsumer.java
@@ -31,62 +31,62 @@ import org.slf4j.LoggerFactory;
 
 public class MiloClientConsumer extends DefaultConsumer {
 
-	private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);
 
-	private final MiloClientConnection connection;
+    private final MiloClientConnection connection;
 
-	private final MiloClientItemConfiguration configuration;
+    private final MiloClientItemConfiguration configuration;
 
-	private MonitorHandle handle;
+    private MonitorHandle handle;
 
-	public MiloClientConsumer(final MiloClientEndpoint endpoint, final Processor processor,
-			final MiloClientConnection connection, final MiloClientItemConfiguration configuration) {
-		super(endpoint, processor);
+    public MiloClientConsumer(final MiloClientEndpoint endpoint, final Processor processor, final MiloClientConnection connection,
+                              final MiloClientItemConfiguration configuration) {
+        super(endpoint, processor);
 
-		Objects.requireNonNull(connection);
-		Objects.requireNonNull(configuration);
+        Objects.requireNonNull(connection);
+        Objects.requireNonNull(configuration);
 
-		this.connection = connection;
-		this.configuration = configuration;
-	}
+        this.connection = connection;
+        this.configuration = configuration;
+    }
 
-	@Override
-	protected void doStart() throws Exception {
-		super.doStart();
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
 
-		this.handle = this.connection.monitorValue(this.configuration, this::handleValueUpdate);
-	}
+        this.handle = this.connection.monitorValue(this.configuration, this::handleValueUpdate);
+    }
 
-	@Override
-	protected void doStop() throws Exception {
-		if (this.handle != null) {
-			this.handle.unregister();
-			this.handle = null;
-		}
+    @Override
+    protected void doStop() throws Exception {
+        if (this.handle != null) {
+            this.handle.unregister();
+            this.handle = null;
+        }
 
-		super.doStop();
-	}
+        super.doStop();
+    }
 
-	private void handleValueUpdate(final DataValue value) {
-		final Exchange exchange = getEndpoint().createExchange();
-		exchange.setIn(mapMessage(value));
-		try {
-			getAsyncProcessor().process(exchange);
-		} catch (final Exception e) {
-			LOG.debug("Failed to process message", e);
-		}
-	}
+    private void handleValueUpdate(final DataValue value) {
+        final Exchange exchange = getEndpoint().createExchange();
+        exchange.setIn(mapMessage(value));
+        try {
+            getAsyncProcessor().process(exchange);
+        } catch (final Exception e) {
+            LOG.debug("Failed to process message", e);
+        }
+    }
 
-	private Message mapMessage(final DataValue value) {
-		if (value == null) {
-			return null;
-		}
+    private Message mapMessage(final DataValue value) {
+        if (value == null) {
+            return null;
+        }
 
-		final DefaultMessage result = new DefaultMessage();
+        final DefaultMessage result = new DefaultMessage();
 
-		Messages.fillFromDataValue(value, result);
+        Messages.fillFromDataValue(value, result);
 
-		return result;
-	}
+        return result;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
index 6b0b923..7826389 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
@@ -33,146 +33,145 @@ import org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId;
 @UriEndpoint(scheme = "milo-client", syntax = "milo-client:tcp://user:password@host:port/path/to/service?itemId=item.id&namespaceUri=urn:foo:bar", title = "Milo based OPC UA Client", consumerClass = MiloClientConsumer.class, label = "iot")
 public class MiloClientEndpoint extends DefaultEndpoint implements MiloClientItemConfiguration {
 
-	/**
-	 * The OPC UA server endpoint
-	 */
-	@UriPath
-	@Metadata(required = "true")
-	private final String endpointUri;
-
-	/**
-	 * The node definition (see Node ID)
-	 */
-	@UriParam
-	private ExpandedNodeId node;
-
-	/**
-	 * The sampling interval in milliseconds
-	 */
-	@UriParam
-	private Double samplingInterval;
-
-	/**
-	 * The client configuration
-	 */
-	@UriParam
-	private MiloClientConfiguration client;
-
-	/**
-	 * Default "await" setting for writes
-	 */
-	@UriParam
-	private boolean defaultAwaitWrites = false;
-
-	private final MiloClientConnection connection;
-	private final MiloClientComponent component;
-
-	public MiloClientEndpoint(final String uri, final MiloClientComponent component,
-			final MiloClientConnection connection, final String endpointUri) {
-		super(uri, component);
-
-		Objects.requireNonNull(component);
-		Objects.requireNonNull(connection);
-		Objects.requireNonNull(endpointUri);
-
-		this.endpointUri = endpointUri;
-
-		this.component = component;
-		this.connection = connection;
-	}
-
-	@Override
-	protected void doStart() throws Exception {
-		super.doStart();
-	}
-
-	@Override
-	protected void doStop() throws Exception {
-		this.component.disposed(this);
-		super.doStop();
-	}
-
-	@Override
-	public Producer createProducer() throws Exception {
-		return new MiloClientProducer(this, this.connection, this, this.defaultAwaitWrites);
-	}
-
-	@Override
-	public Consumer createConsumer(final Processor processor) throws Exception {
-		return new MiloClientConsumer(this, processor, this.connection, this);
-	}
-
-	@Override
-	public boolean isSingleton() {
-		return true;
-	}
-
-	public MiloClientConnection getConnection() {
-		return this.connection;
-	}
-
-	// item configuration
-
-	@Override
-	public PartialNodeId makePartialNodeId() {
-		PartialNodeId result = null;
-
-		if (this.node != null) {
-			result = PartialNodeId.fromExpandedNodeId(this.node);
-		}
-
-		if (result == null) {
-			throw new IllegalStateException("Missing or invalid node id configuration");
-		} else {
-			return result;
-		}
-	}
-
-	@Override
-	public NamespaceId makeNamespaceId() {
-		NamespaceId result = null;
-
-		if (this.node != null) {
-			result = NamespaceId.fromExpandedNodeId(this.node);
-		}
-
-		if (result == null) {
-			throw new IllegalStateException("Missing or invalid node id configuration");
-		} else {
-			return result;
-		}
-	}
-
-	public void setNode(final String node) {
-		if (node == null) {
-			this.node = null;
-		} else {
-			this.node = ExpandedNodeId.parse(node);
-		}
-	}
-
-	public String getNode() {
-		if (this.node != null) {
-			return this.node.toParseableString();
-		} else {
-			return null;
-		}
-	}
-
-	@Override
-	public Double getSamplingInterval() {
-		return this.samplingInterval;
-	}
-
-	public void setSamplingInterval(final Double samplingInterval) {
-		this.samplingInterval = samplingInterval;
-	}
-
-	public boolean isDefaultAwaitWrites() {
-		return this.defaultAwaitWrites;
-	}
-
-	public void setDefaultAwaitWrites(final boolean defaultAwaitWrites) {
-		this.defaultAwaitWrites = defaultAwaitWrites;
-	}
+    /**
+     * The OPC UA server endpoint
+     */
+    @UriPath
+    @Metadata(required = "true")
+    private final String endpointUri;
+
+    /**
+     * The node definition (see Node ID)
+     */
+    @UriParam
+    private ExpandedNodeId node;
+
+    /**
+     * The sampling interval in milliseconds
+     */
+    @UriParam
+    private Double samplingInterval;
+
+    /**
+     * The client configuration
+     */
+    @UriParam
+    private MiloClientConfiguration client;
+
+    /**
+     * Default "await" setting for writes
+     */
+    @UriParam
+    private boolean defaultAwaitWrites = false;
+
+    private final MiloClientConnection connection;
+    private final MiloClientComponent component;
+
+    public MiloClientEndpoint(final String uri, final MiloClientComponent component, final MiloClientConnection connection, final String endpointUri) {
+        super(uri, component);
+
+        Objects.requireNonNull(component);
+        Objects.requireNonNull(connection);
+        Objects.requireNonNull(endpointUri);
+
+        this.endpointUri = endpointUri;
+
+        this.component = component;
+        this.connection = connection;
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        this.component.disposed(this);
+        super.doStop();
+    }
+
+    @Override
+    public Producer createProducer() throws Exception {
+        return new MiloClientProducer(this, this.connection, this, this.defaultAwaitWrites);
+    }
+
+    @Override
+    public Consumer createConsumer(final Processor processor) throws Exception {
+        return new MiloClientConsumer(this, processor, this.connection, this);
+    }
+
+    @Override
+    public boolean isSingleton() {
+        return true;
+    }
+
+    public MiloClientConnection getConnection() {
+        return this.connection;
+    }
+
+    // item configuration
+
+    @Override
+    public PartialNodeId makePartialNodeId() {
+        PartialNodeId result = null;
+
+        if (this.node != null) {
+            result = PartialNodeId.fromExpandedNodeId(this.node);
+        }
+
+        if (result == null) {
+            throw new IllegalStateException("Missing or invalid node id configuration");
+        } else {
+            return result;
+        }
+    }
+
+    @Override
+    public NamespaceId makeNamespaceId() {
+        NamespaceId result = null;
+
+        if (this.node != null) {
+            result = NamespaceId.fromExpandedNodeId(this.node);
+        }
+
+        if (result == null) {
+            throw new IllegalStateException("Missing or invalid node id configuration");
+        } else {
+            return result;
+        }
+    }
+
+    public void setNode(final String node) {
+        if (node == null) {
+            this.node = null;
+        } else {
+            this.node = ExpandedNodeId.parse(node);
+        }
+    }
+
+    public String getNode() {
+        if (this.node != null) {
+            return this.node.toParseableString();
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public Double getSamplingInterval() {
+        return this.samplingInterval;
+    }
+
+    public void setSamplingInterval(final Double samplingInterval) {
+        this.samplingInterval = samplingInterval;
+    }
+
+    public boolean isDefaultAwaitWrites() {
+        return this.defaultAwaitWrites;
+    }
+
+    public void setDefaultAwaitWrites(final boolean defaultAwaitWrites) {
+        this.defaultAwaitWrites = defaultAwaitWrites;
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
index a8a0b5f..2468449 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
@@ -20,9 +20,9 @@ import org.apache.camel.component.milo.NamespaceId;
 import org.apache.camel.component.milo.PartialNodeId;
 
 public interface MiloClientItemConfiguration {
-	public NamespaceId makeNamespaceId();
+    public NamespaceId makeNamespaceId();
 
-	public PartialNodeId makePartialNodeId();
+    public PartialNodeId makePartialNodeId();
 
-	public Double getSamplingInterval();
+    public Double getSamplingInterval();
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
index 0082596..bc3d6c2 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientProducer.java
@@ -27,37 +27,36 @@ import org.slf4j.LoggerFactory;
 
 public class MiloClientProducer extends DefaultProducer {
 
-	private static final Logger LOG = LoggerFactory.getLogger(MiloClientProducer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MiloClientProducer.class);
 
-	private final MiloClientConnection connection;
+    private final MiloClientConnection connection;
 
-	private final NamespaceId namespaceId;
+    private final NamespaceId namespaceId;
 
-	private final PartialNodeId partialNodeId;
+    private final PartialNodeId partialNodeId;
 
-	private final boolean defaultAwaitWrites;
+    private final boolean defaultAwaitWrites;
 
-	public MiloClientProducer(final Endpoint endpoint, final MiloClientConnection connection,
-			final MiloClientItemConfiguration configuration, final boolean defaultAwaitWrites) {
-		super(endpoint);
+    public MiloClientProducer(final Endpoint endpoint, final MiloClientConnection connection, final MiloClientItemConfiguration configuration, final boolean defaultAwaitWrites) {
+        super(endpoint);
 
-		this.connection = connection;
-		this.defaultAwaitWrites = defaultAwaitWrites;
+        this.connection = connection;
+        this.defaultAwaitWrites = defaultAwaitWrites;
 
-		this.namespaceId = configuration.makeNamespaceId();
-		this.partialNodeId = configuration.makePartialNodeId();
-	}
+        this.namespaceId = configuration.makeNamespaceId();
+        this.partialNodeId = configuration.makePartialNodeId();
+    }
 
-	@Override
-	public void process(final Exchange exchange) throws Exception {
-		final Message msg = exchange.getIn();
-		final Object value = msg.getBody();
+    @Override
+    public void process(final Exchange exchange) throws Exception {
+        final Message msg = exchange.getIn();
+        final Object value = msg.getBody();
 
-		LOG.debug("Processing message: {}", value);
+        LOG.debug("Processing message: {}", value);
 
-		final Boolean await = msg.getHeader("await", this.defaultAwaitWrites, Boolean.class);
+        final Boolean await = msg.getHeader("await", this.defaultAwaitWrites, Boolean.class);
 
-		this.connection.writeValue(this.namespaceId, this.partialNodeId, value, await != null ? await : false);
-	}
+        this.connection.writeValue(this.namespaceId, this.partialNodeId, value, await != null ? await : false);
+    }
 
 }


[07/18] camel git commit: Remove deprecated stuff

Posted by ac...@apache.org.
Remove deprecated stuff


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/60d1e3d0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/60d1e3d0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/60d1e3d0

Branch: refs/heads/master
Commit: 60d1e3d0c460620891f9d75752f72cb95c0f8146
Parents: 976a08f
Author: Jens Reimann <jr...@redhat.com>
Authored: Wed Apr 12 08:48:00 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:26 2017 +0200

----------------------------------------------------------------------
 .../apache/camel/component/milo/NodeIds.java    | 222 +++++++++++++++++++
 .../milo/client/MiloClientEndpoint.java         |  64 ------
 .../milo/server/MiloServerComponent.java        |  16 --
 .../milo/server/MiloServerEndpoint.java         |   7 -
 .../MonitorItemMultiConnectionsCertTest.java    |  12 +-
 .../milo/MonitorItemMultiConnectionsTest.java   |   9 +-
 .../camel/component/milo/MonitorItemTest.java   |   3 +-
 .../apache/camel/component/milo/NodeIdTest.java |   8 -
 .../camel/component/milo/WriteClientTest.java   |  32 ++-
 9 files changed, 247 insertions(+), 126 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/60d1e3d0/components/camel-milo/src/main/java/org/apache/camel/component/milo/NodeIds.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/NodeIds.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NodeIds.java
new file mode 100644
index 0000000..1f61ebb
--- /dev/null
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/NodeIds.java
@@ -0,0 +1,222 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.milo;
+
+import java.util.Base64;
+import java.util.Objects;
+import java.util.UUID;
+
+import org.eclipse.milo.opcua.stack.core.types.builtin.ByteString;
+
+/**
+ * Helper class to work with node IDs
+ */
+public final class NodeIds {
+	private NodeIds() {
+	}
+
+	/**
+	 * Create an attribute value for the "node" attribute
+	 * 
+	 * @param namespace
+	 *            the namespace to use
+	 * @param node
+	 *            the node ID
+	 * @return the value ready to append to a "node" URI attribute
+	 */
+	public static String nodeValue(final String namespace, final String node) {
+		Objects.requireNonNull(namespace);
+		Objects.requireNonNull(node);
+
+		final StringBuilder builder = new StringBuilder("RAW(");
+		appendNamespace(builder, namespace);
+		builder.append(';');
+		appendNodeId(builder, node);
+		builder.append(')');
+		return builder.toString();
+	}
+
+	/**
+	 * Create an attribute value for the "node" attribute
+	 * 
+	 * @param namespace
+	 *            the namespace to use
+	 * @param node
+	 *            the node ID
+	 * @return the value ready to append to a "node" URI attribute
+	 */
+	public static String nodeValue(final String namespace, final int node) {
+		Objects.requireNonNull(namespace);
+
+		final StringBuilder builder = new StringBuilder("RAW(");
+		appendNamespace(builder, namespace);
+		builder.append(';');
+		appendNodeId(builder, node);
+		builder.append(')');
+		return builder.toString();
+	}
+
+	/**
+	 * Create an attribute value for the "node" attribute
+	 * 
+	 * @param namespace
+	 *            the namespace to use
+	 * @param node
+	 *            the node ID
+	 * @return the value ready to append to a "node" URI attribute
+	 */
+	public static String nodeValue(final String namespace, final UUID node) {
+		Objects.requireNonNull(namespace);
+		Objects.requireNonNull(node);
+
+		final StringBuilder builder = new StringBuilder("RAW(");
+		appendNamespace(builder, namespace);
+		builder.append(';');
+		appendNodeId(builder, node);
+		builder.append(')');
+		return builder.toString();
+	}
+
+	/**
+	 * Create an attribute value for the "node" attribute
+	 * 
+	 * @param namespace
+	 *            the namespace to use
+	 * @param node
+	 *            the node ID
+	 * @return the value ready to append to a "node" URI attribute
+	 */
+	public static String nodeValue(final String namespace, final ByteString node) {
+		Objects.requireNonNull(namespace);
+		Objects.requireNonNull(node);
+
+		final StringBuilder builder = new StringBuilder("RAW(");
+		appendNamespace(builder, namespace);
+		builder.append(';');
+		appendNodeId(builder, node);
+		builder.append(')');
+		return builder.toString();
+	}
+
+	/**
+	 * Create an attribute value for the "node" attribute
+	 * 
+	 * @param namespace
+	 *            the namespace to use
+	 * @param node
+	 *            the node ID
+	 * @return the value ready to append to a "node" URI attribute
+	 */
+	public static String nodeValue(final int namespace, final String node) {
+		Objects.requireNonNull(namespace);
+		Objects.requireNonNull(node);
+
+		final StringBuilder builder = new StringBuilder("RAW(");
+		appendNamespace(builder, namespace);
+		builder.append(';');
+		appendNodeId(builder, node);
+		builder.append(')');
+		return builder.toString();
+	}
+
+	/**
+	 * Create an attribute value for the "node" attribute
+	 * 
+	 * @param namespace
+	 *            the namespace to use
+	 * @param node
+	 *            the node ID
+	 * @return the value ready to append to a "node" URI attribute
+	 */
+	public static String nodeValue(final int namespace, final int node) {
+		Objects.requireNonNull(namespace);
+
+		final StringBuilder builder = new StringBuilder("RAW(");
+		appendNamespace(builder, namespace);
+		builder.append(';');
+		appendNodeId(builder, node);
+		builder.append(')');
+		return builder.toString();
+	}
+
+	/**
+	 * Create an attribute value for the "node" attribute
+	 * 
+	 * @param namespace
+	 *            the namespace to use
+	 * @param node
+	 *            the node ID
+	 * @return the value ready to append to a "node" URI attribute
+	 */
+	public static String nodeValue(final int namespace, final UUID node) {
+		Objects.requireNonNull(namespace);
+		Objects.requireNonNull(node);
+
+		final StringBuilder builder = new StringBuilder("RAW(");
+		appendNamespace(builder, namespace);
+		builder.append(';');
+		appendNodeId(builder, node);
+		builder.append(')');
+		return builder.toString();
+	}
+
+	/**
+	 * Create an attribute value for the "node" attribute
+	 * 
+	 * @param namespace
+	 *            the namespace to use
+	 * @param node
+	 *            the node ID
+	 * @return the value ready to append to a "node" URI attribute
+	 */
+	public static String nodeValue(final int namespace, final ByteString node) {
+		Objects.requireNonNull(namespace);
+		Objects.requireNonNull(node);
+
+		final StringBuilder builder = new StringBuilder("RAW(");
+		appendNamespace(builder, namespace);
+		builder.append(';');
+		appendNodeId(builder, node);
+		builder.append(')');
+		return builder.toString();
+	}
+
+	private static void appendNamespace(final StringBuilder builder, final String namespace) {
+		builder.append("nsu=").append(namespace);
+	}
+
+	private static void appendNamespace(final StringBuilder builder, final int namespace) {
+		builder.append("ns=").append(Integer.toUnsignedString(namespace));
+	}
+
+	private static void appendNodeId(final StringBuilder builder, final String nodeId) {
+		builder.append("s=").append(nodeId);
+	}
+
+	private static void appendNodeId(final StringBuilder builder, final int nodeId) {
+		builder.append("i=").append(Integer.toUnsignedString(nodeId));
+	}
+
+	private static void appendNodeId(final StringBuilder builder, final UUID nodeId) {
+		builder.append("g=").append(nodeId);
+	}
+
+	private static void appendNodeId(final StringBuilder builder, final ByteString nodeId) {
+		builder.append("b=").append(Base64.getEncoder().encodeToString(nodeId.bytes()));
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/60d1e3d0/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
index cc2b804..6b0b923 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.component.milo.client;
 
-import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ushort;
-
 import java.util.Objects;
 
 import org.apache.camel.Consumer;
@@ -43,33 +41,6 @@ public class MiloClientEndpoint extends DefaultEndpoint implements MiloClientIte
 	private final String endpointUri;
 
 	/**
-	 * The node ID as string ID **deprecated**
-	 *
-	 * @deprecated Use "node" instead
-	 */
-	@UriParam
-	@Deprecated
-	private String nodeId;
-
-	/**
-	 * The namespace as URI **deprecated**
-	 *
-	 * @deprecated Use "node" instead
-	 */
-	@UriParam
-	@Deprecated
-	private String namespaceUri;
-
-	/**
-	 * The namespace as numeric index **deprecated**
-	 *
-	 * @deprecated Use "node" instead
-	 */
-	@UriParam
-	@Deprecated
-	private Integer namespaceIndex;
-
-	/**
 	 * The node definition (see Node ID)
 	 */
 	@UriParam
@@ -150,10 +121,6 @@ public class MiloClientEndpoint extends DefaultEndpoint implements MiloClientIte
 			result = PartialNodeId.fromExpandedNodeId(this.node);
 		}
 
-		if (result == null && this.nodeId != null) {
-			result = new PartialNodeId(this.nodeId);
-		}
-
 		if (result == null) {
 			throw new IllegalStateException("Missing or invalid node id configuration");
 		} else {
@@ -169,13 +136,6 @@ public class MiloClientEndpoint extends DefaultEndpoint implements MiloClientIte
 			result = NamespaceId.fromExpandedNodeId(this.node);
 		}
 
-		if (result == null && this.namespaceIndex != null) {
-			result = new NamespaceId(ushort(this.namespaceIndex));
-		}
-		if (result == null && this.namespaceUri != null) {
-			result = new NamespaceId(this.namespaceUri);
-		}
-
 		if (result == null) {
 			throw new IllegalStateException("Missing or invalid node id configuration");
 		} else {
@@ -183,30 +143,6 @@ public class MiloClientEndpoint extends DefaultEndpoint implements MiloClientIte
 		}
 	}
 
-	public String getNodeId() {
-		return this.nodeId;
-	}
-
-	public void setNodeId(final String nodeId) {
-		this.nodeId = nodeId;
-	}
-
-	public String getNamespaceUri() {
-		return this.namespaceUri;
-	}
-
-	public void setNamespaceUri(final String namespaceUri) {
-		this.namespaceUri = namespaceUri;
-	}
-
-	public Integer getNamespaceIndex() {
-		return this.namespaceIndex;
-	}
-
-	public void setNamespaceIndex(final int namespaceIndex) {
-		this.namespaceIndex = namespaceIndex;
-	}
-
 	public void setNode(final String node) {
 		if (node == null) {
 			this.node = null;

http://git-wip-us.apache.org/repos/asf/camel/blob/60d1e3d0/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
index 5a23cef..7b39f9a 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
@@ -447,20 +447,4 @@ public class MiloServerComponent extends DefaultComponent {
 	public void setDefaultCertificateValidator(final File certificatesBaseDir) {
 		this.certificateValidator = () -> new DefaultCertificateValidator(certificatesBaseDir);
 	}
-
-	/**
-	 * Validator for client certificates using default file based approach
-	 */
-	public void setDefaultCertificateExistingValidator(final File trustedDir) {
-		throw new UnsupportedOperationException("Can be implemented after fix in upstream");
-
-		/*
-		 * checkDispose(this.certificateValidator);
-		 *
-		 * this.certificateValidator = new
-		 * DefaultCertificateValidator(trustedDir, null, null);
-		 * this.serverConfig.setCertificateValidator(this.certificateValidator);
-		 */
-	}
-
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/60d1e3d0/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
index b398174..6abacf2 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
@@ -64,12 +64,6 @@ class MiloServerEndpoint extends DefaultEndpoint {
 	}
 
 	@Override
-	protected void doShutdown() throws Exception {
-		// FIXME: need to call back to component?
-		super.doShutdown();
-	}
-
-	@Override
 	public Producer createProducer() throws Exception {
 		return new MiloServerProducer(this, this.item);
 	}
@@ -102,5 +96,4 @@ class MiloServerEndpoint extends DefaultEndpoint {
 	public String getItemId() {
 		return this.itemId;
 	}
-
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/60d1e3d0/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
index 24f3c79..3328902 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
@@ -41,17 +41,17 @@ public class MonitorItemMultiConnectionsCertTest extends AbstractMiloServerTest
 	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
 
 	// with key
-	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?nodeId=items-myitem1&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI
+	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?node="
+			+ NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1")
 			+ "&keyStoreUrl=file:src/test/resources/cert/cert.p12&keyStorePassword=pwd1&keyPassword=pwd1";
 
 	// with wrong password
-	private static final String MILO_CLIENT_ITEM_C2_1 = "milo-client:tcp://foo:bar2@localhost:12685?nodeId=items-myitem1&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+	private static final String MILO_CLIENT_ITEM_C2_1 = "milo-client:tcp://foo:bar2@localhost:12685?node="
+			+ NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
 
 	// without key, clientId=1
-	private static final String MILO_CLIENT_ITEM_C3_1 = "milo-client:tcp://foo:bar@localhost:12685?clientId=1&nodeId=items-myitem1&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+	private static final String MILO_CLIENT_ITEM_C3_1 = "milo-client:tcp://foo:bar@localhost:12685?clientId=1&node="
+			+ NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
 
 	private static final String MOCK_TEST_1 = "mock:test1";
 	private static final String MOCK_TEST_2 = "mock:test2";

http://git-wip-us.apache.org/repos/asf/camel/blob/60d1e3d0/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
index 7a4df66..791e4e4 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
@@ -34,14 +34,11 @@ public class MonitorItemMultiConnectionsTest extends AbstractMiloServerTest {
 
 	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
 
-	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?nodeId=items-myitem1&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?node=" + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
 
-	private static final String MILO_CLIENT_ITEM_C2_1 = "milo-client:tcp://foo:bar2@localhost:12685?nodeId=items-myitem1&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+	private static final String MILO_CLIENT_ITEM_C2_1 = "milo-client:tcp://foo:bar2@localhost:12685?node=" + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
 
-	private static final String MILO_CLIENT_ITEM_C3_1 = "milo-client:tcp://foo2:bar@localhost:12685?nodeId=items-myitem1&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+	private static final String MILO_CLIENT_ITEM_C3_1 = "milo-client:tcp://foo2:bar@localhost:12685?node=" + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
 
 	private static final String MOCK_TEST_1 = "mock:test1";
 	private static final String MOCK_TEST_2 = "mock:test2";

http://git-wip-us.apache.org/repos/asf/camel/blob/60d1e3d0/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
index 4aded9c..6c11b64 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
@@ -34,8 +34,7 @@ public class MonitorItemTest extends AbstractMiloServerTest {
 
 	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
 
-	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?nodeId=items-myitem1&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?node=" + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
 
 	private static final String MOCK_TEST_1 = "mock:test1";
 

http://git-wip-us.apache.org/repos/asf/camel/blob/60d1e3d0/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
index 526abc7..a832f87 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
@@ -33,14 +33,6 @@ import org.junit.Test;
 public class NodeIdTest extends AbstractMiloServerTest {
 
 	@Test
-	public void testLegacy() {
-		testUri("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-myitem1&namespaceUri=" + DEFAULT_NAMESPACE_URI,
-				DEFAULT_NAMESPACE_URI, "items-myitem1");
-		testUri("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-myitem1&namespaceIndex=1", ushort(1),
-				"items-myitem1");
-	}
-
-	@Test
 	public void testFull1() {
 		final String s = String.format("nsu=%s;s=%s", DEFAULT_NAMESPACE_URI, "item-1");
 		testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=RAW(" + s + ")",

http://git-wip-us.apache.org/repos/asf/camel/blob/60d1e3d0/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
index 40c85e5..4216038 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,9 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo;
 
+import static org.apache.camel.component.milo.NodeIds.nodeValue;
+
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Produce;
 import org.apache.camel.ProducerTemplate;
@@ -42,15 +44,11 @@ public class WriteClientTest extends AbstractMiloServerTest {
 	private static final String MILO_CLIENT_BASE_C1 = "milo-client:tcp://foo:bar@localhost:12685";
 	private static final String MILO_CLIENT_BASE_C2 = "milo-client:tcp://foo2:bar2@localhost:12685";
 
-	private static final String MILO_CLIENT_ITEM_C1_1 = MILO_CLIENT_BASE_C1 + "?nodeId=items-myitem1&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
-	private static final String MILO_CLIENT_ITEM_C1_2 = MILO_CLIENT_BASE_C1 + "?nodeId=items-myitem2&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
-
-	private static final String MILO_CLIENT_ITEM_C2_1 = MILO_CLIENT_BASE_C2 + "?nodeId=items-myitem1&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
-	private static final String MILO_CLIENT_ITEM_C2_2 = MILO_CLIENT_BASE_C2 + "?nodeId=items-myitem2&namespaceUri="
-			+ MiloServerComponent.DEFAULT_NAMESPACE_URI;
+	private static final String MILO_CLIENT_ITEM_C1_1 = MILO_CLIENT_BASE_C1 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
+	private static final String MILO_CLIENT_ITEM_C1_2 = MILO_CLIENT_BASE_C1 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem2");
+	
+	private static final String MILO_CLIENT_ITEM_C2_1 = MILO_CLIENT_BASE_C2 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
+	private static final String MILO_CLIENT_ITEM_C2_2 = MILO_CLIENT_BASE_C2 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem2");
 
 	private static final String MOCK_TEST_1 = "mock:test1";
 	private static final String MOCK_TEST_2 = "mock:test2";


[02/18] camel git commit: Fix Camel version in docs

Posted by ac...@apache.org.
Fix Camel version in docs


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/47a90192
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/47a90192
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/47a90192

Branch: refs/heads/master
Commit: 47a90192424eee99540293f7b247c503b9bc884f
Parents: bc7974d
Author: Jens Reimann <jr...@redhat.com>
Authored: Mon Apr 10 16:16:47 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:26 2017 +0200

----------------------------------------------------------------------
 components/camel-milo/src/main/docs/milo-client.adoc | 2 +-
 components/camel-milo/src/main/docs/milo-server.adoc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/47a90192/components/camel-milo/src/main/docs/milo-client.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-client.adoc b/components/camel-milo/src/main/docs/milo-client.adoc
index 60dfbcf..f1585cf 100644
--- a/components/camel-milo/src/main/docs/milo-client.adoc
+++ b/components/camel-milo/src/main/docs/milo-client.adoc
@@ -3,7 +3,7 @@
 Milo Client Component
 ~~~~~~~~~~~~~~~~~~~~~~~
 
-*Available as of Camel 2.18*
+*Available as of Camel 2.19*
 
 The *Milo Client* component provides access to OPC UA servers using the
 http://eclipse.org/milo[Eclipse Milo\u2122] implementation.

http://git-wip-us.apache.org/repos/asf/camel/blob/47a90192/components/camel-milo/src/main/docs/milo-server.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-server.adoc b/components/camel-milo/src/main/docs/milo-server.adoc
index 3f699f6..6c86c10 100644
--- a/components/camel-milo/src/main/docs/milo-server.adoc
+++ b/components/camel-milo/src/main/docs/milo-server.adoc
@@ -3,7 +3,7 @@
 Eclipse Milo Server Component
 ~~~~~~~~~~~~~~~~~~~~~~~
 
-*Available as of Camel 2.18*
+*Available as of Camel 2.19*
 
 The *Milo Server* component provides an OPC UA server using the
 http://eclipse.org/milo[Eclipse Milo\u2122] implementation.


[08/18] camel git commit: Fix license headers

Posted by ac...@apache.org.
Fix license headers


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/976a08fb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/976a08fb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/976a08fb

Branch: refs/heads/master
Commit: 976a08fb4db046ebc32fd00231f9ec13e097fba0
Parents: 8021165
Author: Jens Reimann <jr...@redhat.com>
Authored: Wed Apr 12 09:16:49 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:26 2017 +0200

----------------------------------------------------------------------
 .../component/milo/AbstractMiloServerTest.java      | 16 ++++++++--------
 .../milo/MonitorItemMultiConnectionsCertTest.java   | 16 ++++++++--------
 .../milo/MonitorItemMultiConnectionsTest.java       | 16 ++++++++--------
 .../camel/component/milo/MonitorItemTest.java       | 16 ++++++++--------
 .../org/apache/camel/component/milo/NodeIdTest.java | 16 ++++++++--------
 .../component/milo/converter/ConverterTest.java     | 16 ++++++++--------
 .../component/milo/server/ServerLocalTest.java      | 16 ++++++++--------
 .../server/ServerSetCertificateManagerTest.java     | 16 ++++++++--------
 .../milo/server/ServerSetSecurityPoliciesTest.java  | 16 ++++++++--------
 9 files changed, 72 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/976a08fb/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
index 818b36d..a904de4 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/camel/blob/976a08fb/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
index aecc2ec..24f3c79 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo;
 
 import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;

http://git-wip-us.apache.org/repos/asf/camel/blob/976a08fb/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
index 01c09a9..7a4df66 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo;
 
 import org.apache.camel.EndpointInject;

http://git-wip-us.apache.org/repos/asf/camel/blob/976a08fb/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
index 05ae003..4aded9c 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo;
 
 import org.apache.camel.EndpointInject;

http://git-wip-us.apache.org/repos/asf/camel/blob/976a08fb/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
index 2bb9e08..526abc7 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo;
 
 import static com.google.common.net.UrlEscapers.urlFormParameterEscaper;

http://git-wip-us.apache.org/repos/asf/camel/blob/976a08fb/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
index bef67aa..5d00ae3 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.converter;
 
 import org.apache.camel.test.junit4.CamelTestSupport;

http://git-wip-us.apache.org/repos/asf/camel/blob/976a08fb/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
index 84b16f9..53b66ec 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.server;
 
 import org.apache.camel.EndpointInject;

http://git-wip-us.apache.org/repos/asf/camel/blob/976a08fb/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
index c2677a2..35f31d6 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.server;
 
 import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;

http://git-wip-us.apache.org/repos/asf/camel/blob/976a08fb/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
index 8a069d3..75e3457 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
@@ -1,11 +1,12 @@
-/*
- * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.milo.server;
 
 import org.apache.camel.test.junit4.CamelTestSupport;


[12/18] camel git commit: Doc re-write by maven build

Posted by ac...@apache.org.
Doc re-write by maven build


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a867b3c8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a867b3c8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a867b3c8

Branch: refs/heads/master
Commit: a867b3c82d040bf40e8b1907c74629b0c6194bab
Parents: 10c10a7
Author: Jens Reimann <jr...@redhat.com>
Authored: Wed Apr 12 09:30:53 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:27 2017 +0200

----------------------------------------------------------------------
 .../src/main/docs/milo-client-component.adoc    | 110 ++++++++++---------
 .../src/main/docs/milo-server-component.adoc    |  91 ++++++++-------
 2 files changed, 106 insertions(+), 95 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a867b3c8/components/camel-milo/src/main/docs/milo-client-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-client-component.adoc b/components/camel-milo/src/main/docs/milo-client-component.adoc
index f1585cf..4b8d342 100644
--- a/components/camel-milo/src/main/docs/milo-client-component.adoc
+++ b/components/camel-milo/src/main/docs/milo-client-component.adoc
@@ -1,7 +1,8 @@
-[[MiloClient-MiloClientComponent]]
+## Milo based OPC UA Client Component
 
-Milo Client Component
-~~~~~~~~~~~~~~~~~~~~~~~
+*Available as of Camel version *
+
+### Milo Client Component
 
 *Available as of Camel 2.19*
 
@@ -25,26 +26,25 @@ for this component:
 
 
 // component options: START
-The Milo based OPC UA Client component supports 5 options which are listed below.
+The Milo based OPC UA Client component supports 6 options which are listed below.
 
 
 
-[width="100%",cols="2s,1m,8",options="header"]
+[width="100%",cols="2,5,^1,2",options="header"]
 |=======================================================================
-| Name | Java Type | Description
-| defaultConfiguration | MiloClientConfiguration | All default options for client
-| applicationName | String | Default application name
-| applicationUri | String | Default application URI
-| productUri | String | Default product URI
-| reconnectTimeout | Long | Default reconnect timeout
+| Name | Description | Default | Type
+| **defaultConfiguration** (common) | All default options for client |  | MiloClientConfiguration
+| **applicationName** (common) | Default application name |  | String
+| **applicationUri** (common) | Default application URI |  | String
+| **productUri** (common) | Default product URI |  | String
+| **reconnectTimeout** (common) | Default reconnect timeout |  | Long
+| **resolveProperty Placeholders** (advanced) | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | boolean
 |=======================================================================
 // component options: END
 
 
 
-[[MiloClient-URIformat]]
-URI format
-^^^^^^^^^^
+### URI format
 
 The URI syntax of the endpoint is: 
 
@@ -61,9 +61,7 @@ milo-client:tcp://[user:password@]host:port?node=RAW(nsu=urn:foo:bar;s=item-1)
 
 If no user credentials are provided the client will switch to anonymous mode.
 
-[[MiloClient-URIOptions]]
-URI options
-^^^^^^^^^^^
+### URI options
 
 All configuration options in the group +client+ are applicable to the shared client instance. Endpoints
 will share client instances for each endpoint URI. So the first time a request for that endpoint URI is
@@ -85,38 +83,48 @@ In other words, shared connections located by the combination of endpoint URI an
 
 
 // endpoint options: START
-The Milo based OPC UA Client component supports 27 endpoint options which are listed below:
+The Milo based OPC UA Client endpoint is configured using URI syntax:
 
-[width="100%",cols="2s,1,1m,1m,5",options="header"]
+    milo-client:tcp://user:password@host:port/path/to/service?itemId=item.id&namespaceUri=urn:foo:bar
+
+with the following path and query parameters:
+
+#### Path Parameters (1 parameters):
+
+[width="100%",cols="2,5,^1,2",options="header"]
 |=======================================================================
-| Name | Group | Default | Java Type | Description
-| endpointUri | common |  | String | *Required* The OPC UA server endpoint
-| clientId | common |  | String | A virtual client id to force the creation of a new connection instance
-| defaultAwaitWrites | common | false | boolean | Default await setting for writes
-| namespaceIndex | common |  | Integer | The namespace as numeric index deprecated
-| namespaceUri | common |  | String | The namespace as URI deprecated
-| node | common |  | ExpandedNodeId | The node definition (see Node ID)
-| nodeId | common |  | String | The node ID as string ID deprecated
-| samplingInterval | common |  | Double | The sampling interval in milliseconds
-| bridgeErrorHandler | consumer | false | boolean | 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/ERROR level and ignored.
-| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
-| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
-| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
-| applicationName | client | Apache Camel adapter for Eclipse Milo | String | The application name
-| applicationUri | client | http://camel.apache.org/EclipseMilo/Client | String | The application URI
-| channelLifetime | client |  | Long | Channel lifetime in milliseconds
-| keyAlias | client |  | String | The name of the key in the keystore file
-| keyPassword | client |  | String | The key password
-| keyStorePassword | client |  | String | The keystore password
-| keyStoreType | client |  | String | The key store type
-| keyStoreUrl | client |  | URL | The URL where the key should be loaded from
-| maxPendingPublishRequests | client |  | Long | The maximum number of pending publish requests
-| maxResponseMessageSize | client |  | Long | The maximum number of bytes a response message may have
-| productUri | client | http://camel.apache.org/EclipseMilo | String | The product URI
-| requestTimeout | client |  | Long | Request timeout in milliseconds
-| secureChannelReauthenticationEnabled | client |  | Boolean | Whether secure channel re-authentication is enabled
-| sessionName | client |  | String | Session name
-| sessionTimeout | client |  | Long | Session timeout in milliseconds
+| Name | Description | Default | Type
+| **endpointUri** | *Required* The OPC UA server endpoint |  | String
+|=======================================================================
+
+#### Query Parameters (23 parameters):
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|=======================================================================
+| Name | Description | Default | Type
+| **clientId** (common) | A virtual client id to force the creation of a new connection instance |  | String
+| **defaultAwaitWrites** (common) | Default await setting for writes | false | boolean
+| **node** (common) | The node definition (see Node ID) |  | ExpandedNodeId
+| **samplingInterval** (common) | The sampling interval in milliseconds |  | 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 options 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. |  | ExchangePattern
+| **synchronous** (advanced) | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). | false | boolean
+| **applicationName** (client) | The application name | Apache Camel adapter for Eclipse Milo | String
+| **applicationUri** (client) | The application URI | http://camel.apache.org/EclipseMilo/Client | String
+| **channelLifetime** (client) | Channel lifetime in milliseconds |  | Long
+| **keyAlias** (client) | The name of the key in the keystore file |  | String
+| **keyPassword** (client) | The key password |  | String
+| **keyStorePassword** (client) | The keystore password |  | String
+| **keyStoreType** (client) | The key store type |  | String
+| **keyStoreUrl** (client) | The URL where the key should be loaded from |  | URL
+| **maxPendingPublishRequests** (client) | The maximum number of pending publish requests |  | Long
+| **maxResponseMessageSize** (client) | The maximum number of bytes a response message may have |  | Long
+| **productUri** (client) | The product URI | http://camel.apache.org/EclipseMilo | String
+| **requestTimeout** (client) | Request timeout in milliseconds |  | Long
+| **secureChannel ReauthenticationEnabled** (client) | Whether secure channel re-authentication is enabled |  | Boolean
+| **sessionName** (client) | Session name |  | String
+| **sessionTimeout** (client) | Session timeout in milliseconds |  | Long
 |=======================================================================
 // endpoint options: END
 
@@ -125,8 +133,7 @@ The Milo based OPC UA Client component supports 27 endpoint options which are li
 
 
 
-Node ID
-+++++++
+#### Node ID
 
 
 In order to define a target node a namespace and node id is required. In previous versions this was possible by
@@ -157,12 +164,9 @@ them. However Camel allows to wrap the actual value inside `RAW(\u2026)`, which mak
 milo-client://user:password@localhost:12345?node=RAW(nsu=http://foo.bar;s=foo/bar)
 ------------------------
 
-[[MiloClient-SeeAlso]]
-See Also
-^^^^^^^^
+### See Also
 
 * link:configuring-camel.html[Configuring Camel]
 * link:component.html[Component]
 * link:endpoint.html[Endpoint]
 * link:getting-started.html[Getting Started]
-

http://git-wip-us.apache.org/repos/asf/camel/blob/a867b3c8/components/camel-milo/src/main/docs/milo-server-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/docs/milo-server-component.adoc b/components/camel-milo/src/main/docs/milo-server-component.adoc
index 6c86c10..25ac1bd 100644
--- a/components/camel-milo/src/main/docs/milo-server-component.adoc
+++ b/components/camel-milo/src/main/docs/milo-server-component.adoc
@@ -1,7 +1,8 @@
-[[MiloServer-OpcUaServerComponent]]
+## OPC UA Server Component
 
-Eclipse Milo Server Component
-~~~~~~~~~~~~~~~~~~~~~~~
+*Available as of Camel version *
+
+### Eclipse Milo Server Component
 
 *Available as of Camel 2.19*
 
@@ -33,28 +34,28 @@ The OPC UA Server component supports 19 options which are listed below.
 
 
 
-[width="100%",cols="2s,1m,8",options="header"]
+[width="100%",cols="2,5,^1,2",options="header"]
 |=======================================================================
-| Name | Java Type | Description
-| namespaceUri | String | The URI of the namespace defaults to urn:org:apache:camel
-| applicationName | String | The application name
-| applicationUri | String | The application URI
-| productUri | String | The product URI
-| bindPort | int | The TCP port the server binds to
-| strictEndpointUrlsEnabled | boolean | Set whether strict endpoint URLs are enforced
-| serverName | String | Server name
-| hostname | String | Server hostname
-| securityPolicies | Set | Security policies
-| securityPoliciesById | String> | Security policies by URI or name
-| userAuthenticationCredentials | String | Set user password combinations in the form of user1:pwd1user2:pwd2 Usernames and passwords will be URL decoded
-| enableAnonymousAuthentication | boolean | Enable anonymous authentication disabled by default
-| bindAddresses | String | Set the addresses of the local addresses the server should bind to
-| buildInfo | BuildInfo | Server build info
-| serverCertificate | Result | Server certificate
-| certificateManager | CertificateManager | Server certificate manager
-| certificateValidator | CertificateValidator> | Validator for client certificates
-| defaultCertificateValidator | File | Validator for client certificates using default file based approach
-| defaultCertificateExistingValidator | File | Validator for client certificates using default file based approach
+| Name | Description | Default | Type
+| **namespaceUri** (common) | The URI of the namespace defaults to urn:org:apache:camel |  | String
+| **applicationName** (common) | The application name |  | String
+| **applicationUri** (common) | The application URI |  | String
+| **productUri** (common) | The product URI |  | String
+| **bindPort** (common) | The TCP port the server binds to |  | int
+| **strictEndpointUrls Enabled** (common) | Set whether strict endpoint URLs are enforced | false | boolean
+| **serverName** (common) | Server name |  | String
+| **hostname** (common) | Server hostname |  | String
+| **securityPolicies** (common) | Security policies |  | Set
+| **securityPoliciesById** (common) | Security policies by URI or name |  | String>
+| **userAuthentication Credentials** (common) | Set user password combinations in the form of user1:pwd1user2:pwd2 Usernames and passwords will be URL decoded |  | String
+| **enableAnonymous Authentication** (common) | Enable anonymous authentication disabled by default | false | boolean
+| **bindAddresses** (common) | Set the addresses of the local addresses the server should bind to |  | String
+| **buildInfo** (common) | Server build info |  | BuildInfo
+| **serverCertificate** (common) | Server certificate |  | Result
+| **certificateManager** (common) | Server certificate manager |  | CertificateManager
+| **certificateValidator** (common) | Validator for client certificates |  | CertificateValidator>
+| **defaultCertificate Validator** (common) | Validator for client certificates using default file based approach |  | File
+| **resolveProperty Placeholders** (advanced) | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | boolean
 |=======================================================================
 // component options: END
 
@@ -66,32 +67,41 @@ The OPC UA Server component supports 19 options which are listed below.
 
 
 
-[[MiloServer-URIformat]]
-URI format
-^^^^^^^^^^
+### URI format
 
 [source,java]
 ------------------------
 milo-server:itemId[?options]
 ------------------------
 
-[[Milo-URIOptions]]
-URI options
-^^^^^^^^^^^
+### URI options
 
 
 
 // endpoint options: START
-The OPC UA Server component supports 5 endpoint options which are listed below:
+The OPC UA Server endpoint is configured using URI syntax:
+
+    milo-server:itemId
+
+with the following path and query parameters:
 
-[width="100%",cols="2s,1,1m,1m,5",options="header"]
+#### Path Parameters (1 parameters):
+
+[width="100%",cols="2,5,^1,2",options="header"]
 |=======================================================================
-| Name | Group | Default | Java Type | Description
-| itemId | common |  | String | *Required* ID of the item
-| bridgeErrorHandler | consumer | false | boolean | 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/ERROR level and ignored.
-| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
-| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
-| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+| Name | Description | Default | Type
+| **itemId** | *Required* ID of the item |  | String
+|=======================================================================
+
+#### Query Parameters (4 parameters):
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|=======================================================================
+| Name | Description | Default | Type
+| **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 options 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. |  | ExchangePattern
+| **synchronous** (advanced) | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). | false | boolean
 |=======================================================================
 // endpoint options: END
 
@@ -100,12 +110,9 @@ The OPC UA Server component supports 5 endpoint options which are listed below:
 
 
 
-[[MiloServer-SeeAlso]]
-See Also
-^^^^^^^^
+### See Also
 
 * link:configuring-camel.html[Configuring Camel]
 * link:component.html[Component]
 * link:endpoint.html[Endpoint]
 * link:getting-started.html[Getting Started]
-


[13/18] camel git commit: Apply code formatter

Posted by ac...@apache.org.
http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
index a904de4..40115d2 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java
@@ -28,63 +28,62 @@ import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
 
 public abstract class AbstractMiloServerTest extends CamelTestSupport {
 
-	public static void testBody(final AssertionClause clause, final Consumer<DataValue> valueConsumer) {
-		testBody(clause, DataValue.class, valueConsumer);
-	}
+    public static void testBody(final AssertionClause clause, final Consumer<DataValue> valueConsumer) {
+        testBody(clause, DataValue.class, valueConsumer);
+    }
 
-	public static <T> void testBody(final AssertionClause clause, final Class<T> bodyClass,
-			final Consumer<T> valueConsumer) {
-		clause.predicate(exchange -> {
-			final T body = exchange.getIn().getBody(bodyClass);
-			valueConsumer.accept(body);
-			return true;
-		});
-	}
+    public static <T> void testBody(final AssertionClause clause, final Class<T> bodyClass, final Consumer<T> valueConsumer) {
+        clause.predicate(exchange -> {
+            final T body = exchange.getIn().getBody(bodyClass);
+            valueConsumer.accept(body);
+            return true;
+        });
+    }
 
-	public static Consumer<DataValue> assertGoodValue(final Object expectedValue) {
-		return value -> {
-			assertNotNull(value);
-			assertEquals(expectedValue, value.getValue().getValue());
-			assertTrue(value.getStatusCode().isGood());
-			assertFalse(value.getStatusCode().isBad());
-		};
-	}
+    public static Consumer<DataValue> assertGoodValue(final Object expectedValue) {
+        return value -> {
+            assertNotNull(value);
+            assertEquals(expectedValue, value.getValue().getValue());
+            assertTrue(value.getStatusCode().isGood());
+            assertFalse(value.getStatusCode().isBad());
+        };
+    }
 
-	@Override
-	protected CamelContext createCamelContext() throws Exception {
-		final CamelContext context = super.createCamelContext();
-		configureContext(context);
-		return context;
-	}
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        final CamelContext context = super.createCamelContext();
+        configureContext(context);
+        return context;
+    }
 
-	protected void configureContext(final CamelContext context) throws Exception {
-		final MiloServerComponent server = context.getComponent("milo-server", MiloServerComponent.class);
-		configureMiloServer(server);
-	}
+    protected void configureContext(final CamelContext context) throws Exception {
+        final MiloServerComponent server = context.getComponent("milo-server", MiloServerComponent.class);
+        configureMiloServer(server);
+    }
 
-	protected void configureMiloServer(final MiloServerComponent server) throws Exception {
-		server.setBindAddresses("localhost");
-		server.setBindPort(12685);
-		server.setUserAuthenticationCredentials("foo:bar,foo2:bar2");
-	}
+    protected void configureMiloServer(final MiloServerComponent server) throws Exception {
+        server.setBindAddresses("localhost");
+        server.setBindPort(12685);
+        server.setUserAuthenticationCredentials("foo:bar,foo2:bar2");
+    }
 
-	/**
-	 * Create a default key store for testing
-	 *
-	 * @return always returns a key store
-	 */
-	protected KeyStoreLoader.Result loadDefaultTestKey() {
-		try {
+    /**
+     * Create a default key store for testing
+     *
+     * @return always returns a key store
+     */
+    protected KeyStoreLoader.Result loadDefaultTestKey() {
+        try {
 
-			final KeyStoreLoader loader = new KeyStoreLoader();
-			loader.setUrl("file:src/test/resources/cert/cert.p12");
-			loader.setKeyStorePassword("pwd1");
-			loader.setKeyPassword("pwd1");
-			return loader.load();
-		} catch (final GeneralSecurityException | IOException e) {
-			throw new RuntimeException(e);
-		}
+            final KeyStoreLoader loader = new KeyStoreLoader();
+            loader.setUrl("file:src/test/resources/cert/cert.p12");
+            loader.setKeyStorePassword("pwd1");
+            loader.setKeyPassword("pwd1");
+            return loader.load();
+        } catch (final GeneralSecurityException | IOException e) {
+            throw new RuntimeException(e);
+        }
 
-	}
+    }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
index 3328902..e397520 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsCertTest.java
@@ -36,89 +36,88 @@ import org.junit.Test;
  */
 public class MonitorItemMultiConnectionsCertTest extends AbstractMiloServerTest {
 
-	private static final String DIRECT_START_1 = "direct:start1";
-
-	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
-
-	// with key
-	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?node="
-			+ NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1")
-			+ "&keyStoreUrl=file:src/test/resources/cert/cert.p12&keyStorePassword=pwd1&keyPassword=pwd1";
-
-	// with wrong password
-	private static final String MILO_CLIENT_ITEM_C2_1 = "milo-client:tcp://foo:bar2@localhost:12685?node="
-			+ NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
-
-	// without key, clientId=1
-	private static final String MILO_CLIENT_ITEM_C3_1 = "milo-client:tcp://foo:bar@localhost:12685?clientId=1&node="
-			+ NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
-
-	private static final String MOCK_TEST_1 = "mock:test1";
-	private static final String MOCK_TEST_2 = "mock:test2";
-	private static final String MOCK_TEST_3 = "mock:test3";
-
-	@EndpointInject(uri = MOCK_TEST_1)
-	protected MockEndpoint test1Endpoint;
-
-	@EndpointInject(uri = MOCK_TEST_2)
-	protected MockEndpoint test2Endpoint;
-
-	@EndpointInject(uri = MOCK_TEST_3)
-	protected MockEndpoint test3Endpoint;
-
-	@Produce(uri = DIRECT_START_1)
-	protected ProducerTemplate producer1;
-
-	@Override
-	protected void configureMiloServer(final MiloServerComponent server) throws Exception {
-		super.configureMiloServer(server);
-
-		final Path baseDir = Paths.get("target/testing/cert/default");
-		final Path trusted = baseDir.resolve("trusted");
-
-		Files.createDirectories(trusted);
-		Files.copy(Paths.get("src/test/resources/cert/certificate.der"), trusted.resolve("certificate.der"),
-				REPLACE_EXISTING);
-
-		server.setServerCertificate(loadDefaultTestKey());
-		server.setDefaultCertificateValidator(baseDir.toFile());
-	}
-
-	@Override
-	protected RoutesBuilder createRouteBuilder() throws Exception {
-		return new RouteBuilder() {
-			@Override
-			public void configure() throws Exception {
-				from(DIRECT_START_1).to(MILO_SERVER_ITEM_1);
-
-				from(MILO_CLIENT_ITEM_C1_1).to(MOCK_TEST_1);
-				from(MILO_CLIENT_ITEM_C2_1).to(MOCK_TEST_2);
-				from(MILO_CLIENT_ITEM_C3_1).to(MOCK_TEST_3);
-			}
-		};
-	}
-
-	/**
-	 * Monitor multiple connections, but only one has the correct credentials
-	 */
-	@Test
-	public void testMonitorItem1() throws Exception {
-		// set server value
-		this.producer1.sendBody("Foo");
-
-		// item 1 ... only this one receives
-		this.test1Endpoint.setExpectedCount(1);
-		this.test1Endpoint.setSleepForEmptyTest(5_000);
-
-		// item 2
-		this.test2Endpoint.setExpectedCount(0);
-		this.test2Endpoint.setSleepForEmptyTest(5_000);
-
-		// item 3
-		this.test3Endpoint.setExpectedCount(0);
-		this.test3Endpoint.setSleepForEmptyTest(5_000);
-
-		// assert
-		this.assertMockEndpointsSatisfied();
-	}
+    private static final String DIRECT_START_1 = "direct:start1";
+
+    private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
+
+    // with key
+    private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?node="
+                                                        + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1")
+                                                        + "&keyStoreUrl=file:src/test/resources/cert/cert.p12&keyStorePassword=pwd1&keyPassword=pwd1";
+
+    // with wrong password
+    private static final String MILO_CLIENT_ITEM_C2_1 = "milo-client:tcp://foo:bar2@localhost:12685?node="
+                                                        + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
+
+    // without key, clientId=1
+    private static final String MILO_CLIENT_ITEM_C3_1 = "milo-client:tcp://foo:bar@localhost:12685?clientId=1&node="
+                                                        + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
+
+    private static final String MOCK_TEST_1 = "mock:test1";
+    private static final String MOCK_TEST_2 = "mock:test2";
+    private static final String MOCK_TEST_3 = "mock:test3";
+
+    @EndpointInject(uri = MOCK_TEST_1)
+    protected MockEndpoint test1Endpoint;
+
+    @EndpointInject(uri = MOCK_TEST_2)
+    protected MockEndpoint test2Endpoint;
+
+    @EndpointInject(uri = MOCK_TEST_3)
+    protected MockEndpoint test3Endpoint;
+
+    @Produce(uri = DIRECT_START_1)
+    protected ProducerTemplate producer1;
+
+    @Override
+    protected void configureMiloServer(final MiloServerComponent server) throws Exception {
+        super.configureMiloServer(server);
+
+        final Path baseDir = Paths.get("target/testing/cert/default");
+        final Path trusted = baseDir.resolve("trusted");
+
+        Files.createDirectories(trusted);
+        Files.copy(Paths.get("src/test/resources/cert/certificate.der"), trusted.resolve("certificate.der"), REPLACE_EXISTING);
+
+        server.setServerCertificate(loadDefaultTestKey());
+        server.setDefaultCertificateValidator(baseDir.toFile());
+    }
+
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from(DIRECT_START_1).to(MILO_SERVER_ITEM_1);
+
+                from(MILO_CLIENT_ITEM_C1_1).to(MOCK_TEST_1);
+                from(MILO_CLIENT_ITEM_C2_1).to(MOCK_TEST_2);
+                from(MILO_CLIENT_ITEM_C3_1).to(MOCK_TEST_3);
+            }
+        };
+    }
+
+    /**
+     * Monitor multiple connections, but only one has the correct credentials
+     */
+    @Test
+    public void testMonitorItem1() throws Exception {
+        // set server value
+        this.producer1.sendBody("Foo");
+
+        // item 1 ... only this one receives
+        this.test1Endpoint.setExpectedCount(1);
+        this.test1Endpoint.setSleepForEmptyTest(5_000);
+
+        // item 2
+        this.test2Endpoint.setExpectedCount(0);
+        this.test2Endpoint.setSleepForEmptyTest(5_000);
+
+        // item 3
+        this.test3Endpoint.setExpectedCount(0);
+        this.test3Endpoint.setSleepForEmptyTest(5_000);
+
+        // assert
+        this.assertMockEndpointsSatisfied();
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
index 791e4e4..bb5463c 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemMultiConnectionsTest.java
@@ -30,67 +30,70 @@ import org.junit.Test;
  */
 public class MonitorItemMultiConnectionsTest extends AbstractMiloServerTest {
 
-	private static final String DIRECT_START_1 = "direct:start1";
+    private static final String DIRECT_START_1 = "direct:start1";
 
-	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
+    private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
 
-	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?node=" + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
+    private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?node="
+                                                        + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
 
-	private static final String MILO_CLIENT_ITEM_C2_1 = "milo-client:tcp://foo:bar2@localhost:12685?node=" + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
+    private static final String MILO_CLIENT_ITEM_C2_1 = "milo-client:tcp://foo:bar2@localhost:12685?node="
+                                                        + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
 
-	private static final String MILO_CLIENT_ITEM_C3_1 = "milo-client:tcp://foo2:bar@localhost:12685?node=" + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
+    private static final String MILO_CLIENT_ITEM_C3_1 = "milo-client:tcp://foo2:bar@localhost:12685?node="
+                                                        + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
 
-	private static final String MOCK_TEST_1 = "mock:test1";
-	private static final String MOCK_TEST_2 = "mock:test2";
-	private static final String MOCK_TEST_3 = "mock:test3";
+    private static final String MOCK_TEST_1 = "mock:test1";
+    private static final String MOCK_TEST_2 = "mock:test2";
+    private static final String MOCK_TEST_3 = "mock:test3";
 
-	@EndpointInject(uri = MOCK_TEST_1)
-	protected MockEndpoint test1Endpoint;
+    @EndpointInject(uri = MOCK_TEST_1)
+    protected MockEndpoint test1Endpoint;
 
-	@EndpointInject(uri = MOCK_TEST_2)
-	protected MockEndpoint test2Endpoint;
+    @EndpointInject(uri = MOCK_TEST_2)
+    protected MockEndpoint test2Endpoint;
 
-	@EndpointInject(uri = MOCK_TEST_3)
-	protected MockEndpoint test3Endpoint;
+    @EndpointInject(uri = MOCK_TEST_3)
+    protected MockEndpoint test3Endpoint;
 
-	@Produce(uri = DIRECT_START_1)
-	protected ProducerTemplate producer1;
+    @Produce(uri = DIRECT_START_1)
+    protected ProducerTemplate producer1;
 
-	@Override
-	protected RoutesBuilder createRouteBuilder() throws Exception {
-		return new RouteBuilder() {
-			@Override
-			public void configure() throws Exception {
-				from(DIRECT_START_1).to(MILO_SERVER_ITEM_1);
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from(DIRECT_START_1).to(MILO_SERVER_ITEM_1);
 
-				from(MILO_CLIENT_ITEM_C1_1).to(MOCK_TEST_1);
-				from(MILO_CLIENT_ITEM_C2_1).to(MOCK_TEST_2);
-				from(MILO_CLIENT_ITEM_C3_1).to(MOCK_TEST_3);
-			}
-		};
-	}
+                from(MILO_CLIENT_ITEM_C1_1).to(MOCK_TEST_1);
+                from(MILO_CLIENT_ITEM_C2_1).to(MOCK_TEST_2);
+                from(MILO_CLIENT_ITEM_C3_1).to(MOCK_TEST_3);
+            }
+        };
+    }
 
-	/**
-	 * Monitor multiple connections, but only one has the correct credentials
-	 */
-	@Test
-	public void testMonitorItem1() throws Exception {
-		// set server value
-		this.producer1.sendBody("Foo");
+    /**
+     * Monitor multiple connections, but only one has the correct credentials
+     */
+    @Test
+    public void testMonitorItem1() throws Exception {
+        // set server value
+        this.producer1.sendBody("Foo");
 
-		// item 1 ... only this one receives
-		this.test1Endpoint.setExpectedCount(1);
-		this.test1Endpoint.setSleepForEmptyTest(5_000);
+        // item 1 ... only this one receives
+        this.test1Endpoint.setExpectedCount(1);
+        this.test1Endpoint.setSleepForEmptyTest(5_000);
 
-		// item 2
-		this.test2Endpoint.setExpectedCount(0);
-		this.test2Endpoint.setSleepForEmptyTest(5_000);
+        // item 2
+        this.test2Endpoint.setExpectedCount(0);
+        this.test2Endpoint.setSleepForEmptyTest(5_000);
 
-		// item 3
-		this.test3Endpoint.setExpectedCount(0);
-		this.test3Endpoint.setSleepForEmptyTest(5_000);
+        // item 3
+        this.test3Endpoint.setExpectedCount(0);
+        this.test3Endpoint.setSleepForEmptyTest(5_000);
 
-		// assert
-		this.assertMockEndpointsSatisfied();
-	}
+        // assert
+        this.assertMockEndpointsSatisfied();
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
index 6c11b64..bca304c 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/MonitorItemTest.java
@@ -30,59 +30,60 @@ import org.junit.Test;
  */
 public class MonitorItemTest extends AbstractMiloServerTest {
 
-	private static final String DIRECT_START_1 = "direct:start1";
+    private static final String DIRECT_START_1 = "direct:start1";
 
-	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
+    private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
 
-	private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?node=" + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
+    private static final String MILO_CLIENT_ITEM_C1_1 = "milo-client:tcp://foo:bar@localhost:12685?node="
+                                                        + NodeIds.nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
 
-	private static final String MOCK_TEST_1 = "mock:test1";
+    private static final String MOCK_TEST_1 = "mock:test1";
 
-	@EndpointInject(uri = MOCK_TEST_1)
-	protected MockEndpoint test1Endpoint;
+    @EndpointInject(uri = MOCK_TEST_1)
+    protected MockEndpoint test1Endpoint;
 
-	@Produce(uri = DIRECT_START_1)
-	protected ProducerTemplate producer1;
+    @Produce(uri = DIRECT_START_1)
+    protected ProducerTemplate producer1;
 
-	@Override
-	protected RoutesBuilder createRouteBuilder() throws Exception {
-		return new RouteBuilder() {
-			@Override
-			public void configure() throws Exception {
-				from(DIRECT_START_1).to(MILO_SERVER_ITEM_1);
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from(DIRECT_START_1).to(MILO_SERVER_ITEM_1);
 
-				from(MILO_CLIENT_ITEM_C1_1).to(MOCK_TEST_1);
-			}
-		};
-	}
+                from(MILO_CLIENT_ITEM_C1_1).to(MOCK_TEST_1);
+            }
+        };
+    }
 
-	/**
-	 * Monitor multiple events
-	 */
-	@Test
-	public void testMonitorItem1() throws Exception {
-		/*
-		 * we will wait 2 * 1_000 milliseconds between server updates since the
-		 * default server update rate is 1_000 milliseconds
-		 */
+    /**
+     * Monitor multiple events
+     */
+    @Test
+    public void testMonitorItem1() throws Exception {
+        /*
+         * we will wait 2 * 1_000 milliseconds between server updates since the
+         * default server update rate is 1_000 milliseconds
+         */
 
-		// set server values
-		this.producer1.sendBody("Foo");
-		Thread.sleep(2_000);
-		this.producer1.sendBody("Bar");
-		Thread.sleep(2_000);
-		this.producer1.sendBody("Baz");
-		Thread.sleep(2_000);
+        // set server values
+        this.producer1.sendBody("Foo");
+        Thread.sleep(2_000);
+        this.producer1.sendBody("Bar");
+        Thread.sleep(2_000);
+        this.producer1.sendBody("Baz");
+        Thread.sleep(2_000);
 
-		// item 1 ... only this one receives
-		this.test1Endpoint.setExpectedCount(3);
+        // item 1 ... only this one receives
+        this.test1Endpoint.setExpectedCount(3);
 
-		// tests
-		testBody(this.test1Endpoint.message(0), assertGoodValue("Foo"));
-		testBody(this.test1Endpoint.message(1), assertGoodValue("Bar"));
-		testBody(this.test1Endpoint.message(2), assertGoodValue("Baz"));
+        // tests
+        testBody(this.test1Endpoint.message(0), assertGoodValue("Foo"));
+        testBody(this.test1Endpoint.message(1), assertGoodValue("Bar"));
+        testBody(this.test1Endpoint.message(2), assertGoodValue("Baz"));
 
-		// assert
-		this.assertMockEndpointsSatisfied();
-	}
+        // assert
+        this.assertMockEndpointsSatisfied();
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
index a832f87..857d7a0 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/NodeIdTest.java
@@ -32,61 +32,55 @@ import org.junit.Test;
  */
 public class NodeIdTest extends AbstractMiloServerTest {
 
-	@Test
-	public void testFull1() {
-		final String s = String.format("nsu=%s;s=%s", DEFAULT_NAMESPACE_URI, "item-1");
-		testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=RAW(" + s + ")",
-				DEFAULT_NAMESPACE_URI, "item-1");
-	}
-
-	@Test
-	public void testFull2() {
-		final String s = String.format("ns=%s;s=%s", 1, "item-1");
-		testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=RAW(" + s + ")", ushort(1),
-				"item-1");
-	}
-
-	@Test
-	public void testFull3() {
-		final String s = String.format("ns=%s;i=%s", 1, 2);
-		testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=RAW(" + s + ")", ushort(1),
-				uint(2));
-	}
-
-	@Test
-	public void testFull1NonRaw() {
-		final String s = String.format("ns=%s;i=%s", 1, 2);
-		testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node="
-				+ urlFormParameterEscaper().escape(s), ushort(1), uint(2));
-	}
-
-	@Test
-	public void testDocURL() {
-		testUri("milo-client://user:password@localhost:12345?node=RAW(nsu=http://foo.bar;s=foo/bar)", "http://foo.bar",
-				"foo/bar");
-	}
-
-	@Test(expected = ResolveEndpointFailedException.class)
-	public void testMixed() {
-		// This must fail since "node" is incomplete
-		testUri("milo-client:tcp://foo:bar@localhost:12685?node=foo&namespaceUri=" + DEFAULT_NAMESPACE_URI, null, null);
-	}
-
-	private void testUri(final String uri, final Serializable namespace, final Serializable partialNodeId) {
-		assertNodeId(getMandatoryEndpoint(uri, MiloClientEndpoint.class), namespace, partialNodeId);
-	}
-
-	private void assertNodeId(final MiloClientEndpoint endpoint, final Serializable namespace,
-			final Serializable partialNodeId) {
-
-		final NamespaceId ns = endpoint.makeNamespaceId();
-		final PartialNodeId pn = endpoint.makePartialNodeId();
-
-		assertNotNull(ns);
-		assertNotNull(pn);
-
-		assertEquals(namespace, ns.getValue());
-		assertEquals(partialNodeId, pn.getValue());
-	}
+    @Test
+    public void testFull1() {
+        final String s = String.format("nsu=%s;s=%s", DEFAULT_NAMESPACE_URI, "item-1");
+        testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=RAW(" + s + ")", DEFAULT_NAMESPACE_URI, "item-1");
+    }
+
+    @Test
+    public void testFull2() {
+        final String s = String.format("ns=%s;s=%s", 1, "item-1");
+        testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=RAW(" + s + ")", ushort(1), "item-1");
+    }
+
+    @Test
+    public void testFull3() {
+        final String s = String.format("ns=%s;i=%s", 1, 2);
+        testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=RAW(" + s + ")", ushort(1), uint(2));
+    }
+
+    @Test
+    public void testFull1NonRaw() {
+        final String s = String.format("ns=%s;i=%s", 1, 2);
+        testUri("milo-client:tcp://foo:bar@localhost:12685?samplingInterval=1000&node=" + urlFormParameterEscaper().escape(s), ushort(1), uint(2));
+    }
+
+    @Test
+    public void testDocURL() {
+        testUri("milo-client://user:password@localhost:12345?node=RAW(nsu=http://foo.bar;s=foo/bar)", "http://foo.bar", "foo/bar");
+    }
+
+    @Test(expected = ResolveEndpointFailedException.class)
+    public void testMixed() {
+        // This must fail since "node" is incomplete
+        testUri("milo-client:tcp://foo:bar@localhost:12685?node=foo&namespaceUri=" + DEFAULT_NAMESPACE_URI, null, null);
+    }
+
+    private void testUri(final String uri, final Serializable namespace, final Serializable partialNodeId) {
+        assertNodeId(getMandatoryEndpoint(uri, MiloClientEndpoint.class), namespace, partialNodeId);
+    }
+
+    private void assertNodeId(final MiloClientEndpoint endpoint, final Serializable namespace, final Serializable partialNodeId) {
+
+        final NamespaceId ns = endpoint.makeNamespaceId();
+        final PartialNodeId pn = endpoint.makePartialNodeId();
+
+        assertNotNull(ns);
+        assertNotNull(pn);
+
+        assertEquals(namespace, ns.getValue());
+        assertEquals(partialNodeId, pn.getValue());
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
index 4216038..abf675d 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java
@@ -33,122 +33,122 @@ import org.junit.Test;
  */
 public class WriteClientTest extends AbstractMiloServerTest {
 
-	private static final String DIRECT_START_1 = "direct:start1";
-	private static final String DIRECT_START_2 = "direct:start2";
-	private static final String DIRECT_START_3 = "direct:start3";
-	private static final String DIRECT_START_4 = "direct:start4";
-
-	private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
-	private static final String MILO_SERVER_ITEM_2 = "milo-server:myitem2";
-
-	private static final String MILO_CLIENT_BASE_C1 = "milo-client:tcp://foo:bar@localhost:12685";
-	private static final String MILO_CLIENT_BASE_C2 = "milo-client:tcp://foo2:bar2@localhost:12685";
-
-	private static final String MILO_CLIENT_ITEM_C1_1 = MILO_CLIENT_BASE_C1 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
-	private static final String MILO_CLIENT_ITEM_C1_2 = MILO_CLIENT_BASE_C1 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem2");
-	
-	private static final String MILO_CLIENT_ITEM_C2_1 = MILO_CLIENT_BASE_C2 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
-	private static final String MILO_CLIENT_ITEM_C2_2 = MILO_CLIENT_BASE_C2 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem2");
-
-	private static final String MOCK_TEST_1 = "mock:test1";
-	private static final String MOCK_TEST_2 = "mock:test2";
-
-	@EndpointInject(uri = MOCK_TEST_1)
-	protected MockEndpoint test1Endpoint;
-
-	@EndpointInject(uri = MOCK_TEST_2)
-	protected MockEndpoint test2Endpoint;
-
-	@Produce(uri = DIRECT_START_1)
-	protected ProducerTemplate producer1;
-
-	@Produce(uri = DIRECT_START_2)
-	protected ProducerTemplate producer2;
-
-	@Produce(uri = DIRECT_START_3)
-	protected ProducerTemplate producer3;
-
-	@Produce(uri = DIRECT_START_4)
-	protected ProducerTemplate producer4;
-
-	@Override
-	protected RoutesBuilder createRouteBuilder() throws Exception {
-		return new RouteBuilder() {
-			@Override
-			public void configure() throws Exception {
-
-				from(MILO_SERVER_ITEM_1).to(MOCK_TEST_1);
-				from(MILO_SERVER_ITEM_2).to(MOCK_TEST_2);
-
-				from(DIRECT_START_1).to(MILO_CLIENT_ITEM_C1_1);
-				from(DIRECT_START_2).to(MILO_CLIENT_ITEM_C1_2);
-
-				from(DIRECT_START_3).to(MILO_CLIENT_ITEM_C2_1);
-				from(DIRECT_START_4).to(MILO_CLIENT_ITEM_C2_2);
-			}
-		};
-	}
-
-	@Test
-	public void testWrite1() throws Exception {
-		// item 1
-		this.test1Endpoint.setExpectedCount(2);
-		testBody(this.test1Endpoint.message(0), assertGoodValue("Foo1"));
-		testBody(this.test1Endpoint.message(1), assertGoodValue("Foo2"));
-
-		// item 2
-		this.test2Endpoint.setExpectedCount(0);
-
-		// send
-		sendValue(this.producer1, new Variant("Foo1"));
-		sendValue(this.producer1, new Variant("Foo2"));
-
-		// assert
-		this.assertMockEndpointsSatisfied();
-	}
-
-	@Test
-	public void testWrite2() throws Exception {
-		// item 1
-		this.test1Endpoint.setExpectedCount(0);
-
-		// item 2
-		this.test2Endpoint.setExpectedCount(2);
-		testBody(this.test2Endpoint.message(0), assertGoodValue("Foo1"));
-		testBody(this.test2Endpoint.message(1), assertGoodValue("Foo2"));
-
-		// send
-		sendValue(this.producer2, new Variant("Foo1"));
-		sendValue(this.producer2, new Variant("Foo2"));
-
-		// assert
-		this.assertMockEndpointsSatisfied();
-	}
-
-	@Test
-	public void testWrite3() throws Exception {
-		// item 1
-		this.test1Endpoint.setExpectedCount(2);
-		testBody(this.test1Endpoint.message(0), assertGoodValue("Foo1"));
-		testBody(this.test1Endpoint.message(1), assertGoodValue("Foo3"));
-
-		// item 1
-		this.test2Endpoint.setExpectedCount(2);
-		testBody(this.test2Endpoint.message(0), assertGoodValue("Foo2"));
-		testBody(this.test2Endpoint.message(1), assertGoodValue("Foo4"));
-
-		// send
-		sendValue(this.producer1, new Variant("Foo1"));
-		sendValue(this.producer2, new Variant("Foo2"));
-		sendValue(this.producer3, new Variant("Foo3"));
-		sendValue(this.producer4, new Variant("Foo4"));
-
-		// assert
-		assertMockEndpointsSatisfied();
-	}
-
-	private static void sendValue(final ProducerTemplate producerTemplate, final Variant variant) {
-		// we always write synchronously since we do need the message order
-		producerTemplate.sendBodyAndHeader(variant, "await", true);
-	}
+    private static final String DIRECT_START_1 = "direct:start1";
+    private static final String DIRECT_START_2 = "direct:start2";
+    private static final String DIRECT_START_3 = "direct:start3";
+    private static final String DIRECT_START_4 = "direct:start4";
+
+    private static final String MILO_SERVER_ITEM_1 = "milo-server:myitem1";
+    private static final String MILO_SERVER_ITEM_2 = "milo-server:myitem2";
+
+    private static final String MILO_CLIENT_BASE_C1 = "milo-client:tcp://foo:bar@localhost:12685";
+    private static final String MILO_CLIENT_BASE_C2 = "milo-client:tcp://foo2:bar2@localhost:12685";
+
+    private static final String MILO_CLIENT_ITEM_C1_1 = MILO_CLIENT_BASE_C1 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
+    private static final String MILO_CLIENT_ITEM_C1_2 = MILO_CLIENT_BASE_C1 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem2");
+
+    private static final String MILO_CLIENT_ITEM_C2_1 = MILO_CLIENT_BASE_C2 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem1");
+    private static final String MILO_CLIENT_ITEM_C2_2 = MILO_CLIENT_BASE_C2 + "?node=" + nodeValue(MiloServerComponent.DEFAULT_NAMESPACE_URI, "items-myitem2");
+
+    private static final String MOCK_TEST_1 = "mock:test1";
+    private static final String MOCK_TEST_2 = "mock:test2";
+
+    @EndpointInject(uri = MOCK_TEST_1)
+    protected MockEndpoint test1Endpoint;
+
+    @EndpointInject(uri = MOCK_TEST_2)
+    protected MockEndpoint test2Endpoint;
+
+    @Produce(uri = DIRECT_START_1)
+    protected ProducerTemplate producer1;
+
+    @Produce(uri = DIRECT_START_2)
+    protected ProducerTemplate producer2;
+
+    @Produce(uri = DIRECT_START_3)
+    protected ProducerTemplate producer3;
+
+    @Produce(uri = DIRECT_START_4)
+    protected ProducerTemplate producer4;
+
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+
+                from(MILO_SERVER_ITEM_1).to(MOCK_TEST_1);
+                from(MILO_SERVER_ITEM_2).to(MOCK_TEST_2);
+
+                from(DIRECT_START_1).to(MILO_CLIENT_ITEM_C1_1);
+                from(DIRECT_START_2).to(MILO_CLIENT_ITEM_C1_2);
+
+                from(DIRECT_START_3).to(MILO_CLIENT_ITEM_C2_1);
+                from(DIRECT_START_4).to(MILO_CLIENT_ITEM_C2_2);
+            }
+        };
+    }
+
+    @Test
+    public void testWrite1() throws Exception {
+        // item 1
+        this.test1Endpoint.setExpectedCount(2);
+        testBody(this.test1Endpoint.message(0), assertGoodValue("Foo1"));
+        testBody(this.test1Endpoint.message(1), assertGoodValue("Foo2"));
+
+        // item 2
+        this.test2Endpoint.setExpectedCount(0);
+
+        // send
+        sendValue(this.producer1, new Variant("Foo1"));
+        sendValue(this.producer1, new Variant("Foo2"));
+
+        // assert
+        this.assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testWrite2() throws Exception {
+        // item 1
+        this.test1Endpoint.setExpectedCount(0);
+
+        // item 2
+        this.test2Endpoint.setExpectedCount(2);
+        testBody(this.test2Endpoint.message(0), assertGoodValue("Foo1"));
+        testBody(this.test2Endpoint.message(1), assertGoodValue("Foo2"));
+
+        // send
+        sendValue(this.producer2, new Variant("Foo1"));
+        sendValue(this.producer2, new Variant("Foo2"));
+
+        // assert
+        this.assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testWrite3() throws Exception {
+        // item 1
+        this.test1Endpoint.setExpectedCount(2);
+        testBody(this.test1Endpoint.message(0), assertGoodValue("Foo1"));
+        testBody(this.test1Endpoint.message(1), assertGoodValue("Foo3"));
+
+        // item 1
+        this.test2Endpoint.setExpectedCount(2);
+        testBody(this.test2Endpoint.message(0), assertGoodValue("Foo2"));
+        testBody(this.test2Endpoint.message(1), assertGoodValue("Foo4"));
+
+        // send
+        sendValue(this.producer1, new Variant("Foo1"));
+        sendValue(this.producer2, new Variant("Foo2"));
+        sendValue(this.producer3, new Variant("Foo3"));
+        sendValue(this.producer4, new Variant("Foo4"));
+
+        // assert
+        assertMockEndpointsSatisfied();
+    }
+
+    private static void sendValue(final ProducerTemplate producerTemplate, final Variant variant) {
+        // we always write synchronously since we do need the message order
+        producerTemplate.sendBodyAndHeader(variant, "await", true);
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
index 5d00ae3..93a8f78 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/converter/ConverterTest.java
@@ -24,26 +24,26 @@ import org.junit.Test;
 
 public class ConverterTest extends CamelTestSupport {
 
-	@Test
-	public void testDataValueToVariant() {
-		final Variant value = testConvertDataValue("Foo", Variant.class);
-		Assert.assertNotNull(value);
-		Assert.assertEquals("Foo", value.getValue());
-	}
+    @Test
+    public void testDataValueToVariant() {
+        final Variant value = testConvertDataValue("Foo", Variant.class);
+        Assert.assertNotNull(value);
+        Assert.assertEquals("Foo", value.getValue());
+    }
 
-	@Test
-	public void testVariantToDataValue() {
-		final DataValue value = testConvert(new Variant("Foo"), DataValue.class);
-		Assert.assertNotNull(value);
-		Assert.assertEquals("Foo", value.getValue().getValue());
-		Assert.assertTrue(value.getStatusCode().isGood());
-	}
+    @Test
+    public void testVariantToDataValue() {
+        final DataValue value = testConvert(new Variant("Foo"), DataValue.class);
+        Assert.assertNotNull(value);
+        Assert.assertEquals("Foo", value.getValue().getValue());
+        Assert.assertTrue(value.getStatusCode().isGood());
+    }
 
-	private <T> T testConvert(final Object value, final Class<T> clazz) {
-		return this.context.getTypeConverter().convertTo(clazz, value);
-	}
+    private <T> T testConvert(final Object value, final Class<T> clazz) {
+        return this.context.getTypeConverter().convertTo(clazz, value);
+    }
 
-	private <T> T testConvertDataValue(final Object value, final Class<T> clazz) {
-		return this.context.getTypeConverter().convertTo(clazz, new DataValue(new Variant(value)));
-	}
+    private <T> T testConvertDataValue(final Object value, final Class<T> clazz) {
+        return this.context.getTypeConverter().convertTo(clazz, new DataValue(new Variant(value)));
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
index 53b66ec..3195e18 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
@@ -30,54 +30,54 @@ import org.junit.Test;
  */
 public class ServerLocalTest extends CamelTestSupport {
 
-	private static final String MILO_ITEM_1 = "milo-server:myitem1";
+    private static final String MILO_ITEM_1 = "milo-server:myitem1";
 
-	private static final String MOCK_TEST = "mock:test";
+    private static final String MOCK_TEST = "mock:test";
 
-	@EndpointInject(uri = MOCK_TEST)
-	protected MockEndpoint testEndpoint;
+    @EndpointInject(uri = MOCK_TEST)
+    protected MockEndpoint testEndpoint;
 
-	@Override
-	protected RoutesBuilder createRouteBuilder() throws Exception {
-		return new RouteBuilder() {
-			@Override
-			public void configure() throws Exception {
-				from(MILO_ITEM_1).to(MOCK_TEST);
-			}
-		};
-	}
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from(MILO_ITEM_1).to(MOCK_TEST);
+            }
+        };
+    }
 
-	@Test
-	public void shouldStartComponent() {
-	}
+    @Test
+    public void shouldStartComponent() {
+    }
 
-	@Test
-	public void testAcceptVariantString() {
-		sendBody(MILO_ITEM_1, new Variant("Foo"));
-	}
+    @Test
+    public void testAcceptVariantString() {
+        sendBody(MILO_ITEM_1, new Variant("Foo"));
+    }
 
-	@Test
-	public void testAcceptVariantDouble() {
-		sendBody(MILO_ITEM_1, new Variant(0.0));
-	}
+    @Test
+    public void testAcceptVariantDouble() {
+        sendBody(MILO_ITEM_1, new Variant(0.0));
+    }
 
-	@Test
-	public void testAcceptString() {
-		sendBody(MILO_ITEM_1, "Foo");
-	}
+    @Test
+    public void testAcceptString() {
+        sendBody(MILO_ITEM_1, "Foo");
+    }
 
-	@Test
-	public void testAcceptDouble() {
-		sendBody(MILO_ITEM_1, 0.0);
-	}
+    @Test
+    public void testAcceptDouble() {
+        sendBody(MILO_ITEM_1, 0.0);
+    }
 
-	@Test
-	public void testAcceptDataValueString() {
-		sendBody(MILO_ITEM_1, new DataValue(new Variant("Foo")));
-	}
+    @Test
+    public void testAcceptDataValueString() {
+        sendBody(MILO_ITEM_1, new DataValue(new Variant("Foo")));
+    }
 
-	@Test
-	public void testAcceptDataValueDouble() {
-		sendBody(MILO_ITEM_1, new DataValue(new Variant(0.0)));
-	}
+    @Test
+    public void testAcceptDataValueDouble() {
+        sendBody(MILO_ITEM_1, new DataValue(new Variant(0.0)));
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
index 35f31d6..979451b 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
@@ -30,22 +30,21 @@ import org.junit.Test;
  */
 public class ServerSetCertificateManagerTest extends AbstractMiloServerTest {
 
-	@Override
-	protected void configureMiloServer(final MiloServerComponent server) throws Exception {
-		super.configureMiloServer(server);
+    @Override
+    protected void configureMiloServer(final MiloServerComponent server) throws Exception {
+        super.configureMiloServer(server);
 
-		final Path baseDir = Paths.get("target/testing/cert/default");
-		final Path trusted = baseDir.resolve("trusted");
+        final Path baseDir = Paths.get("target/testing/cert/default");
+        final Path trusted = baseDir.resolve("trusted");
 
-		Files.createDirectories(trusted);
-		Files.copy(Paths.get("src/test/resources/cert/certificate.der"), trusted.resolve("certificate.der"),
-				REPLACE_EXISTING);
+        Files.createDirectories(trusted);
+        Files.copy(Paths.get("src/test/resources/cert/certificate.der"), trusted.resolve("certificate.der"), REPLACE_EXISTING);
 
-		server.setServerCertificate(loadDefaultTestKey());
-		server.setDefaultCertificateValidator(baseDir.toFile());
-	}
+        server.setServerCertificate(loadDefaultTestKey());
+        server.setDefaultCertificateValidator(baseDir.toFile());
+    }
 
-	@Test
-	public void shouldStart() {
-	}
+    @Test
+    public void shouldStart() {
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
index 75e3457..92148aa 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
@@ -24,27 +24,27 @@ import org.junit.Test;
  */
 public class ServerSetSecurityPoliciesTest extends CamelTestSupport {
 
-	@Test
-	public void testSetSecurityPolicies1() {
-		final MiloServerComponent component = new MiloServerComponent();
-		component.setSecurityPoliciesById("None");
-	}
+    @Test
+    public void testSetSecurityPolicies1() {
+        final MiloServerComponent component = new MiloServerComponent();
+        component.setSecurityPoliciesById("None");
+    }
 
-	@Test
-	public void testSetSecurityPolicies2() {
-		final MiloServerComponent component = new MiloServerComponent();
-		component.setSecurityPoliciesById("http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256");
-	}
+    @Test
+    public void testSetSecurityPolicies2() {
+        final MiloServerComponent component = new MiloServerComponent();
+        component.setSecurityPoliciesById("http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256");
+    }
 
-	@Test
-	public void testSetSecurityPolicies3() {
-		final MiloServerComponent component = new MiloServerComponent();
-		component.setSecurityPoliciesById("None", "http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256");
-	}
+    @Test
+    public void testSetSecurityPolicies3() {
+        final MiloServerComponent component = new MiloServerComponent();
+        component.setSecurityPoliciesById("None", "http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256");
+    }
 
-	@Test(expected = IllegalArgumentException.class)
-	public void testSetSecurityPolicies4() {
-		final MiloServerComponent component = new MiloServerComponent();
-		component.setSecurityPoliciesById("I just made that up");
-	}
+    @Test(expected = IllegalArgumentException.class)
+    public void testSetSecurityPolicies4() {
+        final MiloServerComponent component = new MiloServerComponent();
+        component.setSecurityPoliciesById("I just made that up");
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
index 1fa5df6..e49fea9 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
@@ -21,52 +21,49 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.DefaultCamelContext;
 
 public class Application {
-	public static void main(final String[] args) throws Exception {
+    public static void main(final String[] args) throws Exception {
 
-		// camel conext
+        // camel conext
 
-		final CamelContext context = new DefaultCamelContext();
+        final CamelContext context = new DefaultCamelContext();
 
-		// add paho
+        // add paho
 
-		// no need to register, gets auto detected
-		// context.addComponent("paho", new PahoComponent());
+        // no need to register, gets auto detected
+        // context.addComponent("paho", new PahoComponent());
 
-		// no need to register, gets auto detected
-		// context.addComponent("milo-server", new MiloClientComponent());
-		// context.addComponent("milo-client", new MiloClientComponent());
+        // no need to register, gets auto detected
+        // context.addComponent("milo-server", new MiloClientComponent());
+        // context.addComponent("milo-client", new MiloClientComponent());
 
-		// add routes
+        // add routes
 
-		context.addRoutes(new RouteBuilder() {
+        context.addRoutes(new RouteBuilder() {
 
-			@Override
-			public void configure() throws Exception {
-				from("paho:javaonedemo/eclipse-greenhouse-9home/sensors/temperature?brokerUrl=tcp://iot.eclipse.org:1883")
-						.log("Temp update: ${body}").convertBodyTo(String.class).to("milo-server:MyItem");
+            @Override
+            public void configure() throws Exception {
+                from("paho:javaonedemo/eclipse-greenhouse-9home/sensors/temperature?brokerUrl=tcp://iot.eclipse.org:1883").log("Temp update: ${body}").convertBodyTo(String.class)
+                    .to("milo-server:MyItem");
 
-				from("milo-server:MyItem").log("MyItem: ${body}");
+                from("milo-server:MyItem").log("MyItem: ${body}");
 
-				from("milo-server:MyItem2").log("MyItem2 : ${body}")
-						.to("paho:de/dentrassi/camel/milo/test1?brokerUrl=tcp://iot.eclipse.org:1883");
+                from("milo-server:MyItem2").log("MyItem2 : ${body}").to("paho:de/dentrassi/camel/milo/test1?brokerUrl=tcp://iot.eclipse.org:1883");
 
-				from("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem&namespaceUri=urn:camel")
-						.log("From OPC UA: ${body}")
-						.to("milo-client:tcp://localhost:12685?nodeId=items-MyItem2&namespaceUri=urn:camel");
+                from("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem&namespaceUri=urn:camel").log("From OPC UA: ${body}")
+                    .to("milo-client:tcp://localhost:12685?nodeId=items-MyItem2&namespaceUri=urn:camel");
 
-				from("paho:de/dentrassi/camel/milo/test1?brokerUrl=tcp://iot.eclipse.org:1883")
-						.log("Back from MQTT: ${body}");
-			}
-		});
+                from("paho:de/dentrassi/camel/milo/test1?brokerUrl=tcp://iot.eclipse.org:1883").log("Back from MQTT: ${body}");
+            }
+        });
 
-		// start
+        // start
 
-		context.start();
+        context.start();
 
-		// sleep
+        // sleep
 
-		while (true) {
-			Thread.sleep(Long.MAX_VALUE);
-		}
-	}
+        while (true) {
+            Thread.sleep(Long.MAX_VALUE);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
index 4d76b38..3f03789 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
@@ -21,39 +21,38 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.DefaultCamelContext;
 
 public class Application2Client {
-	public static void main(final String[] args) throws Exception {
+    public static void main(final String[] args) throws Exception {
 
-		// camel conext
+        // camel conext
 
-		final CamelContext context = new DefaultCamelContext();
+        final CamelContext context = new DefaultCamelContext();
 
-		// add paho
+        // add paho
 
-		// no need to register, gets auto detected
-		// context.addComponent("paho", new PahoComponent());
+        // no need to register, gets auto detected
+        // context.addComponent("paho", new PahoComponent());
 
-		// add OPC UA
+        // add OPC UA
 
-		// add routes
+        // add routes
 
-		context.addRoutes(new RouteBuilder() {
+        context.addRoutes(new RouteBuilder() {
 
-			@Override
-			public void configure() throws Exception {
-				from("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem&namespaceUri=urn:org:apache:camel")
-						.log("From OPC UA: ${body}")
-						.to("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem2&namespaceUri=urn:org:apache:camel");
-			}
-		});
+            @Override
+            public void configure() throws Exception {
+                from("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem&namespaceUri=urn:org:apache:camel").log("From OPC UA: ${body}")
+                    .to("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem2&namespaceUri=urn:org:apache:camel");
+            }
+        });
 
-		// start
+        // start
 
-		context.start();
+        context.start();
 
-		// sleep
+        // sleep
 
-		while (true) {
-			Thread.sleep(Long.MAX_VALUE);
-		}
-	}
+        while (true) {
+            Thread.sleep(Long.MAX_VALUE);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/19db14d7/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
index af596cf..21d955e 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
@@ -22,51 +22,48 @@ import org.apache.camel.component.milo.server.MiloServerComponent;
 import org.apache.camel.impl.DefaultCamelContext;
 
 public class Application2Server {
-	public static void main(final String[] args) throws Exception {
+    public static void main(final String[] args) throws Exception {
 
-		// camel conext
+        // camel conext
 
-		final CamelContext context = new DefaultCamelContext();
+        final CamelContext context = new DefaultCamelContext();
 
-		// add paho
+        // add paho
 
-		// no need to register, gets auto detected
-		// context.addComponent("paho", new PahoComponent());
-		((MiloServerComponent) context.getComponent("milo-server")).setUserAuthenticationCredentials("foo:bar");
+        // no need to register, gets auto detected
+        // context.addComponent("paho", new PahoComponent());
+        ((MiloServerComponent)context.getComponent("milo-server")).setUserAuthenticationCredentials("foo:bar");
 
-		// add routes
+        // add routes
 
-		context.addRoutes(new RouteBuilder() {
+        context.addRoutes(new RouteBuilder() {
 
-			@Override
-			public void configure() throws Exception {
-				/*
-				 * from(
-				 * "paho:javaonedemo/eclipse-greenhouse-9home/sensors/temperature?brokerUrl=tcp://iot.eclipse.org:1883")
-				 * .log("Temp update: ${body}").convertBodyTo(String.class).to(
-				 * "milo-server:MyItem");
-				 */
+            @Override
+            public void configure() throws Exception {
+                /*
+                 * from(
+                 * "paho:javaonedemo/eclipse-greenhouse-9home/sensors/temperature?brokerUrl=tcp://iot.eclipse.org:1883")
+                 * .log("Temp update: ${body}").convertBodyTo(String.class).to(
+                 * "milo-server:MyItem");
+                 */
 
-				from("paho:my/foo/bar?brokerUrl=tcp://iot.eclipse.org:1883").log("Temp update: ${body}")
-						.convertBodyTo(String.class).to("milo-server:MyItem");
+                from("paho:my/foo/bar?brokerUrl=tcp://iot.eclipse.org:1883").log("Temp update: ${body}").convertBodyTo(String.class).to("milo-server:MyItem");
 
-				from("milo-server:MyItem").log("MyItem: ${body}");
-				from("milo-server:MyItem2").log("MyItem2: ${body}").convertBodyTo(String.class)
-						.to("paho:de/dentrassi/camel/milo/temperature?brokerUrl=tcp://iot.eclipse.org:1883");
+                from("milo-server:MyItem").log("MyItem: ${body}");
+                from("milo-server:MyItem2").log("MyItem2: ${body}").convertBodyTo(String.class).to("paho:de/dentrassi/camel/milo/temperature?brokerUrl=tcp://iot.eclipse.org:1883");
 
-				from("paho:de/dentrassi/camel/milo/temperature?brokerUrl=tcp://iot.eclipse.org:1883")
-						.log("Back from MQTT: ${body}");
-			}
-		});
+                from("paho:de/dentrassi/camel/milo/temperature?brokerUrl=tcp://iot.eclipse.org:1883").log("Back from MQTT: ${body}");
+            }
+        });
 
-		// start
+        // start
 
-		context.start();
+        context.start();
 
-		// sleep
+        // sleep
 
-		while (true) {
-			Thread.sleep(Long.MAX_VALUE);
-		}
-	}
+        while (true) {
+            Thread.sleep(Long.MAX_VALUE);
+        }
+    }
 }


[16/18] camel git commit: Fix a bunch of other checkstyle violations

Posted by ac...@apache.org.
Fix a bunch of other checkstyle violations


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/839453f8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/839453f8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/839453f8

Branch: refs/heads/master
Commit: 839453f85b8aefb24195eb7d9881b9f15b2b5410
Parents: 942f160
Author: Jens Reimann <jr...@redhat.com>
Authored: Wed Apr 12 09:59:16 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Apr 12 10:55:27 2017 +0200

----------------------------------------------------------------------
 .../milo/client/MiloClientConnection.java       |  2 +-
 .../milo/client/MiloClientEndpoint.java         |  4 +-
 .../client/MiloClientItemConfiguration.java     |  6 +-
 .../client/internal/SubscriptionManager.java    | 80 ++++++++++----------
 .../milo/server/MiloServerComponent.java        | 39 +++++-----
 .../milo/server/MiloServerConsumer.java         |  2 +-
 .../milo/server/MiloServerEndpoint.java         |  2 +-
 .../milo/server/MiloServerProducer.java         |  2 +-
 .../component/milo/testing/Application.java     |  6 +-
 .../milo/testing/Application2Client.java        |  6 +-
 .../milo/testing/Application2Server.java        |  5 +-
 11 files changed, 82 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
index ec3d569..b521b0b 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConnection.java
@@ -74,7 +74,7 @@ public class MiloClientConnection implements AutoCloseable {
 
     @FunctionalInterface
     public interface MonitorHandle {
-        public void unregister();
+        void unregister();
     }
 
     public MonitorHandle monitorValue(final MiloClientItemConfiguration configuration, final Consumer<DataValue> valueConsumer) {

http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
index 7826389..34a4148 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
@@ -30,7 +30,7 @@ import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId;
 
-@UriEndpoint(scheme = "milo-client", syntax = "milo-client:tcp://user:password@host:port/path/to/service?itemId=item.id&namespaceUri=urn:foo:bar", title = "Milo based OPC UA Client", consumerClass = MiloClientConsumer.class, label = "iot")
+@UriEndpoint(scheme = "milo-client", syntax = "milo-client:tcp://user:password@host:port/path/to/service", title = "Milo based OPC UA Client", consumerClass = MiloClientConsumer.class, label = "iot")
 public class MiloClientEndpoint extends DefaultEndpoint implements MiloClientItemConfiguration {
 
     /**
@@ -62,7 +62,7 @@ public class MiloClientEndpoint extends DefaultEndpoint implements MiloClientIte
      * Default "await" setting for writes
      */
     @UriParam
-    private boolean defaultAwaitWrites = false;
+    private boolean defaultAwaitWrites;
 
     private final MiloClientConnection connection;
     private final MiloClientComponent component;

http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
index 2468449..5e7954d 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientItemConfiguration.java
@@ -20,9 +20,9 @@ import org.apache.camel.component.milo.NamespaceId;
 import org.apache.camel.component.milo.PartialNodeId;
 
 public interface MiloClientItemConfiguration {
-    public NamespaceId makeNamespaceId();
+    NamespaceId makeNamespaceId();
 
-    public PartialNodeId makePartialNodeId();
+    PartialNodeId makePartialNodeId();
 
-    public Double getSamplingInterval();
+    Double getSamplingInterval();
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
index 0350987..7502164 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java
@@ -68,7 +68,7 @@ import org.slf4j.LoggerFactory;
 
 public class SubscriptionManager {
 
-    private final static Logger LOG = LoggerFactory.getLogger(SubscriptionManager.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SubscriptionManager.class);
 
     private final AtomicLong clientHandleCounter = new AtomicLong(0);
 
@@ -100,7 +100,7 @@ public class SubscriptionManager {
     }
 
     public interface Worker<T> {
-        public void work(T on) throws Exception;
+        void work(T on) throws Exception;
     }
 
     private static class Subscription {
@@ -110,7 +110,7 @@ public class SubscriptionManager {
 
         private final Consumer<DataValue> valueConsumer;
 
-        public Subscription(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final Double samplingInterval, final Consumer<DataValue> valueConsumer) {
+        Subscription(final NamespaceId namespaceId, final PartialNodeId partialNodeId, final Double samplingInterval, final Consumer<DataValue> valueConsumer) {
             this.namespaceId = namespaceId;
             this.partialNodeId = partialNodeId;
             this.samplingInterval = samplingInterval;
@@ -144,7 +144,7 @@ public class SubscriptionManager {
 
         private final Map<String, UShort> namespaceCache = new ConcurrentHashMap<>();
 
-        public Connected(final OpcUaClient client, final UaSubscription manager) {
+        Connected(final OpcUaClient client, final UaSubscription manager) {
             this.client = client;
             this.manager = manager;
         }
@@ -179,9 +179,7 @@ public class SubscriptionManager {
                 }
             }
 
-            if (!items.isEmpty())
-
-            {
+            if (!items.isEmpty()) {
 
                 // create monitors
 
@@ -364,6 +362,10 @@ public class SubscriptionManager {
             }
         }
 
+        performAndEvalConnect();
+    }
+
+    private void performAndEvalConnect() {
         try {
             final Connected connected = performConnect();
             LOG.debug("Connect call done");
@@ -398,38 +400,6 @@ public class SubscriptionManager {
         }
     }
 
-    public void dispose() {
-        Connected connected;
-
-        synchronized (this) {
-            if (this.disposed) {
-                return;
-            }
-            this.disposed = true;
-            connected = this.connected;
-        }
-
-        if (connected != null) {
-            // dispose outside of lock
-            connected.dispose();
-        }
-    }
-
-    private synchronized void triggerReconnect(final boolean immediate) {
-        LOG.info("Trigger re-connect (immediate: {})", immediate);
-
-        if (this.reconnectJob != null) {
-            LOG.info("Re-connect already scheduled");
-            return;
-        }
-
-        if (immediate) {
-            this.reconnectJob = this.executor.submit(this::connect);
-        } else {
-            this.reconnectJob = this.executor.schedule(this::connect, this.reconnectTimeout, TimeUnit.MILLISECONDS);
-        }
-    }
-
     private Connected performConnect() throws Exception {
         final EndpointDescription endpoint = UaTcpStackClient.getEndpoints(this.configuration.getEndpointUri()).thenApply(endpoints -> {
             if (LOG.isDebugEnabled()) {
@@ -485,6 +455,38 @@ public class SubscriptionManager {
         }
     }
 
+    public void dispose() {
+        Connected connected;
+
+        synchronized (this) {
+            if (this.disposed) {
+                return;
+            }
+            this.disposed = true;
+            connected = this.connected;
+        }
+
+        if (connected != null) {
+            // dispose outside of lock
+            connected.dispose();
+        }
+    }
+
+    private synchronized void triggerReconnect(final boolean immediate) {
+        LOG.info("Trigger re-connect (immediate: {})", immediate);
+
+        if (this.reconnectJob != null) {
+            LOG.info("Re-connect already scheduled");
+            return;
+        }
+
+        if (immediate) {
+            this.reconnectJob = this.executor.submit(this::connect);
+        } else {
+            this.reconnectJob = this.executor.schedule(this::connect, this.reconnectTimeout, TimeUnit.MILLISECONDS);
+        }
+    }
+
     private EndpointDescription findEndpoint(final EndpointDescription[] endpoints) {
         EndpointDescription best = null;
         for (final EndpointDescription ep : endpoints) {

http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
index b72c6b5..e8295f7 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
@@ -68,30 +68,10 @@ import static org.eclipse.milo.opcua.sdk.server.api.config.OpcUaServerConfig.USE
  * OPC UA Server based component
  */
 public class MiloServerComponent extends DefaultComponent {
+    public static final String DEFAULT_NAMESPACE_URI = "urn:org:apache:camel";
 
     private static final Logger LOG = LoggerFactory.getLogger(MiloClientConsumer.class);
-
-    private final static class DenyAllCertificateValidator implements CertificateValidator {
-        public static final CertificateValidator INSTANCE = new DenyAllCertificateValidator();
-
-        private DenyAllCertificateValidator() {
-        }
-
-        @Override
-        public void validate(final X509Certificate certificate) throws UaException {
-            throw new UaException(StatusCodes.Bad_CertificateUseNotAllowed);
-        }
-
-        @Override
-        public void verifyTrustChain(final X509Certificate certificate, final List<X509Certificate> chain) throws UaException {
-            throw new UaException(StatusCodes.Bad_CertificateUseNotAllowed);
-        }
-    }
-
     private static final String URL_CHARSET = "UTF-8";
-
-    public static final String DEFAULT_NAMESPACE_URI = "urn:org:apache:camel";
-
     private static final OpcUaServerConfig DEFAULT_SERVER_CONFIG;
 
     static {
@@ -112,6 +92,23 @@ public class MiloServerComponent extends DefaultComponent {
         DEFAULT_SERVER_CONFIG = cfg.build();
     }
 
+    private static final class DenyAllCertificateValidator implements CertificateValidator {
+        public static final CertificateValidator INSTANCE = new DenyAllCertificateValidator();
+
+        private DenyAllCertificateValidator() {
+        }
+
+        @Override
+        public void validate(final X509Certificate certificate) throws UaException {
+            throw new UaException(StatusCodes.Bad_CertificateUseNotAllowed);
+        }
+
+        @Override
+        public void verifyTrustChain(final X509Certificate certificate, final List<X509Certificate> chain) throws UaException {
+            throw new UaException(StatusCodes.Bad_CertificateUseNotAllowed);
+        }
+    }
+
     private String namespaceUri = DEFAULT_NAMESPACE_URI;
 
     private final OpcUaServerConfigBuilder serverConfig;

http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
index 5f6e925..ca91d14 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerConsumer.java
@@ -27,7 +27,7 @@ import org.apache.camel.impl.DefaultConsumer;
 import org.apache.camel.impl.DefaultMessage;
 import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
 
-class MiloServerConsumer extends DefaultConsumer {
+public class MiloServerConsumer extends DefaultConsumer {
 
     private final CamelServerItem item;
     private final Consumer<DataValue> writeHandler = this::performWrite;

http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
index df67226..6384365 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
@@ -31,7 +31,7 @@ import org.apache.camel.spi.UriPath;
  * OPC UA Server based endpoint
  */
 @UriEndpoint(scheme = "milo-server", syntax = "milo-server:itemId", title = "OPC UA Server", consumerClass = MiloServerConsumer.class, label = "iot")
-class MiloServerEndpoint extends DefaultEndpoint {
+public class MiloServerEndpoint extends DefaultEndpoint {
 
     @UriPath
     @Metadata(required = "true")

http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
index 6f71a12..c42da2d 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerProducer.java
@@ -21,7 +21,7 @@ import org.apache.camel.Exchange;
 import org.apache.camel.component.milo.server.internal.CamelServerItem;
 import org.apache.camel.impl.DefaultProducer;
 
-class MiloServerProducer extends DefaultProducer {
+public class MiloServerProducer extends DefaultProducer {
 
     private final CamelServerItem item;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
index e49fea9..a78efbf 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
@@ -20,7 +20,11 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.DefaultCamelContext;
 
-public class Application {
+public final class Application {
+
+    private Application() {
+    }
+
     public static void main(final String[] args) throws Exception {
 
         // camel conext

http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
index 3f03789..d613a18 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
@@ -20,7 +20,11 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.DefaultCamelContext;
 
-public class Application2Client {
+public final class Application2Client {
+
+    private Application2Client() {
+    }
+
     public static void main(final String[] args) throws Exception {
 
         // camel conext

http://git-wip-us.apache.org/repos/asf/camel/blob/839453f8/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
index 21d955e..ae85890 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
@@ -21,7 +21,10 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.milo.server.MiloServerComponent;
 import org.apache.camel.impl.DefaultCamelContext;
 
-public class Application2Server {
+public final class Application2Server {
+    private Application2Server() {
+    }
+
     public static void main(final String[] args) throws Exception {
 
         // camel conext


[03/18] camel git commit: Initial import of Camel Milo

Posted by ac...@apache.org.
http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
new file mode 100644
index 0000000..84b16f9
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.server;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
+import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
+import org.junit.Test;
+
+/**
+ * Unit tests for milo server component without using an actual connection
+ */
+public class ServerLocalTest extends CamelTestSupport {
+
+	private static final String MILO_ITEM_1 = "milo-server:myitem1";
+
+	private static final String MOCK_TEST = "mock:test";
+
+	@EndpointInject(uri = MOCK_TEST)
+	protected MockEndpoint testEndpoint;
+
+	@Override
+	protected RoutesBuilder createRouteBuilder() throws Exception {
+		return new RouteBuilder() {
+			@Override
+			public void configure() throws Exception {
+				from(MILO_ITEM_1).to(MOCK_TEST);
+			}
+		};
+	}
+
+	@Test
+	public void shouldStartComponent() {
+	}
+
+	@Test
+	public void testAcceptVariantString() {
+		sendBody(MILO_ITEM_1, new Variant("Foo"));
+	}
+
+	@Test
+	public void testAcceptVariantDouble() {
+		sendBody(MILO_ITEM_1, new Variant(0.0));
+	}
+
+	@Test
+	public void testAcceptString() {
+		sendBody(MILO_ITEM_1, "Foo");
+	}
+
+	@Test
+	public void testAcceptDouble() {
+		sendBody(MILO_ITEM_1, 0.0);
+	}
+
+	@Test
+	public void testAcceptDataValueString() {
+		sendBody(MILO_ITEM_1, new DataValue(new Variant("Foo")));
+	}
+
+	@Test
+	public void testAcceptDataValueDouble() {
+		sendBody(MILO_ITEM_1, new DataValue(new Variant(0.0)));
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
new file mode 100644
index 0000000..c2677a2
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetCertificateManagerTest.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.server;
+
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.apache.camel.component.milo.AbstractMiloServerTest;
+import org.junit.Test;
+
+/**
+ * Test setting the certificate manager
+ */
+public class ServerSetCertificateManagerTest extends AbstractMiloServerTest {
+
+	@Override
+	protected void configureMiloServer(final MiloServerComponent server) throws Exception {
+		super.configureMiloServer(server);
+
+		final Path baseDir = Paths.get("target/testing/cert/default");
+		final Path trusted = baseDir.resolve("trusted");
+
+		Files.createDirectories(trusted);
+		Files.copy(Paths.get("src/test/resources/cert/certificate.der"), trusted.resolve("certificate.der"),
+				REPLACE_EXISTING);
+
+		server.setServerCertificate(loadDefaultTestKey());
+		server.setDefaultCertificateValidator(baseDir.toFile());
+	}
+
+	@Test
+	public void shouldStart() {
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
new file mode 100644
index 0000000..8a069d3
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com> and others
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.server;
+
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+/**
+ * Test setting security policies
+ */
+public class ServerSetSecurityPoliciesTest extends CamelTestSupport {
+
+	@Test
+	public void testSetSecurityPolicies1() {
+		final MiloServerComponent component = new MiloServerComponent();
+		component.setSecurityPoliciesById("None");
+	}
+
+	@Test
+	public void testSetSecurityPolicies2() {
+		final MiloServerComponent component = new MiloServerComponent();
+		component.setSecurityPoliciesById("http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256");
+	}
+
+	@Test
+	public void testSetSecurityPolicies3() {
+		final MiloServerComponent component = new MiloServerComponent();
+		component.setSecurityPoliciesById("None", "http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256");
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testSetSecurityPolicies4() {
+		final MiloServerComponent component = new MiloServerComponent();
+		component.setSecurityPoliciesById("I just made that up");
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
new file mode 100644
index 0000000..df0f984
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.testing;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
+
+public class Application {
+	public static void main(final String[] args) throws Exception {
+
+		// camel conext
+
+		final CamelContext context = new DefaultCamelContext();
+
+		// add paho
+
+		// no need to register, gets auto detected
+		// context.addComponent("paho", new PahoComponent());
+
+		// no need to register, gets auto detected
+		// context.addComponent("milo-server", new MiloClientComponent());
+		// context.addComponent("milo-client", new MiloClientComponent());
+
+		// add routes
+
+		context.addRoutes(new RouteBuilder() {
+
+			@Override
+			public void configure() throws Exception {
+				from("paho:javaonedemo/eclipse-greenhouse-9home/sensors/temperature?brokerUrl=tcp://iot.eclipse.org:1883")
+						.log("Temp update: ${body}").convertBodyTo(String.class).to("milo-server:MyItem");
+
+				from("milo-server:MyItem").log("MyItem: ${body}");
+
+				from("milo-server:MyItem2").log("MyItem2 : ${body}")
+						.to("paho:de/dentrassi/camel/milo/test1?brokerUrl=tcp://iot.eclipse.org:1883");
+
+				from("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem&namespaceUri=urn:camel")
+						.log("From OPC UA: ${body}")
+						.to("milo-client:tcp://localhost:12685?nodeId=items-MyItem2&namespaceUri=urn:camel");
+
+				from("paho:de/dentrassi/camel/milo/test1?brokerUrl=tcp://iot.eclipse.org:1883")
+						.log("Back from MQTT: ${body}");
+			}
+		});
+
+		// start
+
+		context.start();
+
+		// sleep
+
+		while (true) {
+			Thread.sleep(Long.MAX_VALUE);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
new file mode 100644
index 0000000..6c72a6a
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Client.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.testing;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
+
+public class Application2Client {
+	public static void main(final String[] args) throws Exception {
+
+		// camel conext
+
+		final CamelContext context = new DefaultCamelContext();
+
+		// add paho
+
+		// no need to register, gets auto detected
+		// context.addComponent("paho", new PahoComponent());
+
+		// add OPC UA
+
+		// add routes
+
+		context.addRoutes(new RouteBuilder() {
+
+			@Override
+			public void configure() throws Exception {
+				from("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem&namespaceUri=urn:org:apache:camel")
+						.log("From OPC UA: ${body}")
+						.to("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem2&namespaceUri=urn:org:apache:camel");
+			}
+		});
+
+		// start
+
+		context.start();
+
+		// sleep
+
+		while (true) {
+			Thread.sleep(Long.MAX_VALUE);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
new file mode 100644
index 0000000..9ec30ab
--- /dev/null
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/testing/Application2Server.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2016 Jens Reimann <jr...@redhat.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.milo.testing;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.milo.server.MiloServerComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+
+public class Application2Server {
+	public static void main(final String[] args) throws Exception {
+
+		// camel conext
+
+		final CamelContext context = new DefaultCamelContext();
+
+		// add paho
+
+		// no need to register, gets auto detected
+		// context.addComponent("paho", new PahoComponent());
+		((MiloServerComponent) context.getComponent("milo-server")).setUserAuthenticationCredentials("foo:bar");
+
+		// add routes
+
+		context.addRoutes(new RouteBuilder() {
+
+			@Override
+			public void configure() throws Exception {
+				/*
+				 * from(
+				 * "paho:javaonedemo/eclipse-greenhouse-9home/sensors/temperature?brokerUrl=tcp://iot.eclipse.org:1883")
+				 * .log("Temp update: ${body}").convertBodyTo(String.class).to(
+				 * "milo-server:MyItem");
+				 */
+
+				from("paho:my/foo/bar?brokerUrl=tcp://iot.eclipse.org:1883").log("Temp update: ${body}")
+						.convertBodyTo(String.class).to("milo-server:MyItem");
+
+				from("milo-server:MyItem").log("MyItem: ${body}");
+				from("milo-server:MyItem2").log("MyItem2: ${body}").convertBodyTo(String.class)
+						.to("paho:de/dentrassi/camel/milo/temperature?brokerUrl=tcp://iot.eclipse.org:1883");
+
+				from("paho:de/dentrassi/camel/milo/temperature?brokerUrl=tcp://iot.eclipse.org:1883")
+						.log("Back from MQTT: ${body}");
+			}
+		});
+
+		// start
+
+		context.start();
+
+		// sleep
+
+		while (true) {
+			Thread.sleep(Long.MAX_VALUE);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/resources/cert/Makefile
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/resources/cert/Makefile b/components/camel-milo/src/test/resources/cert/Makefile
new file mode 100644
index 0000000..b44c850
--- /dev/null
+++ b/components/camel-milo/src/test/resources/cert/Makefile
@@ -0,0 +1,16 @@
+.PHONY: clean all show
+
+all:
+	openssl req -batch -x509 -sha256 -nodes -days 36500 \
+		-subj '/C=XX/L=End of the universe/O=Milliways' \
+		-config cert.ini \
+		-newkey rsa:2048 -keyout privateKey.key -out certificate.crt
+	openssl pkcs12 -password pass:pwd1 -export -out cert.p12 -inkey privateKey.key -in certificate.crt
+	openssl x509 -outform der -in certificate.crt -out certificate.der
+
+show:
+	openssl x509 -in certificate.crt -text -noout
+
+clean:
+	@-rm privateKey.key certificate.crt cert.p12 certificate.der
+

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/resources/cert/cert.ini
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/resources/cert/cert.ini b/components/camel-milo/src/test/resources/cert/cert.ini
new file mode 100644
index 0000000..7eaaed2
--- /dev/null
+++ b/components/camel-milo/src/test/resources/cert/cert.ini
@@ -0,0 +1,13 @@
+[req]
+x509_extensions = v3_req
+distinguished_name = req_distinguished_name
+
+[req_distinguished_name]
+
+[v3_req]
+basicConstraints = CA:FALSE
+keyUsage = digitalSignature, keyEncipherment
+subjectAltName = @alt_names
+
+[alt_names]
+URI.1 = http://camel.apache.org/EclipseMilo/Client

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/resources/cert/cert.p12
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/resources/cert/cert.p12 b/components/camel-milo/src/test/resources/cert/cert.p12
new file mode 100644
index 0000000..8a2eed9
Binary files /dev/null and b/components/camel-milo/src/test/resources/cert/cert.p12 differ

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/resources/cert/certificate.crt
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/resources/cert/certificate.crt b/components/camel-milo/src/test/resources/cert/certificate.crt
new file mode 100644
index 0000000..8b7c784
--- /dev/null
+++ b/components/camel-milo/src/test/resources/cert/certificate.crt
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDVDCCAjygAwIBAgIJAKvxBeV3q1AsMA0GCSqGSIb3DQEBCwUAMD8xCzAJBgNV
+BAYTAlhYMRwwGgYDVQQHExNFbmQgb2YgdGhlIHVuaXZlcnNlMRIwEAYDVQQKEwlN
+aWxsaXdheXMwIBcNMTYwNzIxMTMyODAwWhgPMjExNjA2MjcxMzI4MDBaMD8xCzAJ
+BgNVBAYTAlhYMRwwGgYDVQQHExNFbmQgb2YgdGhlIHVuaXZlcnNlMRIwEAYDVQQK
+EwlNaWxsaXdheXMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDYISUG
+ggjH/3KuUHLjUvDWNomCDzMqTA4QrlK0cxt0VZq0DmzP1xEtAhXJ6eXVsBsfbvzW
+F/AK1otAP67wsGz52edbzchW0TVvKd3CAKBH8LFgycu7k6bYdc+0crgyxeM1NUmC
+x1nxbfTMWSC1CWOzjZXOVlqyUIHY8HJetPpJpS0GizAfa+eCHaRXOyC89dUX0cS8
+370NbcqfrYvbd8LOosHLYqJ/x7P7YIxOkw/wn5m2OAeSfItqfNCLbR2+oiCrLLv0
+MXQVCiiYfPLoEePFb288/AkgI/1go4Lsh6/vBnTU03r/YKM1QHVxygax3+I/9cXp
+wNmV8HyDNo5Lu98bAgMBAAGjUTBPMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgWgMDUG
+A1UdEQQuMCyGKmh0dHA6Ly9jYW1lbC5hcGFjaGUub3JnL0VjbGlwc2VNaWxvL0Ns
+aWVudDANBgkqhkiG9w0BAQsFAAOCAQEAWplx3EQyl69Xrn73v55sPa8mlBKMjjJ3
+FmloVkUoYO8k8xciPDRHSVaeKYwU3dO4NBwPnbo0JMZWEaYr9SsVWbLRsfqu3pGt
+ScHp7n1GB8gkstoX3cuqzVF0UQCkSsfUNXGCfQVQbQwJg8hBU77WTflDbcrGMbxf
+PgTkwOv8qfNjPawu4j05/9SKoauKoNVQ1nHS7D3tkzoPxh+0efOhrhOPXtB/C9yH
+QKIMFzsh0uLlzNZiMURjTZo/asZ9RdCplUzd3ciQDZk6QxW8DIrOfySUMuWU1UDa
+1/qA0w7xg+1azBRl3oiUwNxOmHHVeWqonhbvYlG+GG/MjQHcg62NHg==
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/resources/cert/certificate.der
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/resources/cert/certificate.der b/components/camel-milo/src/test/resources/cert/certificate.der
new file mode 100644
index 0000000..37abde7
Binary files /dev/null and b/components/camel-milo/src/test/resources/cert/certificate.der differ

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/resources/cert/privateKey.key
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/resources/cert/privateKey.key b/components/camel-milo/src/test/resources/cert/privateKey.key
new file mode 100644
index 0000000..5900120
--- /dev/null
+++ b/components/camel-milo/src/test/resources/cert/privateKey.key
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDYISUGggjH/3Ku
+UHLjUvDWNomCDzMqTA4QrlK0cxt0VZq0DmzP1xEtAhXJ6eXVsBsfbvzWF/AK1otA
+P67wsGz52edbzchW0TVvKd3CAKBH8LFgycu7k6bYdc+0crgyxeM1NUmCx1nxbfTM
+WSC1CWOzjZXOVlqyUIHY8HJetPpJpS0GizAfa+eCHaRXOyC89dUX0cS8370Nbcqf
+rYvbd8LOosHLYqJ/x7P7YIxOkw/wn5m2OAeSfItqfNCLbR2+oiCrLLv0MXQVCiiY
+fPLoEePFb288/AkgI/1go4Lsh6/vBnTU03r/YKM1QHVxygax3+I/9cXpwNmV8HyD
+No5Lu98bAgMBAAECggEBAJdMLJUvtmH7axan7qVATKRIrV5EsbasYzQ+NFtqMQ/x
+VUkyx+1/SuDNEt+0Q1ah33rTwV9Ghp2vru+dJSQM/VyytAlKNzK/Zb6Z+klzEsEJ
+t8JfwaVgKW5imrJhlJzGdtWqpflNAKPIK5RZ2FGjbw4k0XgOb5NgVGW/fPDblFK0
+ar1Yc/FLWOYFWFfNoZhni+ZH4U2KmEjZlkIL+d4KgewrjSPJ9w6XJijxMD5eDc5+
+r1ZfaSz5RNM/5LWokqLajCuxBxohRXldgF3Y3UtuQipeok1RPmQb0UcPSz7zndHF
+BV90c3o09v0/aqp2USlzCABIHO0l5Qru9m5wtvI+L/ECgYEA+TaweFBy6vGLa1jU
+hr8vaED880KNu6bIfHfmT580cG8ZXdz/+JHup+lERQmjuEX9Jc6QO2AUVsn1bZ8P
+oxs/4kNKL3cYZ/r66cBSSu0xihXsFAvDm4rrwSI5IAzOioMxBVs65sicpaceunHP
+l+c7Ma2cEUnlwYVuRAXhy1jjVhcCgYEA3gPR6q1lYgYsm8alOUzy/Eexp8PMbpgE
+t6c5eyT4Swau9XkNxp5R/tLCMvuZxwplZauChpE7O1TTiu88vrqRVVl4fZVkIlnx
+/xzzQFuAny/Qx+FOU18gNhFCRn4aAs5k+wdOncCIonz3IhMcusruseorBw57DLil
+TNlLZtQPZZ0CgYEAtUiEHDEhNyiX63GFv7MpUCQeHPJn2X4cTvaFEZxU8AjRIgdW
+KEI3oes8nx/A+ZXn7O2S264rfWqR3rkbDeIPmY6rU1XF6jWW+hzNf/WE2NbTkU1x
+cB8hGa/EcD0ArZ97NFNFyIVb9eBYqPWLNgudcqjAY48m05w1NsQ0mNBDJucCgYAP
+JWWRxAiRmmg6rF+jPBurmFyHXHU66kYQHWlvfEMwIyGWf46wCScA4nH7Nmz0RkJK
+oFvEQG4xCwVvigiz3liB4Ru2PZXaPhajV99EebmZopJ0wGsuhuPUrHLACmRN4rTC
+52m2m2b25t2ZRoKEP8nu+1G6JoPAh2xHhN9/AWKXhQKBgQDFmIUZwFmb3+oYgEN5
+QVmiwHgy9+AX+atZ76N3oajF42w3SFTLO9yQ5dlb9nBfwzpraZn2T9fAyiP0a9iU
+A9Y5MUFWlqMfgeOK/HEprcA7/Wth8ou3iu6Ojn85Iy2VqmqA4OYUYQTsS6izus4W
+Eel2uEuwhoIseSX1F0tqMlwxVg==
+-----END PRIVATE KEY-----

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/camel-milo/src/test/resources/log4j2.properties
----------------------------------------------------------------------
diff --git a/components/camel-milo/src/test/resources/log4j2.properties b/components/camel-milo/src/test/resources/log4j2.properties
new file mode 100644
index 0000000..eff03ed
--- /dev/null
+++ b/components/camel-milo/src/test/resources/log4j2.properties
@@ -0,0 +1,28 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = target/camel-milo-test.log
+appender.file.layout.type = PatternLayout
+appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.file.ref = file

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index cb19e97..429ee4e 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -189,6 +189,7 @@
     <module>camel-lzf</module>
     <module>camel-mail</module>
     <module>camel-metrics</module>
+    <module>camel-milo</module>
     <module>camel-mina</module>
     <module>camel-mina2</module>
     <module>camel-mllp</module>

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 43b8252..64d33ce 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -454,6 +454,7 @@
     <maven-war-plugin-version>3.0.0</maven-war-plugin-version>
     <mchange-commons-java-version>0.2.11</mchange-commons-java-version>
     <metrics-version>3.1.2</metrics-version>
+    <milo-version>0.1.0</milo-version>
     <mina-bundle-version>1.1.7_6</mina-bundle-version>
     <mina-version>1.1.7</mina-version>
     <mina2-version>2.0.16</mina2-version>

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/platforms/spring-boot/components-starter/camel-milo-starter/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/pom.xml b/platforms/spring-boot/components-starter/camel-milo-starter/pom.xml
new file mode 100644
index 0000000..07bba17
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/pom.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>components-starter</artifactId>
+    <version>2.19.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>camel-milo-starter</artifactId>
+  <packaging>jar</packaging>
+  <name>Spring-Boot Starter :: Camel :: Milo</name>
+  <description>Spring-Boot Starter for Camel OPC UA support</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter</artifactId>
+      <version>${spring-boot-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-milo</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <!--START OF GENERATED CODE-->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core-starter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-spring-boot-starter</artifactId>
+    </dependency>
+    <!--END OF GENERATED CODE-->
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/LICENSE.txt
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/LICENSE.txt b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/NOTICE.txt
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/NOTICE.txt b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+   =========================================================================
+   ==  NOTICE file corresponding to the section 4 d of                    ==
+   ==  the Apache License, Version 2.0,                                   ==
+   ==  in this case for the Apache Camel distribution.                    ==
+   =========================================================================
+
+   This product includes software developed by
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Please read the different LICENSE files present in the licenses directory of
+   this distribution.

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/spring.provides
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/spring.provides b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/spring.provides
new file mode 100644
index 0000000..b6a718b
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/resources/META-INF/spring.provides
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+provides: camel-milo
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7b3837fa/platforms/spring-boot/components-starter/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/pom.xml b/platforms/spring-boot/components-starter/pom.xml
index d757699..5ba6d82 100644
--- a/platforms/spring-boot/components-starter/pom.xml
+++ b/platforms/spring-boot/components-starter/pom.xml
@@ -207,6 +207,7 @@
     <module>camel-lzf-starter</module>
     <module>camel-mail-starter</module>
     <module>camel-metrics-starter</module>
+    <module>camel-milo-starter</module>
     <module>camel-mina2-starter</module>
     <module>camel-mllp-starter</module>
     <module>camel-mongodb-gridfs-starter</module>