You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2017/01/11 12:04:18 UTC
[07/10] camel git commit: CAMEL-10638: Refactor ServiceCall EIP
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/model/remote/ConsulConfigurationDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/remote/ConsulConfigurationDefinition.java b/camel-core/src/main/java/org/apache/camel/model/remote/ConsulConfigurationDefinition.java
deleted file mode 100644
index 9cb8a16..0000000
--- a/camel-core/src/main/java/org/apache/camel/model/remote/ConsulConfigurationDefinition.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/**
- * 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.model.remote;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-
-import org.apache.camel.spi.Metadata;
-import org.apache.camel.util.jsse.SSLContextParameters;
-
-/**
- * Consul remote service call configuration
- */
-@Metadata(label = "eip,routing,remote")
-@XmlRootElement(name = "consulConfiguration")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class ConsulConfigurationDefinition extends ServiceCallConfigurationDefinition {
-
- @XmlAttribute
- private String url;
- @XmlAttribute
- private String dc;
- @XmlAttribute @Metadata(label = "security")
- private String aclToken;
- @XmlAttribute @Metadata(label = "security")
- private String userName;
- @XmlAttribute @Metadata(label = "security")
- private String password;
- @XmlAttribute
- private Long connectTimeoutMillis;
- @XmlAttribute
- private Long readTimeoutMillis;
- @XmlAttribute
- private Long writeTimeoutMillis;
- @XmlAttribute @Metadata(defaultValue = "10")
- private Integer blockSeconds = 10;
- @XmlTransient
- private SSLContextParameters sslContextParameters;
-
- public ConsulConfigurationDefinition() {
- }
-
- public ConsulConfigurationDefinition(ServiceCallDefinition parent) {
- super(parent);
- }
-
- // -------------------------------------------------------------------------
- // Getter/Setter
- // -------------------------------------------------------------------------
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public String getDc() {
- return dc;
- }
-
- public void setDc(String dc) {
- this.dc = dc;
- }
-
- public String getAclToken() {
- return aclToken;
- }
-
- public void setAclToken(String aclToken) {
- this.aclToken = aclToken;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public Long getConnectTimeoutMillis() {
- return connectTimeoutMillis;
- }
-
- public void setConnectTimeoutMillis(Long connectTimeoutMillis) {
- this.connectTimeoutMillis = connectTimeoutMillis;
- }
-
- public Long getReadTimeoutMillis() {
- return readTimeoutMillis;
- }
-
- public void setReadTimeoutMillis(Long readTimeoutMillis) {
- this.readTimeoutMillis = readTimeoutMillis;
- }
-
- public Long getWriteTimeoutMillis() {
- return writeTimeoutMillis;
- }
-
- public void setWriteTimeoutMillis(Long writeTimeoutMillis) {
- this.writeTimeoutMillis = writeTimeoutMillis;
- }
-
- public Integer getBlockSeconds() {
- return blockSeconds;
- }
-
- public void setBlockSeconds(Integer blockSeconds) {
- this.blockSeconds = blockSeconds;
- }
-
- public SSLContextParameters getSslContextParameters() {
- return sslContextParameters;
- }
-
- public void setSslContextParameters(SSLContextParameters sslContextParameters) {
- this.sslContextParameters = sslContextParameters;
- }
-
- // -------------------------------------------------------------------------
- // Fluent API
- // -------------------------------------------------------------------------
-
- /**
- * The Consul agent URL
- */
- public ConsulConfigurationDefinition url(String url) {
- setUrl(url);
- return this;
- }
-
- /**
- * The data center
- */
- public ConsulConfigurationDefinition dc(String dc) {
- setDc(dc);
- return this;
- }
-
- /**
- * Sets the ACL token to be used with Consul
- */
- public ConsulConfigurationDefinition aclToken(String aclToken) {
- setAclToken(aclToken);
- return this;
- }
-
- /**
- * Sets the username to be used for basic authentication
- */
- public ConsulConfigurationDefinition userName(String userName) {
- setUserName(userName);
- return this;
- }
-
- /**
- * Sets the password to be used for basic authentication
- */
- public ConsulConfigurationDefinition password(String password) {
- setPassword(password);
- return this;
- }
-
- /**
- * Connect timeout for OkHttpClient
- */
- public ConsulConfigurationDefinition connectTimeoutMillis(Long connectTimeoutMillis) {
- setConnectTimeoutMillis(connectTimeoutMillis);
- return this;
- }
-
- /**
- * Read timeout for OkHttpClient
- */
- public ConsulConfigurationDefinition readTimeoutMillis(Long readTimeoutMillis) {
- setReadTimeoutMillis(readTimeoutMillis);
- return this;
- }
-
- /**
- * Write timeout for OkHttpClient
- */
- public ConsulConfigurationDefinition writeTimeoutMillis(Long writeTimeoutMillis) {
- setWriteTimeoutMillis(writeTimeoutMillis);
- return this;
- }
-
- /**
- * The second to wait for a watch event, default 10 seconds
- */
- public ConsulConfigurationDefinition blockSeconds(Integer blockSeconds) {
- setBlockSeconds(blockSeconds);
- return this;
- }
-
- /**
- * To configure security using SSLContextParameters.
- */
- public ConsulConfigurationDefinition sslContextParameters(SSLContextParameters sslContextParameters) {
- setSslContextParameters(sslContextParameters);
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/model/remote/DnsConfigurationDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/remote/DnsConfigurationDefinition.java b/camel-core/src/main/java/org/apache/camel/model/remote/DnsConfigurationDefinition.java
deleted file mode 100644
index 7075ced..0000000
--- a/camel-core/src/main/java/org/apache/camel/model/remote/DnsConfigurationDefinition.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * 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.model.remote;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.apache.camel.spi.Metadata;
-
-/**
- * DNS remote service call configuration
- */
-@Metadata(label = "eip,routing,remote")
-@XmlRootElement(name = "dnsConfiguration")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class DnsConfigurationDefinition extends ServiceCallConfigurationDefinition {
-
- @XmlAttribute @Metadata(defaultValue = "_tcp")
- String proto = "_tcp";
-
- @XmlAttribute
- String domain;
-
- public DnsConfigurationDefinition() {
- }
-
- public DnsConfigurationDefinition(ServiceCallDefinition parent) {
- super(parent);
- }
-
- // -------------------------------------------------------------------------
- // Getter/Setter
- // -------------------------------------------------------------------------
-
- public String getProto() {
- return proto;
- }
-
- public void setProto(String proto) {
- this.proto = proto;
- }
-
- public String getDomain() {
- return domain;
- }
-
- public void setDomain(String domain) {
- this.domain = domain;
- }
-
- // -------------------------------------------------------------------------
- // Fluent API
- // -------------------------------------------------------------------------
-
- /**
- * The transport protocol of the desired service.
- */
- public DnsConfigurationDefinition proto(String proto) {
- setProto(proto);
- return this;
- }
-
- /**
- * The domain name;
- */
- public DnsConfigurationDefinition domain(String domain) {
- setDomain(domain);
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/model/remote/EtcdConfigurationDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/remote/EtcdConfigurationDefinition.java b/camel-core/src/main/java/org/apache/camel/model/remote/EtcdConfigurationDefinition.java
deleted file mode 100644
index c1fdc9d..0000000
--- a/camel-core/src/main/java/org/apache/camel/model/remote/EtcdConfigurationDefinition.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * 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.model.remote;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-
-import org.apache.camel.spi.Metadata;
-import org.apache.camel.util.jsse.SSLContextParameters;
-
-/**
- * Etcd remote service call configuration
- */
-@Metadata(label = "eip,routing,remote")
-@XmlRootElement(name = "etcdConfiguration")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class EtcdConfigurationDefinition extends ServiceCallConfigurationDefinition {
- @XmlAttribute
- private String uris;
- @XmlAttribute @Metadata(label = "security")
- private String userName;
- @XmlAttribute @Metadata(label = "security")
- private String password;
- @XmlAttribute
- private Long timeout;
- @XmlAttribute @Metadata(defaultValue = "/services/")
- private String servicePath = "/services/";
- @XmlTransient
- private SSLContextParameters sslContextParameters;
-
- public EtcdConfigurationDefinition() {
- }
-
- public EtcdConfigurationDefinition(ServiceCallDefinition parent) {
- super(parent);
- }
-
- // -------------------------------------------------------------------------
- // Getter/Setter
- // -------------------------------------------------------------------------
-
- public String getUris() {
- return uris;
- }
-
- public void setUris(String uris) {
- this.uris = uris;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public Long getTimeout() {
- return timeout;
- }
-
- public void setTimeout(Long timeout) {
- this.timeout = timeout;
- }
-
- public String getServicePath() {
- return servicePath;
- }
-
- public void setServicePath(String servicePath) {
- this.servicePath = servicePath;
- }
-
- public SSLContextParameters getSslContextParameters() {
- return sslContextParameters;
- }
-
- public void setSslContextParameters(SSLContextParameters sslContextParameters) {
- this.sslContextParameters = sslContextParameters;
- }
-
- // -------------------------------------------------------------------------
- // Fluent API
- // -------------------------------------------------------------------------
-
- /**
- * The URIs the client can connect to.
- */
- public EtcdConfigurationDefinition uris(String uris) {
- setUris(uris);
- return this;
- }
-
- /**
- * The user name to use for basic authentication.
- */
- public EtcdConfigurationDefinition userName(String userName) {
- setUserName(userName);
- return this;
- }
-
- /**
- * The password to use for basic authentication.
- */
- public EtcdConfigurationDefinition password(String password) {
- setPassword(password);
- return this;
- }
-
- /**
- * To set the maximum time an action could take to complete.
- */
- public EtcdConfigurationDefinition timeout(Long timeout) {
- setTimeout(timeout);
- return this;
- }
-
- /**
- * The path to look for for service discovery
- */
- public EtcdConfigurationDefinition servicePath(String servicePath) {
- setServicePath(servicePath);
- return this;
- }
-
- /**
- * To configure security using SSLContextParameters.
- */
- public EtcdConfigurationDefinition sslContextParameters(SSLContextParameters sslContextParameters) {
- setSslContextParameters(sslContextParameters);
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/model/remote/KubernetesConfigurationDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/remote/KubernetesConfigurationDefinition.java b/camel-core/src/main/java/org/apache/camel/model/remote/KubernetesConfigurationDefinition.java
deleted file mode 100644
index d4bd95a..0000000
--- a/camel-core/src/main/java/org/apache/camel/model/remote/KubernetesConfigurationDefinition.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/**
- * 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.model.remote;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.apache.camel.spi.Metadata;
-
-/**
- * Kubernetes remote service call configuration
- */
-@Metadata(label = "eip,routing,remote")
-@XmlRootElement(name = "kubernetesConfiguration")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class KubernetesConfigurationDefinition extends ServiceCallConfigurationDefinition {
-
- @XmlAttribute @Metadata(defaultValue = "environment")
- private String lookup;
- @XmlAttribute
- private String dnsDomain;
- @XmlAttribute
- private String namespace;
- @XmlAttribute
- private String apiVersion;
- @XmlAttribute @Metadata(label = "client")
- private String masterUrl;
- @XmlAttribute @Metadata(label = "client")
- private String username;
- @XmlAttribute @Metadata(label = "client")
- private String password;
- @XmlAttribute @Metadata(label = "client")
- private String oauthToken;
- @XmlAttribute @Metadata(label = "client")
- private String caCertData;
- @XmlAttribute @Metadata(label = "client")
- private String caCertFile;
- @XmlAttribute @Metadata(label = "client")
- private String clientCertData;
- @XmlAttribute @Metadata(label = "client")
- private String clientCertFile;
- @XmlAttribute @Metadata(label = "client")
- private String clientKeyAlgo;
- @XmlAttribute @Metadata(label = "client")
- private String clientKeyData;
- @XmlAttribute @Metadata(label = "client")
- private String clientKeyFile;
- @XmlAttribute @Metadata(label = "client")
- private String clientKeyPassphrase;
- @XmlAttribute @Metadata(label = "client")
- private Boolean trustCerts;
-
- public KubernetesConfigurationDefinition() {
- }
-
- public KubernetesConfigurationDefinition(ServiceCallDefinition parent) {
- super(parent);
- }
-
- // Getter/Setter
- // -------------------------------------------------------------------------
-
-
- public String getMasterUrl() {
- return masterUrl;
- }
-
- public void setMasterUrl(String masterUrl) {
- this.masterUrl = masterUrl;
- }
-
- public String getNamespace() {
- return namespace;
- }
-
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- public String getApiVersion() {
- return apiVersion;
- }
-
- public void setApiVersion(String apiVersion) {
- this.apiVersion = apiVersion;
- }
-
- public String getLookup() {
- return lookup;
- }
-
- public void setLookup(String lookup) {
- this.lookup = lookup;
- }
-
- public String getDnsDomain() {
- return dnsDomain;
- }
-
- public void setDnsDomain(String dnsDomain) {
- this.dnsDomain = dnsDomain;
- }
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getOauthToken() {
- return oauthToken;
- }
-
- public void setOauthToken(String oauthToken) {
- this.oauthToken = oauthToken;
- }
-
- public String getCaCertData() {
- return caCertData;
- }
-
- public void setCaCertData(String caCertData) {
- this.caCertData = caCertData;
- }
-
- public String getCaCertFile() {
- return caCertFile;
- }
-
- public void setCaCertFile(String caCertFile) {
- this.caCertFile = caCertFile;
- }
-
- public String getClientCertData() {
- return clientCertData;
- }
-
- public void setClientCertData(String clientCertData) {
- this.clientCertData = clientCertData;
- }
-
- public String getClientCertFile() {
- return clientCertFile;
- }
-
- public void setClientCertFile(String clientCertFile) {
- this.clientCertFile = clientCertFile;
- }
-
- public String getClientKeyAlgo() {
- return clientKeyAlgo;
- }
-
- public void setClientKeyAlgo(String clientKeyAlgo) {
- this.clientKeyAlgo = clientKeyAlgo;
- }
-
- public String getClientKeyData() {
- return clientKeyData;
- }
-
- public void setClientKeyData(String clientKeyData) {
- this.clientKeyData = clientKeyData;
- }
-
- public String getClientKeyFile() {
- return clientKeyFile;
- }
-
- public void setClientKeyFile(String clientKeyFile) {
- this.clientKeyFile = clientKeyFile;
- }
-
- public String getClientKeyPassphrase() {
- return clientKeyPassphrase;
- }
-
- public void setClientKeyPassphrase(String clientKeyPassphrase) {
- this.clientKeyPassphrase = clientKeyPassphrase;
- }
-
- public Boolean getTrustCerts() {
- return trustCerts;
- }
-
- public void setTrustCerts(Boolean trustCerts) {
- this.trustCerts = trustCerts;
- }
-
- // Fluent API
- // -------------------------------------------------------------------------
-
- /**
- * Sets the URL to the master when using client lookup
- */
- public KubernetesConfigurationDefinition masterUrl(String masterUrl) {
- setMasterUrl(masterUrl);
- return this;
- }
-
- /**
- * Sets the namespace to use. Will by default use namespace from the ENV variable KUBERNETES_MASTER.
- */
- public KubernetesConfigurationDefinition namespace(String namespace) {
- setNamespace(namespace);
- return this;
- }
-
- /**
- * Sets the API version when using client lookup
- */
- public KubernetesConfigurationDefinition apiVersion(String apiVersion) {
- setApiVersion(apiVersion);
- return this;
- }
-
- /**
- * How to perform service lookup. Possible values: client, dns, environment.
- * <p/>
- * When using client, then the client queries the kubernetes master to obtain a list
- * of active pods that provides the service, and then random (or round robin) select a pod.
- * <p/>
- * When using dns the service name is resolved as <tt>name.namespace.service.dnsDomain</tt>.
- * <p/>
- * When using environment then environment variables are used to lookup the service.
- * <p/>
- * By default environment is used.
- */
- public KubernetesConfigurationDefinition lookup(String lookup) {
- setLookup(lookup);
- return this;
- }
-
- /**
- * Sets the DNS domain to use for DNS lookup.
- */
- public KubernetesConfigurationDefinition dnsDomain(String dnsDomain) {
- setDnsDomain(dnsDomain);
- return this;
- }
-
- /**
- * Sets the username for authentication when using client lookup
- */
- public KubernetesConfigurationDefinition username(String username) {
- setUsername(username);
- return this;
- }
-
- /**
- * Sets the password for authentication when using client lookup
- */
- public KubernetesConfigurationDefinition password(String password) {
- setPassword(password);
- return this;
- }
-
- /**
- * Sets the OAUTH token for authentication (instead of username/password) when using client lookup
- */
- public KubernetesConfigurationDefinition oauthToken(String oauthToken) {
- setOauthToken(oauthToken);
- return this;
- }
-
- /**
- * Sets the Certificate Authority data when using client lookup
- */
- public KubernetesConfigurationDefinition caCertData(String caCertData) {
- setCaCertData(caCertData);
- return this;
- }
-
- /**
- * Sets the Certificate Authority data that are loaded from the file when using client lookup
- */
- public KubernetesConfigurationDefinition caCertFile(String caCertFile) {
- setCaCertFile(caCertFile);
- return this;
- }
-
- /**
- * Sets the Client Certificate data when using client lookup
- */
- public KubernetesConfigurationDefinition clientCertData(String clientCertData) {
- setClientCertData(clientCertData);
- return this;
- }
-
- /**
- * Sets the Client Certificate data that are loaded from the file when using client lookup
- */
- public KubernetesConfigurationDefinition clientCertFile(String clientCertFile) {
- setClientCertFile(clientCertFile);
- return this;
- }
-
- /**
- * Sets the Client Keystore algorithm, such as RSA when using client lookup
- */
- public KubernetesConfigurationDefinition clientKeyAlgo(String clientKeyAlgo) {
- setClientKeyAlgo(clientKeyAlgo);
- return this;
- }
-
- /**
- * Sets the Client Keystore data when using client lookup
- */
- public KubernetesConfigurationDefinition clientKeyData(String clientKeyData) {
- setClientKeyData(clientKeyData);
- return this;
- }
-
- /**
- * Sets the Client Keystore data that are loaded from the file when using client lookup
- */
- public KubernetesConfigurationDefinition clientKeyFile(String clientKeyFile) {
- setClientKeyFile(clientKeyFile);
- return this;
- }
-
- /**
- * Sets the Client Keystore passphrase when using client lookup
- */
- public KubernetesConfigurationDefinition clientKeyPassphrase(String clientKeyPassphrase) {
- setClientKeyPassphrase(clientKeyPassphrase);
- return this;
- }
-
- /**
- * Sets whether to turn on trust certificate check when using client lookup
- */
- public KubernetesConfigurationDefinition trustCerts(boolean trustCerts) {
- setTrustCerts(trustCerts);
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/model/remote/RibbonConfigurationDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/remote/RibbonConfigurationDefinition.java b/camel-core/src/main/java/org/apache/camel/model/remote/RibbonConfigurationDefinition.java
deleted file mode 100644
index a528538..0000000
--- a/camel-core/src/main/java/org/apache/camel/model/remote/RibbonConfigurationDefinition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * 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.model.remote;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.apache.camel.spi.Metadata;
-
-/**
- * Ribbon remote service call configuration
- */
-@Metadata(label = "eip,routing,remote")
-@XmlRootElement(name = "ribbonConfiguration")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class RibbonConfigurationDefinition extends ServiceCallConfigurationDefinition {
-
- public RibbonConfigurationDefinition() {
- }
-
- public RibbonConfigurationDefinition(ServiceCallDefinition parent) {
- super(parent);
- }
-
- // Getter/Setter
- // -------------------------------------------------------------------------
-
- // currently no ribbon specific options
-
- // Fluent API
- // -------------------------------------------------------------------------
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallConfigurationDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallConfigurationDefinition.java b/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallConfigurationDefinition.java
deleted file mode 100644
index 359bcdb..0000000
--- a/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallConfigurationDefinition.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/**
- * 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.model.remote;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.namespace.QName;
-
-import org.apache.camel.model.IdentifiedType;
-import org.apache.camel.model.OtherAttributesAware;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.PropertyDefinition;
-import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.ServiceCallLoadBalancer;
-import org.apache.camel.spi.ServiceCallServerListStrategy;
-
-/**
- * Remote service call configuration
- */
-@Metadata(label = "eip,routing,remote")
-@XmlRootElement(name = "serviceCallConfiguration")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class ServiceCallConfigurationDefinition extends IdentifiedType implements OtherAttributesAware {
-
- @XmlTransient
- private ServiceCallDefinition parent;
- @XmlAttribute @Metadata(defaultValue = "http")
- private String component;
- @XmlAttribute
- private String loadBalancerRef;
- @XmlTransient
- private ServiceCallLoadBalancer loadBalancer;
- @XmlAttribute
- private String serverListStrategyRef;
- @XmlTransient
- private ServiceCallServerListStrategy serverListStrategy;
- @XmlElement(name = "clientProperty") @Metadata(label = "advanced")
- private List<PropertyDefinition> properties;
- // use xs:any to support optional property placeholders
- @XmlAnyAttribute
- private Map<QName, Object> otherAttributes;
-
- public ServiceCallConfigurationDefinition() {
- }
-
- public ServiceCallConfigurationDefinition(ServiceCallDefinition parent) {
- this.parent = parent;
- }
-
- // Getter/Setter
- // -------------------------------------------------------------------------
-
-
- public String getComponent() {
- return component;
- }
-
- public void setComponent(String component) {
- this.component = component;
- }
-
- public String getLoadBalancerRef() {
- return loadBalancerRef;
- }
-
- /**
- * Sets a reference to a custom {@link org.apache.camel.spi.ServiceCallLoadBalancer} to use.
- */
- public void setLoadBalancerRef(String loadBalancerRef) {
- this.loadBalancerRef = loadBalancerRef;
- }
-
- public ServiceCallLoadBalancer getLoadBalancer() {
- return loadBalancer;
- }
-
- public void setLoadBalancer(ServiceCallLoadBalancer loadBalancer) {
- this.loadBalancer = loadBalancer;
- }
-
- public String getServerListStrategyRef() {
- return serverListStrategyRef;
- }
-
- /**
- * Sets a reference to a custom {@link org.apache.camel.spi.ServiceCallServerListStrategy} to use.
- */
- public void setServerListStrategyRef(String serverListStrategyRef) {
- this.serverListStrategyRef = serverListStrategyRef;
- }
-
- public ServiceCallServerListStrategy getServerListStrategy() {
- return serverListStrategy;
- }
-
- public void setServerListStrategy(ServiceCallServerListStrategy serverListStrategy) {
- this.serverListStrategy = serverListStrategy;
- }
-
- public List<PropertyDefinition> getProperties() {
- return properties;
- }
-
- /**
- * Set client properties to use.
- * <p/>
- * These properties are specific to what service call implementation are in
- * use. For example if using ribbon, then the client properties are define
- * in com.netflix.client.config.CommonClientConfigKey.
- */
- public void setProperties(List<PropertyDefinition> properties) {
- this.properties = properties;
- }
-
- @Override
- public Map<QName, Object> getOtherAttributes() {
- return otherAttributes;
- }
-
- @Override
- public void setOtherAttributes(Map<QName, Object> otherAttributes) {
- this.otherAttributes = otherAttributes;
- }
-
- // Fluent API
- // -------------------------------------------------------------------------
-
- /**
- * Sets the default Camel component to use for calling the remote service.
- * <p/>
- * By default the http component is used. You can configure this to use <tt>netty4-http</tt>, <tt>jetty</tt>,
- * <tt>restlet</tt> or some other components of choice. If the service is not HTTP protocol you can use other
- * components such as <tt>mqtt</tt>, <tt>jms</tt>, <tt>amqp</tt> etc.
- * <p/>
- * If the service call has been configured using an uri, then the component from the uri is used instead
- * of this default component.
- */
- public ServiceCallConfigurationDefinition component(String component) {
- setComponent(component);
- return this;
- }
-
- /**
- * Sets a reference to a custom {@link org.apache.camel.spi.ServiceCallLoadBalancer} to use.
- */
- public ServiceCallConfigurationDefinition loadBalancer(String loadBalancerRef) {
- setLoadBalancerRef(loadBalancerRef);
- return this;
- }
-
- /**
- * Sets a custom {@link org.apache.camel.spi.ServiceCallLoadBalancer} to use.
- */
- public ServiceCallConfigurationDefinition loadBalancer(ServiceCallLoadBalancer loadBalancer) {
- setLoadBalancer(loadBalancer);
- return this;
- }
-
- /**
- * Sets a reference to a custom {@link org.apache.camel.spi.ServiceCallServerListStrategy} to use.
- */
- public ServiceCallConfigurationDefinition serverListStrategy(String serverListStrategyRef) {
- setServerListStrategyRef(serverListStrategyRef);
- return this;
- }
-
- /**
- * Sets a custom {@link org.apache.camel.spi.ServiceCallServerListStrategy} to use.
- */
- public ServiceCallConfigurationDefinition serverListStrategy(ServiceCallServerListStrategy serverListStrategy) {
- setServerListStrategy(serverListStrategy);
- return this;
- }
-
- /**
- * Adds a custom client property to use.
- * <p/>
- * These properties are specific to what service call implementation are in use. For example if using ribbon, then
- * the client properties are define in com.netflix.client.config.CommonClientConfigKey.
- */
- public ServiceCallConfigurationDefinition clientProperty(String key, String value) {
- if (properties == null) {
- properties = new ArrayList<>();
- }
- PropertyDefinition prop = new PropertyDefinition();
- prop.setKey(key);
- prop.setValue(value);
- properties.add(prop);
- return this;
- }
-
- /**
- * End of configuration
- */
- public ProcessorDefinition end() {
- // end parent as well so we do not have to use 2x end
- return parent.end();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallDefinition.java b/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallDefinition.java
deleted file mode 100644
index d91aa5a..0000000
--- a/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallDefinition.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
- * 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.model.remote;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-
-import org.apache.camel.ExchangePattern;
-import org.apache.camel.Processor;
-import org.apache.camel.model.NoOutputDefinition;
-import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.RouteContext;
-import org.apache.camel.spi.ServiceCallLoadBalancer;
-import org.apache.camel.spi.ServiceCallServerListStrategy;
-
-/**
- * Remote service call
- */
-@Metadata(label = "eip,routing")
-@XmlRootElement(name = "serviceCall")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class ServiceCallDefinition extends NoOutputDefinition<ServiceCallDefinition> {
-
- @XmlAttribute @Metadata(required = "true")
- private String name;
- @XmlAttribute
- private String uri;
- @XmlAttribute
- private String component;
- @XmlAttribute
- private ExchangePattern pattern;
- @XmlElement
- private ServiceCallConfigurationDefinition serviceCallConfiguration;
- @XmlAttribute
- private String serviceCallConfigurationRef;
- @XmlAttribute
- private String loadBalancerRef;
- // TODO: allow to use custom type as load balancer
- @XmlTransient
- private ServiceCallLoadBalancer loadBalancer;
- @XmlAttribute
- private String serverListStrategyRef;
- @XmlTransient
- private ServiceCallServerListStrategy serverListStrategy;
-
- public ServiceCallDefinition() {
- }
-
- @Override
- public String toString() {
- return "ServiceCall[" + name + "]";
- }
-
- @Override
- public String getLabel() {
- return "serviceCall";
- }
-
- @Override
- public Processor createProcessor(RouteContext routeContext) throws Exception {
- throw new IllegalStateException("Cannot find Camel component supporting the ServiceCall EIP such as camel-kubernetes or camel-ribbon.");
- }
-
- // Fluent API
- // -------------------------------------------------------------------------
-
- /**
- * Sets the optional {@link ExchangePattern} used to invoke this endpoint
- */
- public ServiceCallDefinition pattern(ExchangePattern pattern) {
- setPattern(pattern);
- return this;
- }
-
- /**
- * Sets the name of the service to use
- */
- public ServiceCallDefinition name(String name) {
- setName(name);
- return this;
- }
-
- /**
- * Sets the uri of the service to use
- */
- public ServiceCallDefinition uri(String uri) {
- setUri(uri);
- return this;
- }
-
- /**
- * Sets the component to use
- */
- public ServiceCallDefinition component(String component) {
- setComponent(component);
- return this;
- }
-
- /**
- * Configures the Service Call EIP using Kubernetes
- * <p/>
- * Use <tt>end</tt> when configuration is complete, to return back to the Service Call EIP.
- */
- public KubernetesConfigurationDefinition kubernetesConfiguration() {
- serviceCallConfiguration = new KubernetesConfigurationDefinition(this);
- return (KubernetesConfigurationDefinition) serviceCallConfiguration;
- }
-
- /**
- * Configures the Service Call EIP using Ribbon
- * <p/>
- * Use <tt>end</tt> when configuration is complete, to return back to the Service Call EIP.
- */
- public RibbonConfigurationDefinition ribbonConfiguration() {
- serviceCallConfiguration = new RibbonConfigurationDefinition(this);
- return (RibbonConfigurationDefinition) serviceCallConfiguration;
- }
-
- /**
- * Configures the Service Call EIP using Consul
- * <p/>
- * Use <tt>end</tt> when configuration is complete, to return back to the Service Call EIP.
- */
- public ConsulConfigurationDefinition consulConfiguration() {
- serviceCallConfiguration = new ConsulConfigurationDefinition(this);
- return (ConsulConfigurationDefinition) serviceCallConfiguration;
- }
-
- /**
- * Configures the Service Call EIP using Etcd
- * <p/>
- * Use <tt>end</tt> when configuration is complete, to return back to the Service Call EIP.
- */
- public EtcdConfigurationDefinition etcdConfiguration() {
- serviceCallConfiguration = new EtcdConfigurationDefinition(this);
- return (EtcdConfigurationDefinition) serviceCallConfiguration;
- }
-
- /**
- * Configures the Service Call EIP using Dns
- * <p/>
- * Use <tt>end</tt> when configuration is complete, to return back to the Service Call EIP.
- */
- public DnsConfigurationDefinition dnsConfiguration() {
- serviceCallConfiguration = new DnsConfigurationDefinition(this);
- return (DnsConfigurationDefinition) serviceCallConfiguration;
- }
-
- /**
- * Configures the ServiceCall using the given configuration
- */
- public ServiceCallDefinition serviceCallConfiguration(ServiceCallConfigurationDefinition configuration) {
- serviceCallConfiguration = configuration;
- return this;
- }
-
- /**
- * Refers to a ServiceCall configuration to use
- */
- public ServiceCallDefinition serviceCallConfiguration(String ref) {
- serviceCallConfigurationRef = ref;
- return this;
- }
-
- /**
- * Sets a reference to a custom {@link org.apache.camel.spi.ServiceCallLoadBalancer} to use.
- */
- public ServiceCallDefinition loadBalancer(String loadBalancerRef) {
- setLoadBalancerRef(loadBalancerRef);
- return this;
- }
-
- /**
- * Sets a custom {@link org.apache.camel.spi.ServiceCallLoadBalancer} to use.
- */
- public ServiceCallDefinition loadBalancer(ServiceCallLoadBalancer loadBalancer) {
- setLoadBalancer(loadBalancer);
- return this;
- }
-
- /**
- * Sets a reference to a custom {@link org.apache.camel.spi.ServiceCallServerListStrategy} to use.
- */
- public ServiceCallDefinition serverListStrategy(String serverListStrategyRef) {
- setServerListStrategyRef(serverListStrategyRef);
- return this;
- }
-
- /**
- * Sets a custom {@link org.apache.camel.spi.ServiceCallServerListStrategy} to use.
- */
- public ServiceCallDefinition serverListStrategy(ServiceCallServerListStrategy serverListStrategy) {
- setServerListStrategy(serverListStrategy);
- return this;
- }
-
- // Properties
- // -------------------------------------------------------------------------
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public ExchangePattern getPattern() {
- return pattern;
- }
-
- public void setPattern(ExchangePattern pattern) {
- this.pattern = pattern;
- }
-
- public ServiceCallConfigurationDefinition getServiceCallConfiguration() {
- return serviceCallConfiguration;
- }
-
- public void setServiceCallConfiguration(ServiceCallConfigurationDefinition serviceCallConfiguration) {
- this.serviceCallConfiguration = serviceCallConfiguration;
- }
-
- public String getServiceCallConfigurationRef() {
- return serviceCallConfigurationRef;
- }
-
- /**
- * Refers to a ServiceCall configuration to use
- */
- public void setServiceCallConfigurationRef(String serviceCallConfigurationRef) {
- this.serviceCallConfigurationRef = serviceCallConfigurationRef;
- }
-
- public String getUri() {
- return uri;
- }
-
- /**
- * The uri of the endpoint to send to.
- * The uri can be dynamic computed using the {@link org.apache.camel.language.simple.SimpleLanguage} expression.
- */
- public void setUri(String uri) {
- this.uri = uri;
- }
-
- public String getComponent() {
- return component;
- }
-
- /**
- * The component to use.
- */
- public void setComponent(String component) {
- this.component = component;
- }
-
- public String getLoadBalancerRef() {
- return loadBalancerRef;
- }
-
- /**
- * Sets a reference to a custom {@link org.apache.camel.spi.ServiceCallLoadBalancer} to use.
- */
- public void setLoadBalancerRef(String loadBalancerRef) {
- this.loadBalancerRef = loadBalancerRef;
- }
-
- public ServiceCallLoadBalancer getLoadBalancer() {
- return loadBalancer;
- }
-
- public void setLoadBalancer(ServiceCallLoadBalancer loadBalancer) {
- this.loadBalancer = loadBalancer;
- }
-
- public String getServerListStrategyRef() {
- return serverListStrategyRef;
- }
-
- /**
- * Sets a reference to a custom {@link org.apache.camel.spi.ServiceCallServerListStrategy} to use.
- */
- public void setServerListStrategyRef(String serverListStrategyRef) {
- this.serverListStrategyRef = serverListStrategyRef;
- }
-
- public ServiceCallServerListStrategy getServerListStrategy() {
- return serverListStrategy;
- }
-
- public void setServerListStrategy(ServiceCallServerListStrategy serverListStrategy) {
- this.serverListStrategy = serverListStrategy;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallProcessorFactory.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallProcessorFactory.java b/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallProcessorFactory.java
deleted file mode 100644
index 8a07c8b..0000000
--- a/camel-core/src/main/java/org/apache/camel/model/remote/ServiceCallProcessorFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * 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.model.remote;
-
-import org.apache.camel.spi.ProcessorFactory;
-
-public interface ServiceCallProcessorFactory extends ProcessorFactory {
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/model/remote/package-info.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/remote/package-info.java b/camel-core/src/main/java/org/apache/camel/model/remote/package-info.java
deleted file mode 100644
index 5d6e89e..0000000
--- a/camel-core/src/main/java/org/apache/camel/model/remote/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * 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.
- */
-
-
-/**
- * The JAXB POJOs for the remote service call DSL
- */
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://camel.apache.org/schema/spring", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package org.apache.camel.model.remote;
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/spi/ServiceCallLoadBalancer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallLoadBalancer.java b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallLoadBalancer.java
index 1897171..fba9279 100644
--- a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallLoadBalancer.java
+++ b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallLoadBalancer.java
@@ -14,23 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.spi;
-import java.util.List;
+package org.apache.camel.spi;
/**
- * Allows SPIs to implement custom load balancing strategies for the Service Call EIP.
+ * Represents a load balancer for the Service Call EIP.
*
- * @see ServiceCallServerListStrategy
+ * @see ServiceCallServiceChooser
+ * @see ServiceCallServiceDiscovery
*/
-public interface ServiceCallLoadBalancer<T extends ServiceCallServer> {
-
- /**
- * Chooses one of the servers to use using the implemented strategy.
- *
- * @param servers list of servers
- * @return the chosen server to use.
- */
- T chooseServer(List<T> servers);
-
+@FunctionalInterface
+public interface ServiceCallLoadBalancer {
+ <T> T process(String serviceName, ServiceCallLoadBalancerRequest<T> request) throws Exception;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/spi/ServiceCallLoadBalancerRequest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallLoadBalancerRequest.java b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallLoadBalancerRequest.java
new file mode 100644
index 0000000..63c2920
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallLoadBalancerRequest.java
@@ -0,0 +1,29 @@
+/**
+ * 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.spi;
+
+/**
+ * Represents a load balancer for the Service Call EIP.
+ *
+ * @see ServiceCallServiceChooser
+ * @see ServiceCallServiceDiscovery
+ */
+@FunctionalInterface
+public interface ServiceCallLoadBalancerRequest<T> {
+ T process(ServiceCallService service) throws Exception;
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServer.java b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServer.java
deleted file mode 100644
index bf79482..0000000
--- a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * 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.spi;
-
-import java.util.Map;
-
-/**
- * Represents a server that host a service for the Service Call EIP.
- *
- * @see ServiceCallLoadBalancer
- * @see ServiceCallServerListStrategy
- */
-public interface ServiceCallServer {
- /**
- * Gets the IP or hostname of the server hosting the service
- */
- String getIp();
-
- /**
- * Gets the port number of the server hosting the service
- */
- int getPort();
-
- /**
- * Gets a key/value metadata associated with the service
- */
- Map<String, String> getMetadata();
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServerListStrategy.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServerListStrategy.java b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServerListStrategy.java
deleted file mode 100644
index 61bc4e3..0000000
--- a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServerListStrategy.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * 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.spi;
-
-import java.util.List;
-
-/**
- * Allows SPIs to implement custom server list strategies for the Service Call EIP.
- *
- * @see ServiceCallLoadBalancer
- * @see ServiceCallServer
- */
-public interface ServiceCallServerListStrategy<T extends ServiceCallServer> {
-
- /**
- * Gets the initial list of servers.
- * <p/>
- * This method may return <tt>null</tt> or an empty list.
- *
- * @param name the service name
- */
- List<T> getInitialListOfServers(String name);
-
- /**
- * Gets the updated list of servers.
- * <p/>
- * This method can either be called on-demand prior to a service call, or have
- * a background job that is scheduled to update the list, or a watcher
- * that triggers when the list of servers changes.
- *
- * @param name the service name
- */
- List<T> getUpdatedListOfServers(String name);
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/spi/ServiceCallService.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallService.java b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallService.java
new file mode 100644
index 0000000..1fdcdb5
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallService.java
@@ -0,0 +1,47 @@
+/**
+ * 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.spi;
+
+import java.util.Map;
+
+/**
+ * Represents a server that host a service for the Service Call EIP.
+ *
+ * @see ServiceCallServiceChooser
+ * @see ServiceCallServiceDiscovery
+ */
+public interface ServiceCallService {
+ /**
+ * Gets the service name.
+ */
+ String getName();
+
+ /**
+ * Gets the IP or hostname of the server hosting the service.
+ */
+ String getHost();
+
+ /**
+ * Gets the port number of the server hosting the service.
+ */
+ int getPort();
+
+ /**
+ * Gets a key/value metadata associated with the service.
+ */
+ Map<String, String> getMetadata();
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceChooser.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceChooser.java b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceChooser.java
new file mode 100644
index 0000000..f5d71e4
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceChooser.java
@@ -0,0 +1,35 @@
+/**
+ * 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.spi;
+
+import java.util.List;
+
+/**
+ * Allows SPIs to implement custom Service Chooser for the Service Call EIP.
+ *
+ * @see ServiceCallServiceDiscovery
+ */
+@FunctionalInterface
+public interface ServiceCallServiceChooser {
+ /**
+ * Chooses one of the service to use
+ *
+ * @param services list of services
+ * @return the chosen service to use.
+ */
+ ServiceCallService choose(List<ServiceCallService> services);
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceChooserAware.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceChooserAware.java b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceChooserAware.java
new file mode 100644
index 0000000..43c8c60
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceChooserAware.java
@@ -0,0 +1,37 @@
+/**
+ * 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.spi;
+
+/**
+ * An interface to represent an object which wishes to be injected with
+ * a {@link ServiceCallServiceChooser}
+ */
+public interface ServiceCallServiceChooserAware {
+ /**
+ * Injects the {@link ServiceCallServiceChooser}
+ *
+ * @param serviceChooser the ServiceCallServerChooser
+ */
+ void setServiceChooser(ServiceCallServiceChooser serviceChooser);
+
+ /**
+ * Get the {@link ServiceCallServiceChooser}
+ *
+ * @return the ServiceCallServerChooser
+ */
+ ServiceCallServiceChooser getServiceChooser();
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceDiscovery.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceDiscovery.java b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceDiscovery.java
new file mode 100644
index 0000000..7ca72be
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceDiscovery.java
@@ -0,0 +1,47 @@
+/**
+ * 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.spi;
+
+import java.util.List;
+
+/**
+ * Allows SPIs to implement custom Service Discovery for the Service Call EIP.
+ *
+ * @see ServiceCallServiceChooser
+ * @see ServiceCallService
+ */
+public interface ServiceCallServiceDiscovery {
+ /**
+ * Gets the initial list of services.
+ * <p/>
+ * This method may return <tt>null</tt> or an empty list.
+ *
+ * @param name the service name
+ */
+ List<ServiceCallService> getInitialListOfServices(String name);
+
+ /**
+ * Gets the updated list of services.
+ * <p/>
+ * This method can either be called on-demand prior to a service call, or have
+ * a background job that is scheduled to update the list, or a watcher
+ * that triggers when the list of services changes.
+ *
+ * @param name the service name
+ */
+ List<ServiceCallService> getUpdatedListOfServices(String name);
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceDiscoveryAware.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceDiscoveryAware.java b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceDiscoveryAware.java
new file mode 100644
index 0000000..5faa0ed
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/spi/ServiceCallServiceDiscoveryAware.java
@@ -0,0 +1,37 @@
+/**
+ * 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.spi;
+
+/**
+ * An interface to represent an object which wishes to be injected with
+ * a {@link ServiceCallServiceDiscovery}
+ */
+public interface ServiceCallServiceDiscoveryAware {
+ /**
+ * Injects the {@link ServiceCallServiceDiscovery}
+ *
+ * @param serviceDiscovery the ServiceCallServerDiscovery
+ */
+ void setServiceDiscovery(ServiceCallServiceDiscovery serviceDiscovery);
+
+ /**
+ * Get the {@link ServiceCallServiceDiscovery}
+ *
+ * @return the ServiceCallServerDiscovery
+ */
+ ServiceCallServiceDiscovery getServiceDiscovery();
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/java/org/apache/camel/support/ServiceCallExpressionSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/support/ServiceCallExpressionSupport.java b/camel-core/src/main/java/org/apache/camel/support/ServiceCallExpressionSupport.java
index 1351d31..e80e2a2 100644
--- a/camel-core/src/main/java/org/apache/camel/support/ServiceCallExpressionSupport.java
+++ b/camel-core/src/main/java/org/apache/camel/support/ServiceCallExpressionSupport.java
@@ -17,89 +17,53 @@
package org.apache.camel.support;
import org.apache.camel.Exchange;
-import org.apache.camel.model.remote.ServiceCallDefinition;
+import org.apache.camel.impl.cloud.ServiceCallConstants;
+import org.apache.camel.util.ExchangeHelper;
import org.apache.camel.util.ObjectHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-/**
- * Support class for custom implementations of {@link ServiceCallDefinition ServiceCall EIP} components.
- * <p/>
- * Below are some examples how to call a service and what Camel endpoint URI is constructed based on the input:
- * <pre>
- serviceCall("myService") -> http://hostname:port
- serviceCall("myService/foo") -> http://hostname:port/foo
- serviceCall("http:myService/foo") -> http:hostname:port/foo
- serviceCall("myService", "http:myService.host:myService.port/foo") -> http:hostname:port/foo
- serviceCall("myService", "netty4:tcp:myService?connectTimeout=1000") -> netty:tcp:hostname:port?connectTimeout=1000
- * </pre>
- */
public abstract class ServiceCallExpressionSupport extends ExpressionAdapter {
+ private String hostHeader;
+ private String portHeader;
- private static final Logger LOG = LoggerFactory.getLogger(ServiceCallExpressionSupport.class);
+ public ServiceCallExpressionSupport() {
+ this(ServiceCallConstants.SERVICE_HOST, ServiceCallConstants.SERVICE_PORT);
+ }
- private final String name;
- private final String scheme;
- private final String contextPath;
- private final String uri;
+ public ServiceCallExpressionSupport(String hostHeader, String portHeader) {
+ this.hostHeader = hostHeader;
+ this.portHeader = portHeader;
+ }
- public ServiceCallExpressionSupport(String name, String scheme, String contextPath, String uri) {
- this.name = name;
- this.scheme = scheme;
- this.contextPath = contextPath;
- this.uri = uri;
+ public String getHostHeader() {
+ return hostHeader;
}
- public abstract String getIp(Exchange exchange) throws Exception;
+ public void setHostHeader(String hostHeader) {
+ this.hostHeader = hostHeader;
+ }
- public abstract int getPort(Exchange exchange) throws Exception;
+ public String getPortHeader() {
+ return portHeader;
+ }
+
+ public void setPortHeader(String portHeader) {
+ this.portHeader = portHeader;
+ }
@Override
public Object evaluate(Exchange exchange) {
try {
- String ip = getIp(exchange);
- int port = getPort(exchange);
- return buildCamelEndpointUri(ip, port, name, uri, contextPath, scheme);
+ return buildCamelEndpointUri(
+ ExchangeHelper.getMandatoryHeader(exchange, ServiceCallConstants.SERVICE_NAME, String.class),
+ ExchangeHelper.getMandatoryHeader(exchange, hostHeader, String.class),
+ exchange.getIn().getHeader(portHeader, Integer.class),
+ exchange.getIn().getHeader(ServiceCallConstants.SERVICE_CALL_URI, String.class),
+ exchange.getIn().getHeader(ServiceCallConstants.SERVICE_CALL_CONTEXT_PATH, String.class),
+ exchange.getIn().getHeader(ServiceCallConstants.SERVICE_CALL_SCHEME, String.class));
} catch (Exception e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
}
- protected static String buildCamelEndpointUri(String ip, int port, String name, String uri, String contextPath, String scheme) {
- // build basic uri if none provided
- String answer = uri;
- if (answer == null) {
- if (scheme == null) {
- // use http/https by default if no scheme has been configured
- if (port == 443) {
- scheme = "https";
- } else {
- scheme = "http";
- }
- }
- answer = scheme + "://" + ip + ":" + port;
- if (contextPath != null) {
- if (!contextPath.startsWith("/")) {
- contextPath = "/" + contextPath;
- }
-
- answer += contextPath;
- }
- } else {
- // we have existing uri, then replace the serviceName with ip:port
- if (answer.contains(name + ".host")) {
- answer = answer.replaceFirst(name + "\\.host", ip);
- }
- if (answer.contains(name + ".port")) {
- answer = answer.replaceFirst(name + "\\.port", "" + port);
- }
- if (answer.contains(name)) {
- answer = answer.replaceFirst(name, ip + ":" + port);
- }
- }
-
- LOG.debug("Camel endpoint uri: {} for calling service: {} on server {}:{}", answer, name, ip, port);
- return answer;
- }
-
+ protected abstract String buildCamelEndpointUri(String name, String host, Integer port, String uri, String contextPath, String scheme);
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/static-service-discovery
----------------------------------------------------------------------
diff --git a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/static-service-discovery b/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/static-service-discovery
new file mode 100644
index 0000000..5d2f763
--- /dev/null
+++ b/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/static-service-discovery
@@ -0,0 +1,17 @@
+#
+# 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.
+#
+class=org.apache.camel.impl.cloud.StaticServiceDiscoveryFactory
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/resources/org/apache/camel/model/cloud/jaxb.index
----------------------------------------------------------------------
diff --git a/camel-core/src/main/resources/org/apache/camel/model/cloud/jaxb.index b/camel-core/src/main/resources/org/apache/camel/model/cloud/jaxb.index
new file mode 100644
index 0000000..e57f7e8
--- /dev/null
+++ b/camel-core/src/main/resources/org/apache/camel/model/cloud/jaxb.index
@@ -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.
+## ------------------------------------------------------------------------
+ServiceCallDefinition
+ServiceCallConfigurationDefinition
+ServiceCallServiceDiscoveryConfiguration
+ServiceCallServiceFilterConfiguration
+ServiceCallServiceChooserConfiguration
+ServiceCallLoadBalancerConfiguration
+ConsulServiceCallServiceDiscoveryConfiguration
+DnsServiceCallServiceDiscoveryConfiguration
+EtcdServiceCallServiceDiscoveryConfiguration
+KubernetesServiceCallServiceDiscoveryConfiguration
+StaticServiceCallServiceDiscoveryConfiguration
+RibbonServiceCallLoadBalancerConfiguration
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/main/resources/org/apache/camel/model/remote/jaxb.index
----------------------------------------------------------------------
diff --git a/camel-core/src/main/resources/org/apache/camel/model/remote/jaxb.index b/camel-core/src/main/resources/org/apache/camel/model/remote/jaxb.index
deleted file mode 100644
index 0b919fe..0000000
--- a/camel-core/src/main/resources/org/apache/camel/model/remote/jaxb.index
+++ /dev/null
@@ -1,23 +0,0 @@
-## ------------------------------------------------------------------------
-## 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.
-## ------------------------------------------------------------------------
-ConsulConfigurationDefinition
-DnsConfigurationDefinition
-EtcdConfigurationDefinition
-KubernetesConfigurationDefinition
-RibbonConfigurationDefinition
-ServiceCallDefinition
-ServiceCallConfigurationDefinition
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/test/java/org/apache/camel/impl/cloud/CachingServiceCallServiceListStrategyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/cloud/CachingServiceCallServiceListStrategyTest.java b/camel-core/src/test/java/org/apache/camel/impl/cloud/CachingServiceCallServiceListStrategyTest.java
new file mode 100644
index 0000000..f17c000
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/impl/cloud/CachingServiceCallServiceListStrategyTest.java
@@ -0,0 +1,56 @@
+/**
+ * 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.impl.cloud;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.cloud.ServiceDefinition;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class CachingServiceCallServiceListStrategyTest {
+ @Test
+ public void testCachingServiceDiscovery() throws Exception {
+ MyStrategy strategy = new MyStrategy();
+ CachingServiceDiscovery caching = CachingServiceDiscovery.wrap(strategy, 1, TimeUnit.SECONDS);
+
+ strategy.addServer(new DefaultServiceDefinition("noname", "localhost", 1111));
+ Assert.assertEquals(1, caching.getUpdatedListOfServices("noname").size());
+ strategy.addServer(new DefaultServiceDefinition("noname", "localhost", 1112));
+ Assert.assertEquals(1, caching.getUpdatedListOfServices("noname").size());
+
+ // Let the cache expire
+ Thread.sleep(1100);
+
+ Assert.assertEquals(2, caching.getUpdatedListOfServices("noname").size());
+ }
+
+ private class MyStrategy extends DefaultServiceDiscovery {
+ private List<ServiceDefinition> services = new ArrayList<>();
+
+ @Override
+ public List<ServiceDefinition> getUpdatedListOfServices(String name) {
+ return services;
+ }
+
+ public void addServer(ServiceDefinition service) {
+ services.add(service);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/camel-core/src/test/java/org/apache/camel/impl/remote/CachingServiceCallServiceListStrategyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/remote/CachingServiceCallServiceListStrategyTest.java b/camel-core/src/test/java/org/apache/camel/impl/remote/CachingServiceCallServiceListStrategyTest.java
deleted file mode 100644
index 0194c67..0000000
--- a/camel-core/src/test/java/org/apache/camel/impl/remote/CachingServiceCallServiceListStrategyTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * 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.impl.remote;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class CachingServiceCallServiceListStrategyTest {
-
- @Test
- public void testCachingServiceList() throws Exception {
- MyStrategy strategy = new MyStrategy();
- CachingServiceCallServiceListStrategy<DefaultServiceCallServer> caching = CachingServiceCallServiceListStrategy.wrap(strategy, 1, TimeUnit.SECONDS);
-
- strategy.addServer(new DefaultServiceCallServer("localhost", 1111));
- Assert.assertEquals(1, caching.getUpdatedListOfServers("noname").size());
- strategy.addServer(new DefaultServiceCallServer("localhost", 1112));
- Assert.assertEquals(1, caching.getUpdatedListOfServers("noname").size());
-
- // Let the cache expire
- Thread.sleep(1100);
-
- Assert.assertEquals(2, caching.getUpdatedListOfServers("noname").size());
- }
-
- private class MyStrategy extends DefaultServiceCallServerListStrategy<DefaultServiceCallServer> {
- private List<DefaultServiceCallServer> servers = new ArrayList<>();
-
- @Override
- public List<DefaultServiceCallServer> getUpdatedListOfServers(String name) {
- return servers;
- }
-
- public void addServer(DefaultServiceCallServer server) {
- servers.add(server);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/a811f400/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintModelJAXBContextFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintModelJAXBContextFactory.java b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintModelJAXBContextFactory.java
index dac0952..e366f35 100644
--- a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintModelJAXBContextFactory.java
+++ b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintModelJAXBContextFactory.java
@@ -47,6 +47,7 @@ public class BlueprintModelJAXBContextFactory implements ModelJAXBContextFactory
classes.add(org.apache.camel.model.language.ExpressionDefinition.class);
classes.add(org.apache.camel.model.loadbalancer.RoundRobinLoadBalancerDefinition.class);
classes.add(org.apache.camel.model.rest.RestDefinition.class);
+ classes.add(org.apache.camel.model.cloud.ServiceCallDefinition.class);
StringBuilder packages = new StringBuilder();
for (Class<?> cl : classes) {