/platforms/spring-boot/components-starter/camel-ssh-starter/src/main/java/org/apache/camel/component/ssh/springboot/SshComponentConfiguration.java

https://gitlab.com/matticala/apache-camel · Java · 401 lines · 195 code · 52 blank · 154 comment · 0 complexity · 9c4792ad35630cc2ab4bccf4d486afd0 MD5 · raw file

  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package org.apache.camel.component.ssh.springboot;
  18. import javax.annotation.Generated;
  19. import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
  20. import org.apache.sshd.common.keyprovider.KeyPairProvider;
  21. import org.springframework.boot.context.properties.ConfigurationProperties;
  22. import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
  23. import org.springframework.boot.context.properties.NestedConfigurationProperty;
  24. /**
  25. * The ssh component enables access to SSH servers such that you can send an SSH
  26. * command, and process the response.
  27. *
  28. * Generated by camel-package-maven-plugin - do not edit this file!
  29. */
  30. @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo")
  31. @ConfigurationProperties(prefix = "camel.component.ssh")
  32. public class SshComponentConfiguration
  33. extends
  34. ComponentConfigurationPropertiesCommon {
  35. /**
  36. * To use the shared SSH configuration
  37. */
  38. private SshConfigurationNestedConfiguration configuration;
  39. /**
  40. * Sets the hostname of the remote SSH server.
  41. */
  42. private String host;
  43. /**
  44. * Sets the port number for the remote SSH server.
  45. */
  46. private Integer port;
  47. /**
  48. * Sets the username to use in logging into the remote SSH server.
  49. */
  50. private String username;
  51. /**
  52. * Sets the password to use in connecting to remote SSH server. Requires
  53. * keyPairProvider to be set to null.
  54. */
  55. private String password;
  56. /**
  57. * Sets the command string to send to the remote SSH server during every
  58. * poll cycle. Only works with camel-ssh component being used as a consumer,
  59. * i.e. from(ssh://...). You may need to end your command with a newline,
  60. * and that must be URL encoded %0A
  61. */
  62. private String pollCommand;
  63. /**
  64. * Sets the KeyPairProvider reference to use when connecting using
  65. * Certificates to the remote SSH Server.
  66. */
  67. @NestedConfigurationProperty
  68. private KeyPairProvider keyPairProvider;
  69. /**
  70. * Sets the key type to pass to the KeyPairProvider as part of
  71. * authentication. KeyPairProvider.loadKey(...) will be passed this value.
  72. * Defaults to ssh-rsa.
  73. */
  74. private String keyType;
  75. /**
  76. * Sets the timeout in milliseconds to wait in establishing the remote SSH
  77. * server connection. Defaults to 30000 milliseconds.
  78. */
  79. private Long timeout;
  80. /**
  81. * Sets the resource path of the certificate to use for Authentication.
  82. */
  83. @Deprecated
  84. private String certFilename;
  85. /**
  86. * Sets the resource path of the certificate to use for Authentication. Will
  87. * use ResourceHelperKeyPairProvider to resolve file based certificate, and
  88. * depends on keyType setting.
  89. */
  90. private String certResource;
  91. /**
  92. * Whether the component should resolve property placeholders on itself when
  93. * starting. Only properties which are of String type can use property
  94. * placeholders.
  95. */
  96. private Boolean resolvePropertyPlaceholders = true;
  97. public SshConfigurationNestedConfiguration getConfiguration() {
  98. return configuration;
  99. }
  100. public void setConfiguration(
  101. SshConfigurationNestedConfiguration configuration) {
  102. this.configuration = configuration;
  103. }
  104. public String getHost() {
  105. return host;
  106. }
  107. public void setHost(String host) {
  108. this.host = host;
  109. }
  110. public Integer getPort() {
  111. return port;
  112. }
  113. public void setPort(Integer port) {
  114. this.port = port;
  115. }
  116. public String getUsername() {
  117. return username;
  118. }
  119. public void setUsername(String username) {
  120. this.username = username;
  121. }
  122. public String getPassword() {
  123. return password;
  124. }
  125. public void setPassword(String password) {
  126. this.password = password;
  127. }
  128. public String getPollCommand() {
  129. return pollCommand;
  130. }
  131. public void setPollCommand(String pollCommand) {
  132. this.pollCommand = pollCommand;
  133. }
  134. public KeyPairProvider getKeyPairProvider() {
  135. return keyPairProvider;
  136. }
  137. public void setKeyPairProvider(KeyPairProvider keyPairProvider) {
  138. this.keyPairProvider = keyPairProvider;
  139. }
  140. public String getKeyType() {
  141. return keyType;
  142. }
  143. public void setKeyType(String keyType) {
  144. this.keyType = keyType;
  145. }
  146. public Long getTimeout() {
  147. return timeout;
  148. }
  149. public void setTimeout(Long timeout) {
  150. this.timeout = timeout;
  151. }
  152. @Deprecated
  153. @DeprecatedConfigurationProperty
  154. public String getCertFilename() {
  155. return certFilename;
  156. }
  157. @Deprecated
  158. public void setCertFilename(String certFilename) {
  159. this.certFilename = certFilename;
  160. }
  161. public String getCertResource() {
  162. return certResource;
  163. }
  164. public void setCertResource(String certResource) {
  165. this.certResource = certResource;
  166. }
  167. public Boolean getResolvePropertyPlaceholders() {
  168. return resolvePropertyPlaceholders;
  169. }
  170. public void setResolvePropertyPlaceholders(
  171. Boolean resolvePropertyPlaceholders) {
  172. this.resolvePropertyPlaceholders = resolvePropertyPlaceholders;
  173. }
  174. public static class SshConfigurationNestedConfiguration {
  175. public static final Class CAMEL_NESTED_CLASS = org.apache.camel.component.ssh.SshConfiguration.class;
  176. /**
  177. * Sets the username to use in logging into the remote SSH server.
  178. *
  179. * @param usernameString
  180. * representing login username.
  181. */
  182. private String username;
  183. /**
  184. * Sets the hostname of the remote SSH server.
  185. *
  186. * @param hostString
  187. * representing hostname of SSH server.
  188. */
  189. private String host;
  190. /**
  191. * Sets the port number for the remote SSH server.
  192. *
  193. * @param portint
  194. * representing port number on remote host. Defaults to 22.
  195. */
  196. private Integer port = 22;
  197. /**
  198. * Sets the password to use in connecting to remote SSH server. Requires
  199. * keyPairProvider to be set to null.
  200. *
  201. * @param passwordString
  202. * representing password for username at remote host.
  203. */
  204. private String password;
  205. /**
  206. * Sets the command string to send to the remote SSH server during every
  207. * poll cycle. Only works with camel-ssh component being used as a
  208. * consumer, i.e. from("ssh://...") You may need to end your command
  209. * with a newline, and that must be URL encoded %0A
  210. *
  211. * @param pollCommandString
  212. * representing the command to send.
  213. */
  214. private String pollCommand;
  215. /**
  216. * Sets the KeyPairProvider reference to use when connecting using
  217. * Certificates to the remote SSH Server.
  218. *
  219. * @param keyPairProviderKeyPairProvider
  220. * reference to use in authenticating. If set to 'null', then
  221. * will attempt to connect using username/password settings.
  222. * @see KeyPairProvider
  223. */
  224. private KeyPairProvider keyPairProvider;
  225. /**
  226. * Sets the key type to pass to the KeyPairProvider as part of
  227. * authentication. KeyPairProvider.loadKey(...) will be passed this
  228. * value. Defaults to "ssh-rsa".
  229. *
  230. * @param keyTypeString
  231. * defining the type of KeyPair to use for authentication.
  232. * @see KeyPairProvider
  233. */
  234. private String keyType = "ssh-rsa";
  235. /**
  236. * Sets the timeout in milliseconds to wait in establishing the remote
  237. * SSH server connection. Defaults to 30000 milliseconds.
  238. *
  239. * @param timeoutlong
  240. * milliseconds to wait.
  241. */
  242. private Long timeout = 30000L;
  243. /**
  244. * @deprecated As of version 2.11, replaced by
  245. * {@link #setCertResource(String)}
  246. */
  247. @Deprecated
  248. private String certFilename;
  249. /**
  250. * Sets the resource path of the certificate to use for Authentication.
  251. * Will use {@link ResourceHelperKeyPairProvider} to resolve file based
  252. * certificate, and depends on keyType setting.
  253. *
  254. * @param certResourceString
  255. * file, classpath, or http url for the certificate
  256. */
  257. private String certResource;
  258. /**
  259. * Sets the resource path for a known_hosts file
  260. *
  261. * @param knownHostsString
  262. * file, classpath, or http url for the certificate
  263. */
  264. private String knownHostsResource;
  265. /**
  266. * Specifies whether a connection to an unknown host should fail or not.
  267. * This value is only checked when the property knownHosts is set.
  268. *
  269. * @param boolean boolean flag, whether a connection to an unknown host
  270. * should fail
  271. */
  272. private Boolean failOnUnknownHost = false;
  273. public String getUsername() {
  274. return username;
  275. }
  276. public void setUsername(String username) {
  277. this.username = username;
  278. }
  279. public String getHost() {
  280. return host;
  281. }
  282. public void setHost(String host) {
  283. this.host = host;
  284. }
  285. public Integer getPort() {
  286. return port;
  287. }
  288. public void setPort(Integer port) {
  289. this.port = port;
  290. }
  291. public String getPassword() {
  292. return password;
  293. }
  294. public void setPassword(String password) {
  295. this.password = password;
  296. }
  297. public String getPollCommand() {
  298. return pollCommand;
  299. }
  300. public void setPollCommand(String pollCommand) {
  301. this.pollCommand = pollCommand;
  302. }
  303. public KeyPairProvider getKeyPairProvider() {
  304. return keyPairProvider;
  305. }
  306. public void setKeyPairProvider(KeyPairProvider keyPairProvider) {
  307. this.keyPairProvider = keyPairProvider;
  308. }
  309. public String getKeyType() {
  310. return keyType;
  311. }
  312. public void setKeyType(String keyType) {
  313. this.keyType = keyType;
  314. }
  315. public Long getTimeout() {
  316. return timeout;
  317. }
  318. public void setTimeout(Long timeout) {
  319. this.timeout = timeout;
  320. }
  321. @Deprecated
  322. @DeprecatedConfigurationProperty
  323. public String getCertFilename() {
  324. return certFilename;
  325. }
  326. @Deprecated
  327. public void setCertFilename(String certFilename) {
  328. this.certFilename = certFilename;
  329. }
  330. public String getCertResource() {
  331. return certResource;
  332. }
  333. public void setCertResource(String certResource) {
  334. this.certResource = certResource;
  335. }
  336. public String getKnownHostsResource() {
  337. return knownHostsResource;
  338. }
  339. public void setKnownHostsResource(String knownHostsResource) {
  340. this.knownHostsResource = knownHostsResource;
  341. }
  342. public Boolean getFailOnUnknownHost() {
  343. return failOnUnknownHost;
  344. }
  345. public void setFailOnUnknownHost(Boolean failOnUnknownHost) {
  346. this.failOnUnknownHost = failOnUnknownHost;
  347. }
  348. }
  349. }