Repository: camel
Updated Branches:
  refs/heads/master 43c81d4f5 -> f8d290765


CAMEL-7999: More components include documentation


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

Branch: refs/heads/master
Commit: 362c8bcd64ea0e614f4a2b5f40e3157c3e1f5543
Parents: 43c81d4
Author: Claus Ibsen <davscl...@apache.org>
Authored: Sun Jan 4 10:39:00 2015 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Sun Jan 4 10:39:00 2015 +0100

----------------------------------------------------------------------
 .../camel/component/xmlsecurity/XmlCommand.java | 22 +++++++++++++
 .../xmlsecurity/XmlSignatureComponent.java      | 15 ++++++---
 .../xmlsecurity/XmlSignatureEndpoint.java       | 33 +++++++++++++++++++-
 .../processor/XmlSignatureConfiguration.java    | 13 ++++++--
 .../processor/XmlSignerConfiguration.java       | 21 +++++++++++++
 .../processor/XmlVerifierConfiguration.java     | 18 +++++++++--
 6 files changed, 112 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/362c8bcd/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlCommand.java
----------------------------------------------------------------------
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlCommand.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlCommand.java
new file mode 100644
index 0000000..c27d5d9
--- /dev/null
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlCommand.java
@@ -0,0 +1,22 @@
+/**
+ * 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.xmlsecurity;
+
+public enum XmlCommand {
+
+    sign, verify
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/362c8bcd/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureComponent.java
----------------------------------------------------------------------
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureComponent.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureComponent.java
index 886a695..eb27b38 100644
--- 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureComponent.java
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureComponent.java
@@ -24,21 +24,21 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.component.xmlsecurity.processor.XmlSignerConfiguration;
 import 
org.apache.camel.component.xmlsecurity.processor.XmlVerifierConfiguration;
-import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.impl.UriEndpointComponent;
 import org.apache.camel.util.ObjectHelper;
 
-
-public class XmlSignatureComponent extends DefaultComponent {
+public class XmlSignatureComponent extends UriEndpointComponent {
 
     private XmlSignerConfiguration signerConfiguration;
 
     private XmlVerifierConfiguration verifierConfiguration;
 
     public XmlSignatureComponent() {
+        super(XmlSignatureEndpoint.class);
     }
 
     public XmlSignatureComponent(CamelContext context) {
-        super(context);
+        super(context, XmlSignatureEndpoint.class);
     }
 
     @Override
@@ -47,8 +47,11 @@ public class XmlSignatureComponent extends DefaultComponent {
         ObjectHelper.notNull(getCamelContext(), "CamelContext");
 
         String scheme;
+        String name;
         try {
-            scheme = new URI(remaining).getScheme();
+            URI u = new URI(remaining);
+            scheme = u.getScheme();
+            name = u.getPath();
         } catch (Exception e) {
             throw new MalformedURLException(
                 String.format(
@@ -76,6 +79,8 @@ public class XmlSignatureComponent extends DefaultComponent {
         }
         setProperties(endpoint.getConfiguration(), parameters);
         endpoint.getConfiguration().setCamelContext(getCamelContext());
+        endpoint.setCommand(XmlCommand.valueOf(scheme));
+        endpoint.setName(name);
         return endpoint;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/362c8bcd/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureEndpoint.java
----------------------------------------------------------------------
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureEndpoint.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureEndpoint.java
index 3633f04..027928d 100644
--- 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureEndpoint.java
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureEndpoint.java
@@ -17,21 +17,52 @@
 package org.apache.camel.component.xmlsecurity;
 
 import java.util.Map;
-
 import javax.xml.crypto.URIDereferencer;
 
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import 
org.apache.camel.component.xmlsecurity.processor.XmlSignatureConfiguration;
+import org.apache.camel.component.xmlsecurity.processor.XmlSignerConfiguration;
+import 
org.apache.camel.component.xmlsecurity.processor.XmlVerifierConfiguration;
 import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
 
+@UriEndpoint(scheme = "xmlsecurity", label = "security,transformation")
 public abstract class XmlSignatureEndpoint extends DefaultEndpoint {
 
+    @UriPath
+    private XmlCommand command;
+    @UriPath
+    private String name;
+    // to include both kind of configuration params
+    @UriParam
+    private XmlSignerConfiguration signerConfiguration;
+    @UriParam
+    private XmlVerifierConfiguration verifierConfiguration;
+
     public XmlSignatureEndpoint(String uri, XmlSignatureComponent component) {
         super(uri, component);
     }
 
+    public XmlCommand getCommand() {
+        return command;
+    }
+
+    public void setCommand(XmlCommand command) {
+        this.command = command;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
     @Override
     public Producer createProducer() {
         return new XmlSignatureProducer(this, createProcessor());

http://git-wip-us.apache.org/repos/asf/camel/blob/362c8bcd/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureConfiguration.java
----------------------------------------------------------------------
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureConfiguration.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureConfiguration.java
index b752e0a..2289220 100644
--- 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureConfiguration.java
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureConfiguration.java
@@ -17,7 +17,6 @@
 package org.apache.camel.component.xmlsecurity.processor;
 
 import java.util.Map;
-
 import javax.xml.crypto.URIDereferencer;
 import javax.xml.crypto.XMLCryptoContext;
 import javax.xml.crypto.dsig.XMLSignContext;
@@ -26,25 +25,35 @@ import javax.xml.crypto.dsig.XMLValidateContext;
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.component.xmlsecurity.api.XmlSignatureConstants;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
 
+@UriParams
 public abstract class XmlSignatureConfiguration implements Cloneable, 
CamelContextAware {
 
     private CamelContext context;
 
     private URIDereferencer uriDereferencer;
 
+    @UriParam
     private String baseUri;
 
+    @UriParam
     private Map<String, ? extends Object> cryptoContextProperties;
 
+    @UriParam(defaultValue = "true")
     private Boolean disallowDoctypeDecl = Boolean.TRUE;
 
+    @UriParam(defaultValue = "false")
     private Boolean omitXmlDeclaration = Boolean.FALSE;
 
+    @UriParam(defaultValue = "true")
     private Boolean clearHeaders = Boolean.TRUE;
 
+    @UriParam
     private String schemaResourceUri;
-    
+
+    @UriParam
     private String outputXmlEncoding;
 
     public XmlSignatureConfiguration() {

http://git-wip-us.apache.org/repos/asf/camel/blob/362c8bcd/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
----------------------------------------------------------------------
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
index 37acb5f..3872349 100644
--- 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerConfiguration.java
@@ -32,9 +32,13 @@ import 
org.apache.camel.component.xmlsecurity.api.XmlSignatureConstants;
 import org.apache.camel.component.xmlsecurity.api.XmlSignatureHelper;
 import org.apache.camel.component.xmlsecurity.api.XmlSignatureProperties;
 import org.apache.camel.component.xmlsecurity.api.XmlSignatureTransform;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
 
+@UriParams
 public class XmlSignerConfiguration extends XmlSignatureConfiguration {
 
+    @UriParam
     private KeyAccessor keyAccessor;
 
     /**
@@ -42,6 +46,7 @@ public class XmlSignerConfiguration extends 
XmlSignatureConfiguration {
      * {@link CanonicalizationMethod#INCLUSIVE}.
      * 
      */
