You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/04/27 10:13:12 UTC
[1/3] camel git commit: Component docs
Repository: camel
Updated Branches:
refs/heads/master dff401647 -> 4f0feb7a2
Component docs
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d5e4767a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d5e4767a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d5e4767a
Branch: refs/heads/master
Commit: d5e4767a7f0b1e352623674e4967ae97e11f5464
Parents: dff4016
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Apr 27 09:56:22 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Apr 27 09:56:22 2015 +0200
----------------------------------------------------------------------
.../component/stream/DefaultGroupStrategy.java | 4 +-
.../camel/component/stream/GroupStrategy.java | 3 +
.../camel/component/stream/StreamEndpoint.java | 79 ++++++++++++++++----
3 files changed, 70 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/d5e4767a/components/camel-stream/src/main/java/org/apache/camel/component/stream/DefaultGroupStrategy.java
----------------------------------------------------------------------
diff --git a/components/camel-stream/src/main/java/org/apache/camel/component/stream/DefaultGroupStrategy.java b/components/camel-stream/src/main/java/org/apache/camel/component/stream/DefaultGroupStrategy.java
index abf9c48..a2fb8bb 100644
--- a/components/camel-stream/src/main/java/org/apache/camel/component/stream/DefaultGroupStrategy.java
+++ b/components/camel-stream/src/main/java/org/apache/camel/component/stream/DefaultGroupStrategy.java
@@ -18,7 +18,9 @@ package org.apache.camel.component.stream;
import java.util.List;
-
+/**
+ * A default GroupStrategy that just group the lines by returning the lines as a list as-is
+ */
public class DefaultGroupStrategy implements GroupStrategy {
@Override
http://git-wip-us.apache.org/repos/asf/camel/blob/d5e4767a/components/camel-stream/src/main/java/org/apache/camel/component/stream/GroupStrategy.java
----------------------------------------------------------------------
diff --git a/components/camel-stream/src/main/java/org/apache/camel/component/stream/GroupStrategy.java b/components/camel-stream/src/main/java/org/apache/camel/component/stream/GroupStrategy.java
index 21096a7..502ddeb 100644
--- a/components/camel-stream/src/main/java/org/apache/camel/component/stream/GroupStrategy.java
+++ b/components/camel-stream/src/main/java/org/apache/camel/component/stream/GroupStrategy.java
@@ -18,6 +18,9 @@ package org.apache.camel.component.stream;
import java.util.List;
+/**
+ * Strategy to control how lines should be grouped together.
+ */
public interface GroupStrategy {
Object groupLines(List<String> lines);
http://git-wip-us.apache.org/repos/asf/camel/blob/d5e4767a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java
index a2c2d16..e1a19ff 100644
--- a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java
+++ b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java
@@ -35,35 +35,35 @@ import org.slf4j.LoggerFactory;
public class StreamEndpoint extends DefaultEndpoint {
private static final Logger LOG = LoggerFactory.getLogger(StreamEndpoint.class);
+ private transient Charset charset;
+
@UriPath @Metadata(required = "true")
private String url;
@UriParam
private String fileName;
- @UriParam
+ @UriParam(label = "consumer")
private boolean scanStream;
- @UriParam
+ @UriParam(label = "consumer")
private boolean retry;
- @UriParam
+ @UriParam(label = "producer")
private boolean closeOnDone;
- @UriParam
+ @UriParam(label = "consumer")
private long scanStreamDelay;
- @UriParam
+ @UriParam(label = "producer")
private long delay;
@UriParam
private String encoding;
- @UriParam
+ @UriParam(label = "consumer")
private String promptMessage;
- @UriParam
+ @UriParam(label = "consumer")
private long promptDelay;
- @UriParam(defaultValue = "2000")
+ @UriParam(label = "consumer", defaultValue = "2000")
private long initialPromptDelay = 2000;
- @UriParam
+ @UriParam(label = "consumer")
private int groupLines;
- @UriParam
+ @UriParam(label = "producer")
private int autoCloseCount;
- @UriParam
- private Charset charset;
- @UriParam
+ @UriParam(label = "consumer")
private GroupStrategy groupStrategy = new DefaultGroupStrategy();
public StreamEndpoint(String endpointUri, Component component) throws Exception {
@@ -104,6 +104,9 @@ public class StreamEndpoint extends DefaultEndpoint {
return fileName;
}
+ /**
+ * When using the stream:file URI format, this option specifies the filename to stream to/from.
+ */
public void setFileName(String fileName) {
this.fileName = fileName;
}
@@ -112,6 +115,10 @@ public class StreamEndpoint extends DefaultEndpoint {
return url;
}
+ /**
+ * When using the stream:url URI format, this option specifies the URL to stream to/from.
+ * The input/output stream will be opened using the JDK URLConnection facility.
+ */
public void setUrl(String url) {
this.url = url;
}
@@ -120,6 +127,9 @@ public class StreamEndpoint extends DefaultEndpoint {
return delay;
}
+ /**
+ * Initial delay in milliseconds before producing the stream.
+ */
public void setDelay(long delay) {
this.delay = delay;
}
@@ -128,6 +138,10 @@ public class StreamEndpoint extends DefaultEndpoint {
return encoding;
}
+ /**
+ * You can configure the encoding (is a charset name) to use text-based streams (for example, message body is a String object).
+ * If not provided, Camel uses the JVM default Charset.
+ */
public void setEncoding(String encoding) {
this.encoding = encoding;
}
@@ -136,6 +150,9 @@ public class StreamEndpoint extends DefaultEndpoint {
return promptMessage;
}
+ /**
+ * Message prompt to use when reading from stream:in; for example, you could set this to Enter a command:
+ */
public void setPromptMessage(String promptMessage) {
this.promptMessage = promptMessage;
}
@@ -144,6 +161,9 @@ public class StreamEndpoint extends DefaultEndpoint {
return promptDelay;
}
+ /**
+ * Optional delay in milliseconds before showing the message prompt.
+ */
public void setPromptDelay(long promptDelay) {
this.promptDelay = promptDelay;
}
@@ -152,6 +172,10 @@ public class StreamEndpoint extends DefaultEndpoint {
return initialPromptDelay;
}
+ /**
+ * Initial delay in milliseconds before showing the message prompt. This delay occurs only once.
+ * Can be used during system startup to avoid message prompts being written while other logging is done to the system out.
+ */
public void setInitialPromptDelay(long initialPromptDelay) {
this.initialPromptDelay = initialPromptDelay;
}
@@ -160,6 +184,9 @@ public class StreamEndpoint extends DefaultEndpoint {
return scanStream;
}
+ /**
+ * To be used for continuously reading a stream such as the unix tail command.
+ */
public void setScanStream(boolean scanStream) {
this.scanStream = scanStream;
}
@@ -167,7 +194,10 @@ public class StreamEndpoint extends DefaultEndpoint {
public GroupStrategy getGroupStrategy() {
return groupStrategy;
}
-
+
+ /**
+ * Allows to use a custom GroupStrategy to control how to group lines.
+ */
public void setGroupStrategy(GroupStrategy strategy) {
this.groupStrategy = strategy;
}
@@ -176,6 +206,9 @@ public class StreamEndpoint extends DefaultEndpoint {
return retry;
}
+ /**
+ * Will retry opening the file if it's overwritten, somewhat like tail --retry
+ */
public void setRetry(boolean retry) {
this.retry = retry;
}
@@ -183,7 +216,12 @@ public class StreamEndpoint extends DefaultEndpoint {
public boolean isCloseOnDone() {
return closeOnDone;
}
-
+
+ /**
+ * This option is used in combination with Splitter and streaming to the same file.
+ * The idea is to keep the stream open and only close when the Splitter is done, to improve performance.
+ * Mind this requires that you only stream to the same file, and not 2 or more files.
+ */
public void setCloseOnDone(boolean closeOnDone) {
this.closeOnDone = closeOnDone;
}
@@ -192,6 +230,9 @@ public class StreamEndpoint extends DefaultEndpoint {
return scanStreamDelay;
}
+ /**
+ * Delay in milliseconds between read attempts when using scanStream.
+ */
public void setScanStreamDelay(long scanStreamDelay) {
this.scanStreamDelay = scanStreamDelay;
}
@@ -200,6 +241,10 @@ public class StreamEndpoint extends DefaultEndpoint {
return groupLines;
}
+ /**
+ * To group X number of lines in the consumer.
+ * For example to group 10 lines and therefore only spit out an Exchange with 10 lines, instead of 1 Exchange per line.
+ */
public void setGroupLines(int groupLines) {
this.groupLines = groupLines;
}
@@ -208,6 +253,10 @@ public class StreamEndpoint extends DefaultEndpoint {
return autoCloseCount;
}
+ /**
+ * Number of messages to process before closing stream on Producer side.
+ * Never close stream by default (only when Producer is stopped). If more messages are sent, the stream is reopened for another autoCloseCount batch.
+ */
public void setAutoCloseCount(int autoCloseCount) {
this.autoCloseCount = autoCloseCount;
}
[2/3] camel git commit: Component docs
Posted by da...@apache.org.
Component docs
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/58f6776e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/58f6776e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/58f6776e
Branch: refs/heads/master
Commit: 58f6776e5c3fae400119269e73f327f061210bd1
Parents: d5e4767
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Apr 27 10:08:21 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Apr 27 10:08:21 2015 +0200
----------------------------------------------------------------------
.../component/printer/PrinterConfiguration.java | 55 +++++++++++++++++---
.../camel/component/stax/StAXEndpoint.java | 3 ++
2 files changed, 50 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/58f6776e/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterConfiguration.java b/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterConfiguration.java
index 48a0687..263f8dc 100644
--- a/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterConfiguration.java
+++ b/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterConfiguration.java
@@ -34,6 +34,10 @@ import org.apache.camel.util.URISupport;
@UriParams
public class PrinterConfiguration {
private URI uri;
+ private MediaSizeName mediaSizeName;
+ private Sides internalSides;
+ private OrientationRequested internalOrientation;
+
@UriPath @Metadata(required = "true")
private String hostname;
@UriPath @Metadata(required = "true")
@@ -52,16 +56,10 @@ public class PrinterConfiguration {
private String mimeType;
@UriParam(defaultValue = "na-letter")
private String mediaSize;
- @UriParam
- private MediaSizeName mediaSizeName;
- @UriParam(defaultValue = "one-sided")
+ @UriParam(defaultValue = "one-sided", enums = "one-sided,duplex,tumble,two-sided-short-edge,two-sided-long-edge")
private String sides;
- @UriParam
- private Sides internalSides;
- @UriParam(defaultValue = "portrait")
+ @UriParam(defaultValue = "portrait", enums = "portrait,landscape,reverse-portrait,reverse-landscape")
private String orientation;
- @UriParam
- private OrientationRequested internalOrientation;
@UriParam(defaultValue = "true")
private boolean sendToPrinter = true;
@UriParam
@@ -257,6 +255,9 @@ public class PrinterConfiguration {
return hostname;
}
+ /**
+ * Hostname of the printer
+ */
public void setHostname(String hostname) {
this.hostname = hostname;
}
@@ -265,6 +266,9 @@ public class PrinterConfiguration {
return port;
}
+ /**
+ * Port number of the printer
+ */
public void setPort(int port) {
this.port = port;
}
@@ -273,6 +277,9 @@ public class PrinterConfiguration {
return printername;
}
+ /**
+ * Name of the printer
+ */
public void setPrintername(String printername) {
this.printername = printername;
}
@@ -281,6 +288,9 @@ public class PrinterConfiguration {
return copies;
}
+ /**
+ * Number of copies to print
+ */
public void setCopies(int copies) {
this.copies = copies;
}
@@ -289,6 +299,9 @@ public class PrinterConfiguration {
return flavor;
}
+ /**
+ * Sets DocFlavor to use.
+ */
public void setFlavor(String flavor) {
this.flavor = flavor;
}
@@ -297,6 +310,9 @@ public class PrinterConfiguration {
return docFlavor;
}
+ /**
+ * Sets DocFlavor to use.
+ */
public void setDocFlavor(DocFlavor docFlavor) {
this.docFlavor = docFlavor;
}
@@ -305,6 +321,11 @@ public class PrinterConfiguration {
return mediaSize;
}
+ /**
+ * Sets the stationary as defined by enumeration names in the javax.print.attribute.standard.MediaSizeName API.
+ * The default setting is to use North American Letter sized stationary.
+ * The value's case is ignored, e.g. values of iso_a4 and ISO_A4 may be used.
+ */
public void setMediaSize(String mediaSize) {
this.mediaSize = mediaSize;
}
@@ -313,6 +334,9 @@ public class PrinterConfiguration {
return sides;
}
+ /**
+ * Sets one sided or two sided printing based on the javax.print.attribute.standard.Sides API
+ */
public void setSides(String sides) {
this.sides = sides;
}
@@ -345,6 +369,9 @@ public class PrinterConfiguration {
return orientation;
}
+ /**
+ * Sets the page orientation.
+ */
public void setOrientation(String orientation) {
this.orientation = orientation;
}
@@ -353,6 +380,9 @@ public class PrinterConfiguration {
return mimeType;
}
+ /**
+ * Sets mimeTypes supported by the javax.print.DocFlavor API
+ */
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
@@ -361,6 +391,9 @@ public class PrinterConfiguration {
return sendToPrinter;
}
+ /**
+ * etting this option to false prevents sending of the print data to the printer
+ */
public void setSendToPrinter(boolean sendToPrinter) {
this.sendToPrinter = sendToPrinter;
}
@@ -369,6 +402,9 @@ public class PrinterConfiguration {
return mediaTray;
}
+ /**
+ * Sets MediaTray supported by the javax.print.DocFlavor API, for example upper,middle etc.
+ */
public void setMediaTray(String mediaTray) {
this.mediaTray = mediaTray;
}
@@ -377,6 +413,9 @@ public class PrinterConfiguration {
return printerPrefix;
}
+ /**
+ * Sets the prefix name of the printer, it is useful when the printer name does not start with //hostname/printer
+ */
public void setPrinterPrefix(String printerPrefix) {
this.printerPrefix = printerPrefix;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/58f6776e/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXEndpoint.java b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXEndpoint.java
index c16dd1b..612afea 100644
--- a/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXEndpoint.java
+++ b/components/camel-stax/src/main/java/org/apache/camel/component/stax/StAXEndpoint.java
@@ -40,6 +40,9 @@ public class StAXEndpoint extends ProcessorEndpoint {
return contentHandlerClass;
}
+ /**
+ * The FQN class name for the ContentHandler implementation to use.
+ */
public void setContentHandlerClass(String contentHandlerClass) {
this.contentHandlerClass = contentHandlerClass;
}
[3/3] camel git commit: Component docs
Posted by da...@apache.org.
Component docs
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4f0feb7a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4f0feb7a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4f0feb7a
Branch: refs/heads/master
Commit: 4f0feb7a20d0473a26a925ae51f6d4411c7d8b84
Parents: 58f6776
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Apr 27 10:16:40 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Apr 27 10:16:40 2015 +0200
----------------------------------------------------------------------
.../camel/component/mvel/MvelEndpoint.java | 3 +++
.../sap/netweaver/NetWeaverEndpoint.java | 22 ++++++++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/4f0feb7a/components/camel-mvel/src/main/java/org/apache/camel/component/mvel/MvelEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-mvel/src/main/java/org/apache/camel/component/mvel/MvelEndpoint.java b/components/camel-mvel/src/main/java/org/apache/camel/component/mvel/MvelEndpoint.java
index 095c2df..d581862 100644
--- a/components/camel-mvel/src/main/java/org/apache/camel/component/mvel/MvelEndpoint.java
+++ b/components/camel-mvel/src/main/java/org/apache/camel/component/mvel/MvelEndpoint.java
@@ -65,6 +65,9 @@ public class MvelEndpoint extends ResourceEndpoint {
return encoding;
}
+ /**
+ * Character encoding of the resource content.
+ */
public void setEncoding(String encoding) {
this.encoding = encoding;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/4f0feb7a/components/camel-sap-netweaver/src/main/java/org/apache/camel/component/sap/netweaver/NetWeaverEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-sap-netweaver/src/main/java/org/apache/camel/component/sap/netweaver/NetWeaverEndpoint.java b/components/camel-sap-netweaver/src/main/java/org/apache/camel/component/sap/netweaver/NetWeaverEndpoint.java
index c7a5d19..0f16085 100644
--- a/components/camel-sap-netweaver/src/main/java/org/apache/camel/component/sap/netweaver/NetWeaverEndpoint.java
+++ b/components/camel-sap-netweaver/src/main/java/org/apache/camel/component/sap/netweaver/NetWeaverEndpoint.java
@@ -37,9 +37,9 @@ public class NetWeaverEndpoint extends DefaultEndpoint {
private boolean jsonAsMap = true;
@UriParam(defaultValue = "true")
private boolean flatternMap = true;
- @UriParam
+ @UriParam @Metadata(required = "true")
private String username;
- @UriParam
+ @UriParam @Metadata(required = "true")
private String password;
public NetWeaverEndpoint(String endpointUri, Component component) {
@@ -65,6 +65,9 @@ public class NetWeaverEndpoint extends DefaultEndpoint {
return url;
}
+ /**
+ * Url to the SAP net-weaver gateway server.
+ */
public void setUrl(String url) {
this.url = url;
}
@@ -73,6 +76,9 @@ public class NetWeaverEndpoint extends DefaultEndpoint {
return username;
}
+ /**
+ * Username for account.
+ */
public void setUsername(String username) {
this.username = username;
}
@@ -81,6 +87,9 @@ public class NetWeaverEndpoint extends DefaultEndpoint {
return password;
}
+ /**
+ * Password for account.
+ */
public void setPassword(String password) {
this.password = password;
}
@@ -89,6 +98,9 @@ public class NetWeaverEndpoint extends DefaultEndpoint {
return json;
}
+ /**
+ * Whether to return data in JSON format. If this option is false, then XML is returned in Atom format.
+ */
public void setJson(boolean json) {
this.json = json;
}
@@ -97,6 +109,9 @@ public class NetWeaverEndpoint extends DefaultEndpoint {
return jsonAsMap;
}
+ /**
+ * To transform the JSON from a String to a Map in the message body.
+ */
public void setJsonAsMap(boolean jsonAsMap) {
this.jsonAsMap = jsonAsMap;
}
@@ -105,6 +120,9 @@ public class NetWeaverEndpoint extends DefaultEndpoint {
return flatternMap;
}
+ /**
+ * If the JSON Map contains only a single entry, then flattern by storing that single entry value as the message body.
+ */
public void setFlatternMap(boolean flatternMap) {
this.flatternMap = flatternMap;
}