svn commit: r937984 - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache jdbc.html
Author: buildbot Date: Wed Jan 28 10:20:18 2015 New Revision: 937984 Log: Production update by buildbot for camel Modified: websites/production/camel/content/book-component-appendix.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/jdbc.html Modified: websites/production/camel/content/book-component-appendix.html == --- websites/production/camel/content/book-component-appendix.html (original) +++ websites/production/camel/content/book-component-appendix.html Wed Jan 28 10:20:18 2015 @@ -1360,11 +1360,11 @@ template.send(quot;direct:alias-verify /div /div pThe strongcxf:/strong component provides integration with a shape=rect href=http://cxf.apache.org;Apache CXF/a for connecting to JAX-WS services hosted in CXF./ppstyle type=text/css/*![CDATA[*/ -div.rbtoc1422429437382 {padding: 0px;} -div.rbtoc1422429437382 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1422429437382 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1422440314485 {padding: 0px;} +div.rbtoc1422440314485 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1422440314485 li {margin-left: 0px;padding-left: 0px;} -/*]]*//style/pdiv class=toc-macro rbtoc1422429437382 +/*]]*//style/pdiv class=toc-macro rbtoc1422440314485 ul class=toc-indentationlia shape=rect href=#CXF-CXFComponentCXF Component/a ul class=toc-indentationlia shape=rect href=#CXF-URIformatURI format/a/lilia shape=rect href=#CXF-OptionsOptions/a ul class=toc-indentationlia shape=rect href=#CXF-ThedescriptionsofthedataformatsThe descriptions of the dataformats/a @@ -5658,7 +5658,7 @@ We store big input streams (by default, h3 id=BookComponentAppendix-URIformat.32URI format/h3div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: java; gutter: false type=syntaxhighlighter![CDATA[jdbc:dataSourceName[?options] ]]/script -/div/divpThis component only supports producer endpoints./ppYou can append query options to the URI in the following format, code?option=valueamp;option=valueamp;.../code/ph3 id=BookComponentAppendix-Options.25Options/h3div class=confluenceTableSmalldiv class=table-wraptable class=confluenceTabletbodytrth colspan=1 rowspan=1 class=confluenceThpName/p/thth colspan=1 rowspan=1 class=confluenceThpDefault Value/p/thth colspan=1 rowspan=1 class=confluenceThpDescription/p/th/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodereadSize/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcode0/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpThe default maximum number of rows that can be read by a polling query. The default value is 0./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodestatement.lt;xxxgt;/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodenull/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpstrongCamel 2.1:/strong Sets additional options on the codejava.sql.Statement/code that is used behind the scenes to execute the queries. For instance, codestatement.maxRows=10/code. For detailed documentation, see the a shape=rect class=external-link href=http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Statement.html; rel=nofollowcodejava.sql.Statement/code javadoc/a documentation./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeuseJDBC4ColumnNameAndLabelSemantics/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodetrue/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpstrongCamel 2.2:/strong Sets whether to use JDBC 4/3 column label/name semantics. You can use this option to turn it codefalse/code in case you have issues with your JDBC driver to select data. This only a pplies when using codeSQL SELECT/code using aliases (e.g. codeSQL SELECT id as identifier, name as given_name from persons/code)./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcoderesetAutoCommit/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodetrue/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpstrongCamel 2.9:/strong Camel will set the autoCommit on the JDBC connection to be false, commit the change after executed the statement and reset the autoCommit flag of the connection at the end, if the resetAutoCommit is true. If the JDBC connection doesn't support to reset the autoCommit flag, you can set the resetAutoCommit flag to be false, and Camel will not try to reset the autoCommit flag./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeallowNamedParameters/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodetrue/code/p/tdtd colspan=1 rowspan=1 c lass=confluenceTdpstrongCamel 2.12:/strong Whether to allow using named parameters in the queries./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeprepareStatementStrategy/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdp#160;/p/tdtd colspan=1 rowspan=1
camel git commit: CAMEL-8278: Camel toolbox - more details about the eips
Repository: camel Updated Branches: refs/heads/master 1e9ab5446 - 223fa08c3 CAMEL-8278: Camel toolbox - more details about the eips Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/223fa08c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/223fa08c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/223fa08c Branch: refs/heads/master Commit: 223fa08c3f7f71f503b0320e1966fef73a67ce16 Parents: 1e9ab54 Author: Claus Ibsen davscl...@apache.org Authored: Sat Jan 24 10:52:54 2015 +0100 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Jan 28 10:32:34 2015 +0100 -- .../dataformat/UniVocityTsvDataFormat.java | 2 - .../camel/tools/apt/CollectionStringBuffer.java | 1 - .../camel/tools/apt/EipAnnotationProcessor.java | 63 +++- 3 files changed, 62 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/223fa08c/camel-core/src/main/java/org/apache/camel/model/dataformat/UniVocityTsvDataFormat.java -- diff --git a/camel-core/src/main/java/org/apache/camel/model/dataformat/UniVocityTsvDataFormat.java b/camel-core/src/main/java/org/apache/camel/model/dataformat/UniVocityTsvDataFormat.java index 52ed41d..b058f1e 100644 --- a/camel-core/src/main/java/org/apache/camel/model/dataformat/UniVocityTsvDataFormat.java +++ b/camel-core/src/main/java/org/apache/camel/model/dataformat/UniVocityTsvDataFormat.java @@ -45,8 +45,6 @@ public class UniVocityTsvDataFormat extends UniVocityAbstractDataFormat { /** * The escape character. - * p/ - * The default value is \ */ public void setEscapeChar(String escapeChar) { this.escapeChar = escapeChar; http://git-wip-us.apache.org/repos/asf/camel/blob/223fa08c/tooling/apt/src/main/java/org/apache/camel/tools/apt/CollectionStringBuffer.java -- diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/CollectionStringBuffer.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/CollectionStringBuffer.java index 50f846f..21daf95 100644 --- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/CollectionStringBuffer.java +++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/CollectionStringBuffer.java @@ -17,7 +17,6 @@ package org.apache.camel.tools.apt; /** - /** * A little helper class for converting a collection of values to a (usually comma separated) string. */ class CollectionStringBuffer { http://git-wip-us.apache.org/repos/asf/camel/blob/223fa08c/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java -- diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java index 6b98ac0..92a6993 100644 --- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java +++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java @@ -58,6 +58,11 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { // special when using expression/predicates in the model private static final String ONE_OF_TYPE_NAME = org.apache.camel.model.ExpressionSubElementDefinition; private static final String ONE_OF_LANGUAGES = org.apache.camel.model.language.ExpressionDefinition; +// special for inputs (these classes have sub classes, so we use this to find all classes) +private static final String[] ONE_OF_INPUTS = new String[]{ +org.apache.camel.model.ProcessorDefinition, +org.apache.camel.model.VerbDefinition +}; // special for outputs (these classes have sub classes, so we use this to find all classes) private static final String[] ONE_OF_OUTPUTS = new String[]{ org.apache.camel.model.ProcessorDefinition, @@ -147,6 +152,10 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { SetEipOption eipOptions = new LinkedHashSetEipOption(); findClassProperties(writer, roundEnv, eipOptions, classElement, classElement, ); +// after we have found all the options then figure out if the model accepts input/output +eipModel.setInput(hasInput(roundEnv, classElement)); +eipModel.setOutput(hasOutput(eipModel, eipOptions)); + String json = createParameterJsonSchema(eipModel, eipOptions); writer.println(json); } @@ -160,7 +169,9 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { buffer.append(\n\title\: \).append(asTitle(eipModel.getName())).append(\,);
camel git commit: CAMEL-7999: Camel model should include documentation and corrected default values
Repository: camel Updated Branches: refs/heads/master cac784543 - 90b224e86 CAMEL-7999: Camel model should include documentation and corrected default values Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/90b224e8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/90b224e8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/90b224e8 Branch: refs/heads/master Commit: 90b224e8672be3391941dad6193b341bd1721f55 Parents: cac7845 Author: Claus Ibsen davscl...@apache.org Authored: Wed Jan 28 10:14:27 2015 +0100 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Jan 28 10:14:27 2015 +0100 -- .../main/java/org/apache/camel/model/AggregateDefinition.java | 2 +- .../apache/camel/model/dataformat/UniVocityCsvDataFormat.java | 4 ++-- .../org/apache/camel/model/language/ExpressionDefinition.java | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/90b224e8/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java -- diff --git a/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java b/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java index 6270461..7313c12 100644 --- a/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java +++ b/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java @@ -86,7 +86,7 @@ public class AggregateDefinition extends ProcessorDefinitionAggregateDefinition private String timeoutCheckerExecutorServiceRef; @XmlAttribute private String aggregationRepositoryRef; -@XmlAttribute +@XmlAttribute(required = true) private String strategyRef; @XmlAttribute private String strategyMethodName; http://git-wip-us.apache.org/repos/asf/camel/blob/90b224e8/camel-core/src/main/java/org/apache/camel/model/dataformat/UniVocityCsvDataFormat.java -- diff --git a/camel-core/src/main/java/org/apache/camel/model/dataformat/UniVocityCsvDataFormat.java b/camel-core/src/main/java/org/apache/camel/model/dataformat/UniVocityCsvDataFormat.java index a549114..511f7fd 100644 --- a/camel-core/src/main/java/org/apache/camel/model/dataformat/UniVocityCsvDataFormat.java +++ b/camel-core/src/main/java/org/apache/camel/model/dataformat/UniVocityCsvDataFormat.java @@ -34,9 +34,9 @@ import org.apache.camel.spi.Metadata; public class UniVocityCsvDataFormat extends UniVocityAbstractDataFormat { @XmlAttribute protected Boolean quoteAllFields; -@XmlAttribute @Metadata(defaultValue = '') +@XmlAttribute @Metadata(defaultValue = \) protected String quote; -@XmlAttribute @Metadata(defaultValue = '') +@XmlAttribute @Metadata(defaultValue = \) protected String quoteEscape; @XmlAttribute @Metadata(defaultValue = ,) protected String delimiter; http://git-wip-us.apache.org/repos/asf/camel/blob/90b224e8/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java -- diff --git a/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java b/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java index aeb40ac..2a78904 100644 --- a/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java +++ b/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java @@ -43,8 +43,6 @@ import org.apache.camel.util.ObjectHelper; /** * A useful base class for an expression - * - * @version */ @Metadata(label = language) @XmlRootElement @@ -196,6 +194,9 @@ public class ExpressionDefinition implements Expression, Predicate { return expression; } +/** + * The expression value in your chosen language syntax + */ @Required public void setExpression(String expression) { this.expression = expression;
camel git commit: CAMEL-7999: apt plugin fixed default value to be json safe
Repository: camel Updated Branches: refs/heads/master 223fa08c3 - 44f82cbf0 CAMEL-7999: apt plugin fixed default value to be json safe Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/44f82cbf Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/44f82cbf Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/44f82cbf Branch: refs/heads/master Commit: 44f82cbf0d1c379a0fc31ebd7d20a1d0acc70fd1 Parents: 223fa08 Author: Claus Ibsen davscl...@apache.org Authored: Wed Jan 28 11:09:00 2015 +0100 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Jan 28 11:09:00 2015 +0100 -- .../apache/camel/tools/apt/JsonSchemaHelper.java| 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/44f82cbf/tooling/apt/src/main/java/org/apache/camel/tools/apt/JsonSchemaHelper.java -- diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/JsonSchemaHelper.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/JsonSchemaHelper.java index 6f9ee5f..ea78bae 100644 --- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/JsonSchemaHelper.java +++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/JsonSchemaHelper.java @@ -80,7 +80,8 @@ final class JsonSchemaHelper { if (!Strings.isNullOrEmpty(defaultValue)) { sb.append(, \defaultValue\: ); -sb.append(Strings.doubleQuote(defaultValue)); +String text = safeDefaultValue(defaultValue); +sb.append(Strings.doubleQuote(text)); } if (!Strings.isNullOrEmpty(description)) { @@ -249,4 +250,17 @@ final class JsonSchemaHelper { return s.trim(); } +/** + * The default value may need to be escaped to be safe for json + */ +private static String safeDefaultValue(String value) { +if (\.equals(value)) { +return \\\; +} else if (\\.equals(value)) { +return ; +} else { +return value; +} +} + }
[2/2] camel git commit: CAMEL-8289 Don't send out error message to the client if the connection is closed.
CAMEL-8289 Don't send out error message to the client if the connection is closed. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5b72f0a2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5b72f0a2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5b72f0a2 Branch: refs/heads/master Commit: 5b72f0a2c1ac1f5b641eb114ea78cc758ea690d2 Parents: 90b224e Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Jan 28 16:57:51 2015 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Jan 28 17:19:17 2015 +0800 -- .../HttpServerMultiplexChannelHandler.java | 30 1 file changed, 18 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5b72f0a2/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java -- diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java index 71b777e..07de856 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.netty.http.handlers; +import java.nio.channels.ClosedChannelException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -40,7 +41,6 @@ import org.jboss.netty.handler.codec.http.HttpRequest; import org.jboss.netty.handler.codec.http.HttpResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import static org.jboss.netty.handler.codec.http.HttpResponseStatus.NOT_FOUND; import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1; @@ -126,17 +126,23 @@ public class HttpServerMultiplexChannelHandler extends SimpleChannelUpstreamHand if (handler != null) { handler.exceptionCaught(ctx, e); } else { -// we cannot throw the exception here -LOG.warn(HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client., e.getCause()); -// Now we just send 404 back to the client -HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND); -response.headers().set(Exchange.CONTENT_TYPE, text/plain); -response.headers().set(Exchange.CONTENT_LENGTH, 0); -// Here we don't want to expose the exception detail to the client -response.setContent(ChannelBuffers.copiedBuffer(new byte[]{})); -ctx.getChannel().write(response).syncUninterruptibly(); -// close the channel after send error message -ctx.getChannel().close(); +if (e.getCause() instanceof ClosedChannelException) { +// The channel is closed so we do nothing here +LOG.debug(Channel already closed. Ignoring this exception.); +return; +} else { +// we cannot throw the exception here +LOG.warn(HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client., e.getCause()); +// Now we just send 404 back to the client +HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND); +response.headers().set(Exchange.CONTENT_TYPE, text/plain); +response.headers().set(Exchange.CONTENT_LENGTH, 0); +// Here we don't want to expose the exception detail to the client +response.setContent(ChannelBuffers.copiedBuffer(new byte[]{})); +ctx.getChannel().write(response).syncUninterruptibly(); +// close the channel after send error message +ctx.getChannel().close(); +} } }
[1/2] camel git commit: CAMEL-8289 Don't send out error message to the client if the connection is closed.
Repository: camel Updated Branches: refs/heads/master 90b224e86 - 1e9ab5446 CAMEL-8289 Don't send out error message to the client if the connection is closed. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1e9ab544 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1e9ab544 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1e9ab544 Branch: refs/heads/master Commit: 1e9ab544609069a18b279fb40e6c77c7da8aca67 Parents: 5b72f0a Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Jan 28 16:58:13 2015 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Jan 28 17:19:17 2015 +0800 -- .../HttpServerMultiplexChannelHandler.java | 23 +--- 1 file changed, 15 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1e9ab544/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerMultiplexChannelHandler.java -- diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerMultiplexChannelHandler.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerMultiplexChannelHandler.java index 601d689..a6027e4 100644 --- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerMultiplexChannelHandler.java +++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerMultiplexChannelHandler.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.netty4.http.handlers; +import java.nio.channels.ClosedChannelException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -133,14 +134,20 @@ public class HttpServerMultiplexChannelHandler extends SimpleChannelInboundHandl if (handler != null) { handler.exceptionCaught(ctx, cause); } else { -// we cannot throw the exception here -LOG.warn(HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client., cause); -// Now we just send 404 back to the client -HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND); -response.headers().set(Exchange.CONTENT_TYPE, text/plain); -response.headers().set(Exchange.CONTENT_LENGTH, 0); -ctx.writeAndFlush(response); -ctx.close(); +if (cause instanceof ClosedChannelException) { +// The channel is closed so we do nothing here +LOG.debug(Channel already closed. Ignoring this exception.); +return; +} else { +// we cannot throw the exception here +LOG.warn(HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client., cause); +// Now we just send 404 back to the client +HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND); +response.headers().set(Exchange.CONTENT_TYPE, text/plain); +response.headers().set(Exchange.CONTENT_LENGTH, 0); +ctx.writeAndFlush(response); +ctx.close(); +} } }
[1/3] camel git commit: CAMEL-8289 Don't send out error message to the client if the connection is closed.
Repository: camel Updated Branches: refs/heads/camel-2.13.x ad87828b4 - e8aec2d5b refs/heads/camel-2.14.x 53d87f5db - 2bb612837 CAMEL-8289 Don't send out error message to the client if the connection is closed. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/383b4c46 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/383b4c46 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/383b4c46 Branch: refs/heads/camel-2.14.x Commit: 383b4c46925bd0b334f441cf24d83e117ef9cda9 Parents: 53d87f5 Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Jan 28 16:57:51 2015 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Jan 28 17:47:26 2015 +0800 -- .../HttpServerMultiplexChannelHandler.java | 30 1 file changed, 18 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/383b4c46/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java -- diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java index 71b777e..07de856 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.netty.http.handlers; +import java.nio.channels.ClosedChannelException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -40,7 +41,6 @@ import org.jboss.netty.handler.codec.http.HttpRequest; import org.jboss.netty.handler.codec.http.HttpResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import static org.jboss.netty.handler.codec.http.HttpResponseStatus.NOT_FOUND; import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1; @@ -126,17 +126,23 @@ public class HttpServerMultiplexChannelHandler extends SimpleChannelUpstreamHand if (handler != null) { handler.exceptionCaught(ctx, e); } else { -// we cannot throw the exception here -LOG.warn(HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client., e.getCause()); -// Now we just send 404 back to the client -HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND); -response.headers().set(Exchange.CONTENT_TYPE, text/plain); -response.headers().set(Exchange.CONTENT_LENGTH, 0); -// Here we don't want to expose the exception detail to the client -response.setContent(ChannelBuffers.copiedBuffer(new byte[]{})); -ctx.getChannel().write(response).syncUninterruptibly(); -// close the channel after send error message -ctx.getChannel().close(); +if (e.getCause() instanceof ClosedChannelException) { +// The channel is closed so we do nothing here +LOG.debug(Channel already closed. Ignoring this exception.); +return; +} else { +// we cannot throw the exception here +LOG.warn(HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client., e.getCause()); +// Now we just send 404 back to the client +HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND); +response.headers().set(Exchange.CONTENT_TYPE, text/plain); +response.headers().set(Exchange.CONTENT_LENGTH, 0); +// Here we don't want to expose the exception detail to the client +response.setContent(ChannelBuffers.copiedBuffer(new byte[]{})); +ctx.getChannel().write(response).syncUninterruptibly(); +// close the channel after send error message +ctx.getChannel().close(); +} } }
[2/3] camel git commit: CAMEL-8289 Don't send out error message to the client if the connection is closed.
CAMEL-8289 Don't send out error message to the client if the connection is closed. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2bb61283 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2bb61283 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2bb61283 Branch: refs/heads/camel-2.14.x Commit: 2bb61283748bbef1bbec8f60b3a98e34f3000235 Parents: 383b4c4 Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Jan 28 16:58:13 2015 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Jan 28 17:47:53 2015 +0800 -- .../HttpServerMultiplexChannelHandler.java | 23 +--- 1 file changed, 15 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2bb61283/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerMultiplexChannelHandler.java -- diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerMultiplexChannelHandler.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerMultiplexChannelHandler.java index 601d689..a6027e4 100644 --- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerMultiplexChannelHandler.java +++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/handlers/HttpServerMultiplexChannelHandler.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.netty4.http.handlers; +import java.nio.channels.ClosedChannelException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -133,14 +134,20 @@ public class HttpServerMultiplexChannelHandler extends SimpleChannelInboundHandl if (handler != null) { handler.exceptionCaught(ctx, cause); } else { -// we cannot throw the exception here -LOG.warn(HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client., cause); -// Now we just send 404 back to the client -HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND); -response.headers().set(Exchange.CONTENT_TYPE, text/plain); -response.headers().set(Exchange.CONTENT_LENGTH, 0); -ctx.writeAndFlush(response); -ctx.close(); +if (cause instanceof ClosedChannelException) { +// The channel is closed so we do nothing here +LOG.debug(Channel already closed. Ignoring this exception.); +return; +} else { +// we cannot throw the exception here +LOG.warn(HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client., cause); +// Now we just send 404 back to the client +HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND); +response.headers().set(Exchange.CONTENT_TYPE, text/plain); +response.headers().set(Exchange.CONTENT_LENGTH, 0); +ctx.writeAndFlush(response); +ctx.close(); +} } }
[3/3] camel git commit: CAMEL-8289 Don't send out error message to the client if the connection is closed.
CAMEL-8289 Don't send out error message to the client if the connection is closed. Conflicts: components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e8aec2d5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e8aec2d5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e8aec2d5 Branch: refs/heads/camel-2.13.x Commit: e8aec2d5b03c907c2fc5144d866543a257a18bbd Parents: ad87828 Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Jan 28 16:57:51 2015 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Jan 28 17:53:45 2015 +0800 -- .../HttpServerMultiplexChannelHandler.java | 30 1 file changed, 18 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e8aec2d5/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java -- diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java index 3498dc4..dd1c48a 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.netty.http.handlers; +import java.nio.channels.ClosedChannelException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -37,7 +38,6 @@ import org.jboss.netty.handler.codec.http.HttpRequest; import org.jboss.netty.handler.codec.http.HttpResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import static org.jboss.netty.handler.codec.http.HttpResponseStatus.NOT_FOUND; import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1; @@ -119,17 +119,23 @@ public class HttpServerMultiplexChannelHandler extends SimpleChannelUpstreamHand if (handler != null) { handler.exceptionCaught(ctx, e); } else { -// we cannot throw the exception here -LOG.warn(HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client., e.getCause()); -// Now we just send 404 back to the client -HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND); -response.headers().set(Exchange.CONTENT_TYPE, text/plain); -response.headers().set(Exchange.CONTENT_LENGTH, 0); -// Here we don't want to expose the exception detail to the client -response.setContent(ChannelBuffers.copiedBuffer(new byte[]{})); -ctx.getChannel().write(response).syncUninterruptibly(); -// close the channel after send error message -ctx.getChannel().close(); +if (e.getCause() instanceof ClosedChannelException) { +// The channel is closed so we do nothing here +LOG.debug(Channel already closed. Ignoring this exception.); +return; +} else { +// we cannot throw the exception here +LOG.warn(HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client., e.getCause()); +// Now we just send 404 back to the client +HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND); +response.headers().set(Exchange.CONTENT_TYPE, text/plain); +response.headers().set(Exchange.CONTENT_LENGTH, 0); +// Here we don't want to expose the exception detail to the client +response.setContent(ChannelBuffers.copiedBuffer(new byte[]{})); +ctx.getChannel().write(response).syncUninterruptibly(); +// close the channel after send error message +ctx.getChannel().close(); +} } }
camel git commit: Include jetty8/jetty9 in kit
Repository: camel Updated Branches: refs/heads/master 44f82cbf0 - 440a8fb42 Include jetty8/jetty9 in kit Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/440a8fb4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/440a8fb4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/440a8fb4 Branch: refs/heads/master Commit: 440a8fb42e4d7c0690ee1a1f4ad8defc8504af36 Parents: 44f82cb Author: Claus Ibsen davscl...@apache.org Authored: Wed Jan 28 11:38:12 2015 +0100 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Jan 28 11:38:12 2015 +0100 -- apache-camel/src/main/descriptors/common-bin.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/440a8fb4/apache-camel/src/main/descriptors/common-bin.xml -- diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml index 8a4417c..48619fd 100644 --- a/apache-camel/src/main/descriptors/common-bin.xml +++ b/apache-camel/src/main/descriptors/common-bin.xml @@ -101,7 +101,9 @@ includeorg.apache.camel:camel-jcr/include includeorg.apache.camel:camel-jclouds/include includeorg.apache.camel:camel-jdbc/include -includeorg.apache.camel:camel-jetty/include +includeorg.apache.camel:camel-jetty-common/include +includeorg.apache.camel:camel-jetty8/include +includeorg.apache.camel:camel-jetty9/include includeorg.apache.camel:camel-jgroups/include includeorg.apache.camel:camel-jibx/include includeorg.apache.camel:camel-jing/include
camel git commit: CAMEL-7999: Fixed camel-mvel to not clash component and language in same package with same name.
Repository: camel Updated Branches: refs/heads/master 440a8fb42 - 586e13d2e CAMEL-7999: Fixed camel-mvel to not clash component and language in same package with same name. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/586e13d2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/586e13d2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/586e13d2 Branch: refs/heads/master Commit: 586e13d2e7638284eafe6686344695b5036d5f11 Parents: 440a8fb Author: Claus Ibsen davscl...@apache.org Authored: Wed Jan 28 12:12:23 2015 +0100 Committer: Claus Ibsen davscl...@apache.org Committed: Wed Jan 28 12:12:23 2015 +0100 -- components/camel-mvel/pom.xml | 5 +- .../camel/component/mvel/MvelComponent.java | 51 .../camel/component/mvel/MvelConstants.java | 31 + .../camel/component/mvel/MvelEndpoint.java | 131 +++ .../camel/language/mvel/MvelComponent.java | 51 .../camel/language/mvel/MvelEndpoint.java | 131 --- .../services/org/apache/camel/component/mvel| 2 +- 7 files changed, 218 insertions(+), 184 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/586e13d2/components/camel-mvel/pom.xml -- diff --git a/components/camel-mvel/pom.xml b/components/camel-mvel/pom.xml index c03b701..4ba768e 100644 --- a/components/camel-mvel/pom.xml +++ b/components/camel-mvel/pom.xml @@ -32,7 +32,10 @@ properties !-- need to import spi as felix-bundle-plugin has a bug and do not include this package despite we use in the source code -- camel.osgi.import.before.defaultsorg.apache.camel.spi;${camel.osgi.import.strict.version}/camel.osgi.import.before.defaults - camel.osgi.export.pkgorg.apache.camel.language.mvel.*/camel.osgi.export.pkg +camel.osgi.export.pkg + org.apache.camel.component.mvel.*, + org.apache.camel.language.mvel.* +/camel.osgi.export.pkg camel.osgi.export.service org.apache.camel.spi.ComponentResolver;component=mvel, org.apache.camel.spi.LanguageResolver;language=mvel http://git-wip-us.apache.org/repos/asf/camel/blob/586e13d2/components/camel-mvel/src/main/java/org/apache/camel/component/mvel/MvelComponent.java -- diff --git a/components/camel-mvel/src/main/java/org/apache/camel/component/mvel/MvelComponent.java b/components/camel-mvel/src/main/java/org/apache/camel/component/mvel/MvelComponent.java new file mode 100644 index 000..5ac1cb6 --- /dev/null +++ b/components/camel-mvel/src/main/java/org/apache/camel/component/mvel/MvelComponent.java @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.mvel; + +import java.util.Map; + +import org.apache.camel.Endpoint; +import org.apache.camel.impl.UriEndpointComponent; +import org.apache.camel.util.ResourceHelper; + +/** + * An a href=http://camel.apache.org/mvel.html;Mvel Component/a + * for performing transforming messages + */ +public class MvelComponent extends UriEndpointComponent { + +public MvelComponent() { +super(MvelEndpoint.class); +} + +protected Endpoint createEndpoint(String uri, String remaining, MapString, Object parameters) throws Exception { +boolean cache = getAndRemoveParameter(parameters, contentCache, Boolean.class, Boolean.TRUE); + +MvelEndpoint answer = new MvelEndpoint(uri, this, remaining); +setProperties(answer, parameters); +answer.setContentCache(cache); + +// if its a http resource then append any remaining parameters and update the resource uri +if (ResourceHelper.isHttpUri(remaining)) { +remaining = ResourceHelper.appendParameters(remaining, parameters); +answer.setResourceUri(remaining); +} + +return answer; +} + +}
camel git commit: Upgrade the concurrentlinkedhashmap version to 1.4.2
Repository: camel Updated Branches: refs/heads/master 9f56ad9ac - b017a3089 Upgrade the concurrentlinkedhashmap version to 1.4.2 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b017a308 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b017a308 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b017a308 Branch: refs/heads/master Commit: b017a30899386eb4d7780a50912fcebf07fa09f0 Parents: 9f56ad9 Author: Willem Jiang willem.ji...@gmail.com Authored: Thu Jan 29 10:59:40 2015 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Thu Jan 29 11:27:49 2015 +0800 -- parent/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b017a308/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index f923348..6566840 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -117,7 +117,7 @@ commons-net-version3.3/commons-net-version commons-pool-version1.6/commons-pool-version commons-vfs2-version2.0/commons-vfs2-version -concurrentlinkedhashmap.version1.4/concurrentlinkedhashmap.version +concurrentlinkedhashmap.version1.4.2/concurrentlinkedhashmap.version cobertura-maven-plugin-version2.5.2/cobertura-maven-plugin-version cxf-version3.0.3/cxf-version cxf-version-range[2.7,4.0)/cxf-version-range @@ -3114,7 +3114,7 @@ scopetest/scope /dependency /dependencies - + build plugins plugin
svn commit: r938147 - in /websites/production/camel/content: cache/main.pageCache hdfs2.html rabbitmq.html
Author: buildbot Date: Thu Jan 29 07:18:27 2015 New Revision: 938147 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/hdfs2.html websites/production/camel/content/rabbitmq.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/hdfs2.html == --- websites/production/camel/content/hdfs2.html (original) +++ websites/production/camel/content/hdfs2.html Thu Jan 29 07:18:27 2015 @@ -102,7 +102,7 @@ pWhen consuming from hdfs2 then in normal mode, a file is split into chunks, producing a message per chunk. You can configure the size of the chunk using the chunkSize option. If you want to read from hdfs and write to a regular file using the file component, then you can use the fileMode=Append to append each of the chunks together./p /div /div -h3 id=HDFS2-OptionsOptions/h3div class=confluenceTableSmalldiv class=table-wraptable class=confluenceTabletbodytrth colspan=1 rowspan=1 class=confluenceThpName/p/thth colspan=1 rowspan=1 class=confluenceThpDefault Value/p/thth colspan=1 rowspan=1 class=confluenceThpDescription/p/th/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeoverwrite/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodetrue/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpThe file can be overwritten/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeappend/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodefalse/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpAppend to existing file. Notice that not all HDFS file systems support the append option./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodebufferSi ze/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcode4096/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpThe buffer size used by HDFS/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodereplication/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcode3/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpThe HDFS replication factor/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeblockSize/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcode67108864/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpThe size of the HDFS blocks/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodefileType/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodeNORMAL_FILE/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpIt can be SEQUENCE_FILE, MAP_FILE, ARRAY_FILE, or BLOOMMAP_FILE, see Hadoop/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodefileSystemType/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodeHDFS/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpIt can be LOCAL for local filesystem/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodekeyType/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodeNULL/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpThe type for the key in case of sequence or map files. See below./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodevalueType/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodeTEXT/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpThe type for the key in case of sequence or map files. See below./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodesplitStrategy/code/p/tdtd colspan=1 rows pan=1 class=confluenceTdp#160;/p/tdtd colspan=1 rowspan=1 class=confluenceTdpA string describing the strategy on how to split the file based on different criteria. See below./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeopenedSuffix/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcodeopened/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpWhen a file is opened for reading/writing the file is renamed with this suffix to avoid to read it during the writing phase./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodereadSuffix/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcoderead/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpOnce the file has been read is renamed with this suffix to avoid to read it again./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodeinitialDelay/code/p/tdtd colspan=1 rowspan =1 class=confluenceTdpcode0/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpFor the consumer, how much to wait (milliseconds) before to start scanning the directory./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodedelay/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpcode0/code/p/tdtd colspan=1 rowspan=1 class=confluenceTdpThe interval (milliseconds) between the directory scans./p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdpcodepattern/code/p/tdtd colspan=1 rowspan=1
[2/4] camel git commit: CAMEL-8265 Initial version of camel-hipchat component to integrate with Hipchat
CAMEL-8265 Initial version of camel-hipchat component to integrate with Hipchat Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1028f3cc Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1028f3cc Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1028f3cc Branch: refs/heads/master Commit: 1028f3ccc22c662f11d66d86ad04774aad02ade1 Parents: 424abd6 Author: Shreyas Purohit shreyas.puro...@gmail.com Authored: Thu Jan 22 07:53:21 2015 -0800 Committer: Claus Ibsen davscl...@apache.org Committed: Thu Jan 29 07:44:47 2015 +0100 -- apache-camel/pom.xml| 4 + .../src/main/descriptors/common-bin.xml | 1 + components/camel-hipchat/pom.xml| 104 + .../component/hipchat/HipchatApiConstants.java | 34 +++ .../component/hipchat/HipchatComponent.java | 73 +++ .../component/hipchat/HipchatConfiguration.java | 87 .../component/hipchat/HipchatConstants.java | 34 +++ .../component/hipchat/HipchatConsumer.java | 121 +++ .../component/hipchat/HipchatEndpoint.java | 62 ++ .../component/hipchat/HipchatException.java | 28 +++ .../component/hipchat/HipchatProducer.java | 131 +++ .../src/main/resources/META-INF/LICENSE.txt | 203 + .../src/main/resources/META-INF/NOTICE.txt | 11 + .../services/org/apache/camel/component/hipchat | 18 ++ .../hipchat/HipchatComponentConsumerTest.java | 211 ++ .../HipchatComponentMultipleUsersTest.java | 137 .../hipchat/HipchatComponentProducerTest.java | 215 +++ .../component/hipchat/HipchatComponentTest.java | 76 +++ .../hipchat/HipchatEPSuccessTestSupport.java| 64 ++ .../component/hipchat/HipchatEndpointTest.java | 40 .../HipchatConsumerIntegrationTest.java | 67 ++ .../HipchatProducerIntegrationTest.java | 93 .../src/test/resources/log4j.properties | 15 ++ components/pom.xml | 1 + parent/pom.xml | 5 + .../features/src/main/resources/features.xml| 8 + 26 files changed, 1843 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1028f3cc/apache-camel/pom.xml -- diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml index ce72c53..9f53e74 100644 --- a/apache-camel/pom.xml +++ b/apache-camel/pom.xml @@ -305,6 +305,10 @@ /dependency dependency groupIdorg.apache.camel/groupId + artifactIdcamel-hipchat/artifactId +/dependency +dependency + groupIdorg.apache.camel/groupId artifactIdcamel-hl7/artifactId /dependency dependency http://git-wip-us.apache.org/repos/asf/camel/blob/1028f3cc/apache-camel/src/main/descriptors/common-bin.xml -- diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml index 48619fd..ecb4502 100644 --- a/apache-camel/src/main/descriptors/common-bin.xml +++ b/apache-camel/src/main/descriptors/common-bin.xml @@ -88,6 +88,7 @@ includeorg.apache.camel:camel-hbase/include includeorg.apache.camel:camel-hdfs/include includeorg.apache.camel:camel-hdfs2/include +includeorg.apache.camel:camel-hipchat/include includeorg.apache.camel:camel-http/include includeorg.apache.camel:camel-http4/include includeorg.apache.camel:camel-ibatis/include http://git-wip-us.apache.org/repos/asf/camel/blob/1028f3cc/components/camel-hipchat/pom.xml -- diff --git a/components/camel-hipchat/pom.xml b/components/camel-hipchat/pom.xml new file mode 100644 index 000..b4e8251 --- /dev/null +++ b/components/camel-hipchat/pom.xml @@ -0,0 +1,104 @@ +?xml version=1.0 encoding=UTF-8? +!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the License); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an AS IS BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +
[3/4] camel git commit: CAMEL-8265: Polished
CAMEL-8265: Polished Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cac2dc7f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cac2dc7f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cac2dc7f Branch: refs/heads/master Commit: cac2dc7f068c72f5310d990716e221e4026a12c8 Parents: 1028f3c Author: Claus Ibsen davscl...@apache.org Authored: Thu Jan 29 08:13:18 2015 +0100 Committer: Claus Ibsen davscl...@apache.org Committed: Thu Jan 29 08:13:18 2015 +0100 -- .../component/hipchat/HipchatConfiguration.java | 21 ++-- .../component/hipchat/HipchatEndpoint.java | 2 ++ .../component/hipchat/HipchatComponentTest.java | 12 --- .../src/test/resources/log4j.properties | 35 4 files changed, 49 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/cac2dc7f/components/camel-hipchat/src/main/java/org/apache/camel/component/hipchat/HipchatConfiguration.java -- diff --git a/components/camel-hipchat/src/main/java/org/apache/camel/component/hipchat/HipchatConfiguration.java b/components/camel-hipchat/src/main/java/org/apache/camel/component/hipchat/HipchatConfiguration.java index 6f5e97b..151774b 100644 --- a/components/camel-hipchat/src/main/java/org/apache/camel/component/hipchat/HipchatConfiguration.java +++ b/components/camel-hipchat/src/main/java/org/apache/camel/component/hipchat/HipchatConfiguration.java @@ -23,12 +23,12 @@ import org.apache.camel.spi.UriPath; @UriParams public class HipchatConfiguration { @UriPath +private String protocol = HipchatConstants.DEFAULT_PROTOCOL; +@UriPath private String host = HipchatConstants.DEFAULT_HOST; @UriPath private Integer port = HipchatConstants.DEFAULT_PORT; @UriParam -private String protocol = HipchatConstants.DEFAULT_PROTOCOL; -@UriParam private String authToken; @UriParam private String consumeUsers; @@ -37,6 +37,9 @@ public class HipchatConfiguration { return host; } +/** + * The host for the hipchat server. Is by default api.hipchat.com + */ public void setHost(String host) { this.host = host; } @@ -45,6 +48,9 @@ public class HipchatConfiguration { return port; } +/** + * The port for the hipchat server. Is by default 80. + */ public void setPort(Integer port) { this.port = port; } @@ -53,6 +59,9 @@ public class HipchatConfiguration { return protocol; } +/** + * The protocol for the hipchat server. Is by default http. + */ public void setProtocol(String protocol) { this.protocol = protocol; } @@ -61,6 +70,9 @@ public class HipchatConfiguration { return authToken; } +/** + * OAuth 2 auth token + */ public void setAuthToken(String authToken) { this.authToken = authToken; } @@ -69,6 +81,11 @@ public class HipchatConfiguration { return consumeUsers; } +/** + * Username(s) when consuming messages from the hiptchat server. + * p/ + * Multiple user names can be separated by comma. + */ public void setConsumeUsers(String consumeUsers) { this.consumeUsers = consumeUsers; } http://git-wip-us.apache.org/repos/asf/camel/blob/cac2dc7f/components/camel-hipchat/src/main/java/org/apache/camel/component/hipchat/HipchatEndpoint.java -- diff --git a/components/camel-hipchat/src/main/java/org/apache/camel/component/hipchat/HipchatEndpoint.java b/components/camel-hipchat/src/main/java/org/apache/camel/component/hipchat/HipchatEndpoint.java index 9197848..51150da 100644 --- a/components/camel-hipchat/src/main/java/org/apache/camel/component/hipchat/HipchatEndpoint.java +++ b/components/camel-hipchat/src/main/java/org/apache/camel/component/hipchat/HipchatEndpoint.java @@ -22,6 +22,7 @@ import org.apache.camel.Producer; import org.apache.camel.impl.DefaultEndpoint; import org.apache.camel.impl.ScheduledPollEndpoint; import org.apache.camel.spi.UriEndpoint; +import org.apache.camel.spi.UriParam; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -31,6 +32,7 @@ import org.slf4j.LoggerFactory; @UriEndpoint(scheme = hipchat, consumerClass = HipchatConsumer.class, label = api,cloud) public class HipchatEndpoint extends ScheduledPollEndpoint { +@UriParam private HipchatConfiguration configuration; public HipchatEndpoint(String uri, HipchatComponent component) { http://git-wip-us.apache.org/repos/asf/camel/blob/cac2dc7f/components/camel-hipchat/src/test/java/org/apache/camel/component/hipchat/HipchatComponentTest.java
[4/4] camel git commit: CAMEL-8265: Fixed karaf feature
CAMEL-8265: Fixed karaf feature Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/654c33aa Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/654c33aa Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/654c33aa Branch: refs/heads/master Commit: 654c33aab252f2ff0baf05a60c1ca3121203cf49 Parents: cac2dc7 Author: Claus Ibsen davscl...@apache.org Authored: Thu Jan 29 08:17:34 2015 +0100 Committer: Claus Ibsen davscl...@apache.org Committed: Thu Jan 29 08:17:34 2015 +0100 -- .../features/src/main/resources/features.xml| 1 + .../camel/itest/karaf/CamelHipchatTest.java | 40 2 files changed, 41 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/654c33aa/platforms/karaf/features/src/main/resources/features.xml -- diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml index fb59f65..7a05ad0 100644 --- a/platforms/karaf/features/src/main/resources/features.xml +++ b/platforms/karaf/features/src/main/resources/features.xml @@ -640,6 +640,7 @@ bundle dependency='true'mvn:org.apache.httpcomponents/httpclient-osgi/${httpclient4-version}/bundle bundle dependency='true'mvn:com.fasterxml.jackson.core/jackson-core/${jackson2-version}/bundle bundle dependency='true'mvn:com.fasterxml.jackson.core/jackson-databind/${jackson2-version}/bundle +bundle dependency='true'mvn:com.fasterxml.jackson.core/jackson-annotations/${jackson2-version}/bundle feature version='${project.version}'camel-core/feature bundlemvn:org.apache.camel/camel-hipchat/${project.version}/bundle /feature http://git-wip-us.apache.org/repos/asf/camel/blob/654c33aa/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelHipchatTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelHipchatTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelHipchatTest.java new file mode 100644 index 000..7b008fb --- /dev/null +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelHipchatTest.java @@ -0,0 +1,40 @@ +/** + * 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.itest.karaf; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.ops4j.pax.exam.Configuration; +import org.ops4j.pax.exam.Option; +import org.ops4j.pax.exam.junit.PaxExam; + +@RunWith(PaxExam.class) +public class CamelHipchatTest extends AbstractFeatureTest { + +public static final String COMPONENT = extractName(CamelHipchatTest.class); + +@Test +public void test() throws Exception { +testComponent(COMPONENT); +} + +@Configuration +public static Option[] configure() { +return configure(COMPONENT); +} + +} \ No newline at end of file
[1/4] camel git commit: CAMEL-8265 Initial version of camel-hipchat component to integrate with Hipchat
Repository: camel Updated Branches: refs/heads/master 424abd63c - 654c33aab http://git-wip-us.apache.org/repos/asf/camel/blob/1028f3cc/components/camel-hipchat/src/test/java/org/apache/camel/component/hipchat/integration/HipchatConsumerIntegrationTest.java -- diff --git a/components/camel-hipchat/src/test/java/org/apache/camel/component/hipchat/integration/HipchatConsumerIntegrationTest.java b/components/camel-hipchat/src/test/java/org/apache/camel/component/hipchat/integration/HipchatConsumerIntegrationTest.java new file mode 100644 index 000..d35149c --- /dev/null +++ b/components/camel-hipchat/src/test/java/org/apache/camel/component/hipchat/integration/HipchatConsumerIntegrationTest.java @@ -0,0 +1,67 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.hipchat.integration; + + +import org.apache.camel.EndpointInject; +import org.apache.camel.Exchange; +import org.apache.camel.Predicate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.hipchat.HipchatConstants; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.processor.idempotent.MemoryIdempotentRepository; +import org.apache.camel.test.junit4.CamelTestSupport; +import org.apache.http.StatusLine; +import org.junit.Ignore; +import org.junit.Test; + +@Ignore(Must be manually tested. Provide your own auth key, user, room from https://www.hipchat.com/docs/apiv2/auth;) +public class HipchatConsumerIntegrationTest extends CamelTestSupport { +@EndpointInject(uri = mock:result) +private MockEndpoint result; + +@Test +public void sendInOnly() throws Exception { +result.expectedMessageCount(1); +result.expectedMessagesMatches(new Predicate() { +@Override +public boolean matches(Exchange exchange) { +StatusLine status = (StatusLine)exchange.getIn().getHeader(HipchatConstants.FROM_USER_RESPONSE_STATUS); +return 200 == status.getStatusCode(); +} +}); + +assertMockEndpointsSatisfied(); +} + +protected RouteBuilder createRouteBuilder() throws Exception { +return new RouteBuilder() { +@Override +public void configure() throws Exception { +String hipchatEndpointUri = hipchat://?authToken=consumeUsers=@ShreyasPurohitdelay=1000; + +from(hipchatEndpointUri) +.idempotentConsumer( +simple(${in.header.HipchatMessageDate} ${in.header.HipchatFromUser}), + MemoryIdempotentRepository.memoryIdempotentRepository(200) +) +.to(mock:result); +} +}; +} + +} http://git-wip-us.apache.org/repos/asf/camel/blob/1028f3cc/components/camel-hipchat/src/test/java/org/apache/camel/component/hipchat/integration/HipchatProducerIntegrationTest.java -- diff --git a/components/camel-hipchat/src/test/java/org/apache/camel/component/hipchat/integration/HipchatProducerIntegrationTest.java b/components/camel-hipchat/src/test/java/org/apache/camel/component/hipchat/integration/HipchatProducerIntegrationTest.java new file mode 100644 index 000..6f83930 --- /dev/null +++ b/components/camel-hipchat/src/test/java/org/apache/camel/component/hipchat/integration/HipchatProducerIntegrationTest.java @@ -0,0 +1,93 @@ +/** + * 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
[2/4] camel git commit: fixing producer for creation objects with custom model
fixing producer for creation objects with custom model Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d275e67a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d275e67a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d275e67a Branch: refs/heads/master Commit: d275e67a7c7739d354a7070d92a3974b0979f354 Parents: dbf8be1 Author: bava...@gmail.com bava...@gmail.com Authored: Fri Jan 23 15:42:04 2015 +0300 Committer: Claus Ibsen davscl...@apache.org Committed: Thu Jan 29 07:36:12 2015 +0100 -- .../org/apache/camel/component/cmis/CMISProducer.java | 4 ++-- .../apache/camel/component/cmis/CMISSessionFacade.java | 13 - 2 files changed, 10 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/d275e67a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java -- diff --git a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java index 44496fb..cf71b43 100644 --- a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java +++ b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java @@ -102,7 +102,7 @@ public class CMISProducer extends DefaultProducer { private boolean isFolder(Message message) { String baseTypeId = message.getHeader(PropertyIds.OBJECT_TYPE_ID, String.class); if (baseTypeId != null) { -return baseTypeId.equals(CamelCMISConstants.CMIS_FOLDER); +return CamelCMISConstants.CMIS_FOLDER.equals(cmisSessionFacade.getCMISTypeFor(baseTypeId)); } return message.getBody() == null; } @@ -137,7 +137,7 @@ public class CMISProducer extends DefaultProducer { private boolean isDocument(Exchange exchange) { String baseTypeId = exchange.getIn().getHeader(PropertyIds.OBJECT_TYPE_ID, String.class); if (baseTypeId != null) { -return baseTypeId.equals(CamelCMISConstants.CMIS_DOCUMENT); +return CamelCMISConstants.CMIS_DOCUMENT.equals(cmisSessionFacade.getCMISTypeFor(baseTypeId)); } return exchange.getIn().getBody() != null; } http://git-wip-us.apache.org/repos/asf/camel/blob/d275e67a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java -- diff --git a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java index ff03d91..8ea367e 100644 --- a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java +++ b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java @@ -190,10 +190,8 @@ public class CMISSessionFacade { } public boolean isObjectTypeVersionable(String objectType) { -ObjectType typeDefinition = session.getTypeDefinition(objectType); -ObjectType objectBaseType = typeDefinition.getBaseType(); -if (CamelCMISConstants.CMIS_DOCUMENT.equals(objectType) -|| (objectBaseType != null CamelCMISConstants.CMIS_DOCUMENT.equals(objectBaseType.getId( { +if (CamelCMISConstants.CMIS_DOCUMENT.equals(getCMISTypeFor(objectType))) { +ObjectType typeDefinition = session.getTypeDefinition(objectType); return ((DocumentType)typeDefinition).isVersionable(); } return false; @@ -203,7 +201,12 @@ public class CMISSessionFacade { return buf != null ? session.getObjectFactory() .createContentStream(fileName, buf.length, mimeType, new ByteArrayInputStream(buf)) : null; } - + +public String getCMISTypeFor(String customOrCMISType) { +ObjectType objectBaseType = session.getTypeDefinition(customOrCMISType).getBaseType(); +return objectBaseType == null ? customOrCMISType : objectBaseType.getId(); +} + public OperationContext createOperationContext() { return session.createOperationContext(); }
[4/4] camel git commit: Fixed CS
Fixed CS Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/424abd63 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/424abd63 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/424abd63 Branch: refs/heads/master Commit: 424abd63c74b4a2f35a704ed23ab02beecdafa61 Parents: 6fd9adf Author: Claus Ibsen davscl...@apache.org Authored: Thu Jan 29 07:40:08 2015 +0100 Committer: Claus Ibsen davscl...@apache.org Committed: Thu Jan 29 07:40:08 2015 +0100 -- .../java/org/apache/camel/component/cmis/CMISProducer.java| 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/424abd63/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java -- diff --git a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java index 5169ed6..b05346d 100644 --- a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java +++ b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java @@ -59,8 +59,9 @@ public class CMISProducer extends DefaultProducer { private MapString, Object filterTypeProperties(MapString, Object properties) { MapString, Object result = new HashMapString, Object(properties.size()); String objectTypeName = CamelCMISConstants.CMIS_DOCUMENT; -if (properties.containsKey(PropertyIds.OBJECT_TYPE_ID)) -objectTypeName = (String)properties.get(PropertyIds.OBJECT_TYPE_ID); +if (properties.containsKey(PropertyIds.OBJECT_TYPE_ID)) { +objectTypeName = (String) properties.get(PropertyIds.OBJECT_TYPE_ID); +} SetString types = cmisSessionFacade.getPropertiesFor(objectTypeName); for (Map.EntryString, Object entry : properties.entrySet()) { @@ -161,7 +162,7 @@ public class CMISProducer extends DefaultProducer { } private byte[] getBodyData(Message message) { -return message.getBody(new byte[0].getClass()); +return message.getBody(byte[].class); } private String getMimeType(Message message) throws NoSuchHeaderException {
[3/4] camel git commit: creation object with custom model
creation object with custom model Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/dbf8be1d Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/dbf8be1d Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/dbf8be1d Branch: refs/heads/master Commit: dbf8be1d79d0c0aa93c81eed91133a0e7c2bc824 Parents: b017a30 Author: bava...@gmail.com bava...@gmail.com Authored: Fri Jan 23 14:14:54 2015 +0300 Committer: Claus Ibsen davscl...@apache.org Committed: Thu Jan 29 07:36:12 2015 +0100 -- .../org/apache/camel/component/cmis/CMISSessionFacade.java | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/dbf8be1d/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java -- diff --git a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java index 16f23d5..ff03d91 100644 --- a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java +++ b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java @@ -190,8 +190,10 @@ public class CMISSessionFacade { } public boolean isObjectTypeVersionable(String objectType) { -if (CamelCMISConstants.CMIS_DOCUMENT.equals(objectType)) { -ObjectType typeDefinition = session.getTypeDefinition(objectType); +ObjectType typeDefinition = session.getTypeDefinition(objectType); +ObjectType objectBaseType = typeDefinition.getBaseType(); +if (CamelCMISConstants.CMIS_DOCUMENT.equals(objectType) +|| (objectBaseType != null CamelCMISConstants.CMIS_DOCUMENT.equals(objectBaseType.getId( { return ((DocumentType)typeDefinition).isVersionable(); } return false;
[1/4] camel git commit: creating objects with custom properties
Repository: camel Updated Branches: refs/heads/master b017a3089 - 424abd63c creating objects with custom properties Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6fd9adf5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6fd9adf5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6fd9adf5 Branch: refs/heads/master Commit: 6fd9adf573eb632da3992e6a89f22fa8cbb767b4 Parents: d275e67 Author: bava...@gmail.com bava...@gmail.com Authored: Sat Jan 24 01:21:13 2015 +0300 Committer: Claus Ibsen davscl...@apache.org Committed: Thu Jan 29 07:36:12 2015 +0100 -- .../camel/component/cmis/CMISProducer.java | 20 +++- .../camel/component/cmis/CMISSessionFacade.java | 9 + 2 files changed, 24 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6fd9adf5/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java -- diff --git a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java index cf71b43..5169ed6 100644 --- a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java +++ b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISProducer.java @@ -16,7 +16,9 @@ */ package org.apache.camel.component.cmis; +import java.util.HashMap; import java.util.Map; +import java.util.Set; import org.apache.camel.Exchange; import org.apache.camel.Message; @@ -28,6 +30,7 @@ import org.apache.camel.util.MessageHelper; import org.apache.chemistry.opencmis.client.api.CmisObject; import org.apache.chemistry.opencmis.client.api.Document; import org.apache.chemistry.opencmis.client.api.Folder; +import org.apache.chemistry.opencmis.client.api.ObjectType; import org.apache.chemistry.opencmis.commons.PropertyIds; import org.apache.chemistry.opencmis.commons.data.ContentStream; import org.apache.chemistry.opencmis.commons.enums.VersioningState; @@ -53,13 +56,28 @@ public class CMISProducer extends DefaultProducer { exchange.getOut().setBody(cmisObject.getId()); } +private MapString, Object filterTypeProperties(MapString, Object properties) { +MapString, Object result = new HashMapString, Object(properties.size()); +String objectTypeName = CamelCMISConstants.CMIS_DOCUMENT; +if (properties.containsKey(PropertyIds.OBJECT_TYPE_ID)) +objectTypeName = (String)properties.get(PropertyIds.OBJECT_TYPE_ID); + +SetString types = cmisSessionFacade.getPropertiesFor(objectTypeName); +for (Map.EntryString, Object entry : properties.entrySet()) { +if (types.contains(entry.getKey())) { +result.put(entry.getKey(), entry.getValue()); +} +} +return result; +} + private CmisObject createNode(Exchange exchange) throws Exception { validateRequiredHeader(exchange, PropertyIds.NAME); Message message = exchange.getIn(); String parentFolderPath = parentFolderPathFor(message); Folder parentFolder = getFolderOnPath(exchange, parentFolderPath); -MapString, Object cmisProperties = CMISHelper.filterCMISProperties(message.getHeaders()); +MapString, Object cmisProperties = filterTypeProperties(message.getHeaders()); if (isDocument(exchange)) { String fileName = message.getHeader(PropertyIds.NAME, String.class); http://git-wip-us.apache.org/repos/asf/camel/blob/6fd9adf5/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java -- diff --git a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java index 8ea367e..230479e 100644 --- a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java +++ b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java @@ -18,10 +18,7 @@ package org.apache.camel.component.cmis; import java.io.ByteArrayInputStream; import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriParams; @@ -207,6 +204,10 @@ public class CMISSessionFacade { return objectBaseType == null ? customOrCMISType : objectBaseType.getId(); } +public SetString getPropertiesFor(String objectType) { +return