+    @UriParam
     private AlgorithmMethod canonicalizationMethod = new 
XmlSignatureTransform(CanonicalizationMethod.INCLUSIVE);
 
     /**
@@ -51,6 +56,7 @@ public class XmlSignerConfiguration extends 
XmlSignatureConfiguration {
     private List<AlgorithmMethod> transformMethods = 
Collections.singletonList(XmlSignatureHelper
             .getCanonicalizationMethod(CanonicalizationMethod.INCLUSIVE));
 
+    @UriParam
     private String signatureAlgorithm = 
"http://www.w3.org/2000/09/xmldsig#rsa-sha1";;
 
     /**
@@ -59,15 +65,20 @@ public class XmlSignerConfiguration extends 
XmlSignatureConfiguration {
      * is not specified then the digest algorithm is calculated from the
      * signature algorithm. Example: "http://www.w3.org/2001/04/xmlenc#sha256";
      */
+    @UriParam
     private String digestAlgorithm;
 
+    @UriParam(defaultValue = "true")
     private Boolean addKeyInfoReference = Boolean.TRUE;
 
+    @UriParam(defaultValue = "ds")
     private String prefixForXmlSignatureNamespace = "ds";
 
+    @UriParam
     private String contentObjectId;
 
     // default value is null so that a unique ID is generated.
