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 2016/03/22 16:56:49 UTC

[6/8] camel git commit: Fixed component docs

Fixed component docs


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

Branch: refs/heads/master
Commit: 07b4898727281d5df21983022f5feb04cfbdc1d4
Parents: 3ef6e4d
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Mar 22 16:55:55 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 22 16:55:55 2016 +0100

----------------------------------------------------------------------
 .../servicenow/ServiceNowConfiguration.java     | 20 +++++++--------
 .../servicenow/ServiceNowConsumer.java          | 26 --------------------
 .../servicenow/ServiceNowEndpoint.java          |  8 +++---
 3 files changed, 15 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/07b48987/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConfiguration.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConfiguration.java
index 755e49f..9c0b424 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConfiguration.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConfiguration.java
@@ -22,11 +22,11 @@ import java.util.Map;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
 import org.apache.camel.util.ObjectHelper;
 
-
 @UriParams
 public class ServiceNowConfiguration {
 
@@ -38,27 +38,27 @@ public class ServiceNowConfiguration {
             JsonInclude.Include.NON_NULL
         );
 
-    @UriParam
+    @UriParam @Metadata(required = "true")
     private String userName;
-    @UriParam
+    @UriParam @Metadata(required = "true")
     private String password;
-    @UriParam
+    @UriParam(label = "security")
     private String oauthClientId;
-    @UriParam
+    @UriParam(label = "security")
     private String oauthClientSecret;
-    @UriParam(label = "advanced")
+    @UriParam(label = "security")
     private String oauthTokenUrl;
     @UriParam(label = "advanced")
     private String apiUrl;
     @UriParam
     private String table;
-    @UriParam(defaultValue = "false")
+    @UriParam
     private Boolean excludeReferenceLink = false;
-    @UriParam(defaultValue = "false")
+    @UriParam
     private Boolean suppressAutoSysField = false;
-    @UriParam(defaultValue = "false")
+    @UriParam(defaultValue = "false", enums = "false,true,all")
     private String displayValue = "false";
-    @UriParam(defaultValue = "false")
+    @UriParam
     private Boolean inputDisplayValue = false;
     @UriParam(prefix = "model.", multiValue = true, javaType = "java.lang.String")
     private Map<String, Class<?>> models;

http://git-wip-us.apache.org/repos/asf/camel/blob/07b48987/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConsumer.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConsumer.java
deleted file mode 100644
index b841ba3..0000000
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConsumer.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.servicenow;
-
-import org.apache.camel.Processor;
-import org.apache.camel.impl.DefaultConsumer;
-
-public class ServiceNowConsumer extends DefaultConsumer {
-    public ServiceNowConsumer(ServiceNowEndpoint endpoint, Processor processor) {
-        super(endpoint, processor);
-    }
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/07b48987/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowEndpoint.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowEndpoint.java
index ebb0229..2fa39a7 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowEndpoint.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowEndpoint.java
@@ -27,19 +27,21 @@ import org.apache.camel.component.servicenow.auth.OAuthToken;
 import org.apache.camel.impl.DefaultEndpoint;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
 
 /**
  * Represents a ServiceNow endpoint.
  */
-@UriEndpoint(scheme = "servicenow", title = "ServiceNow", syntax = "servicenow:instanceName", consumerClass = ServiceNowConsumer.class, label = "api,cloud,management")
+@UriEndpoint(scheme = "servicenow", title = "ServiceNow", syntax = "servicenow:instanceName", producerOnly = true, label = "api,cloud,management")
 public class ServiceNowEndpoint extends DefaultEndpoint {
 
     @UriPath(description = "The ServiceNow instance name ")
     @Metadata(required = "true")
     private final String instanceName;
 
+    @UriParam
     private final ServiceNowConfiguration configuration;
     private final String apiUrl;
     private final String oauthUrl;
@@ -70,12 +72,12 @@ public class ServiceNowEndpoint extends DefaultEndpoint {
 
     @Override
     public Consumer createConsumer(Processor processor) throws Exception {
-        throw new UnsupportedOperationException("Consumer interface is not supported");
+        throw new UnsupportedOperationException("Consumer is not supported");
     }
 
     @Override
     public boolean isSingleton() {
-        return false;
+        return true;
     }
 
     public ServiceNowConfiguration getConfiguration() {