+    @UriParam
     private String signatureId;
 
     /**
@@ -77,6 +88,7 @@ public class XmlSignerConfiguration extends 
XmlSignatureConfiguration {
      * schema (see {@link #setSchemaResourceUri(String)}. Will be ignored in 
the
      * enveloping and detached case.
      */
+    @UriParam
     private String contentReferenceUri;
 
     /**
@@ -84,10 +96,13 @@ public class XmlSignerConfiguration extends 
XmlSignatureConfiguration {
      * This value can be overwritten by the header
      * {@link XmlSignatureConstants#HEADER_CONTENT_REFERENCE_TYPE}.
      */
+    @UriParam
     private String contentReferenceType;
 
+    @UriParam
     private String parentLocalName;
 
+    @UriParam
     private String parentNamespace;
 
     /**
@@ -96,6 +111,7 @@ public class XmlSignerConfiguration extends 
XmlSignatureConfiguration {
      * value can be overwritten by the header
      * {@link XmlSignatureConstants#HEADER_MESSAGE_IS_PLAIN_TEXT}.
      */
+    @UriParam(defaultValue = "false")
     private Boolean plainText = Boolean.FALSE;
 
     /**
@@ -103,6 +119,7 @@ public class XmlSignerConfiguration extends 
XmlSignatureConfiguration {
      * text (see parameter {@link #plainText}. Default value is "UTF-8".
      * 
      */
+    @UriParam
     private String plainTextEncoding = "UTF-8";
 
     private XmlSignatureProperties properties;
@@ -112,9 +129,13 @@ public class XmlSignerConfiguration extends 
XmlSignatureConfiguration {
     private XPathFilterParameterSpec parentXpath;
 
     /* references that should be resolved when the context changes */
+    @UriParam
     private String keyAccessorName;
+    @UriParam
     private String canonicalizationMethodName;
+    @UriParam
     private String transformMethodsName;
+    @UriParam
     private String propertiesName;
 
     public XmlSignerConfiguration() {

http://git-wip-us.apache.org/repos/asf/camel/blob/362c8bcd/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlVerifierConfiguration.java
----------------------------------------------------------------------
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlVerifierConfiguration.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlVerifierConfiguration.java
index c7da6cb..4ec50ca 100644
--- 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlVerifierConfiguration.java
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlVerifierConfiguration.java
@@ -25,31 +25,45 @@ import 
org.apache.camel.component.xmlsecurity.api.DefaultXmlSignature2Message;
 import org.apache.camel.component.xmlsecurity.api.ValidationFailedHandler;
 import org.apache.camel.component.xmlsecurity.api.XmlSignature2Message;
 import org.apache.camel.component.xmlsecurity.api.XmlSignatureChecker;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
 
 public class XmlVerifierConfiguration extends XmlSignatureConfiguration {
 
+    @UriParam
     private KeySelector keySelector;
 
+    @UriParam
     private String keySelectorName;
 
+    @UriParam
     private XmlSignatureChecker xmlSignatureChecker;
 
+    @UriParam
     private String xmlSignatureCheckerName;
 
+    @UriParam
     private XmlSignature2Message xmlSignature2Message = new 
DefaultXmlSignature2Message();
 
+    @UriParam
     private String xmlSignature2MessageName;
 
+    @UriParam
     private ValidationFailedHandler validationFailedHandler = new 
DefaultValidationFailedHandler();
 
+    @UriParam
     private String validationFailedHandlerName;
 
+    @UriParam
     private Object outputNodeSearch;
 
+    @UriParam(defaultValue = 
DefaultXmlSignature2Message.OUTPUT_NODE_SEARCH_TYPE_DEFAULT)
     private String outputNodeSearchType = 
DefaultXmlSignature2Message.OUTPUT_NODE_SEARCH_TYPE_DEFAULT;
 
+    @UriParam(defaultValue = "false")
     private Boolean removeSignatureElements = Boolean.FALSE;
-    
+
+    @UriParam(defaultValue = "false")
     private Boolean secureValidation = Boolean.TRUE;
 
     public XmlVerifierConfiguration() {
@@ -192,7 +206,7 @@ public class XmlVerifierConfiguration extends 
XmlSignatureConfiguration {
     /**
      * Determines the search type for determining the output node which is
      * serialized into the output message bodyF. See
-     * {@link #setOutputNodeSearch(String)}. The supported default search types
+     * {@link #setOutputNodeSearch(Object)}. The supported default search types
      * you can find in {@link DefaultXmlSignature2Message}.
      * 
      * @param outputNodeSearchType

Reply via email to