Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 01513200B12 for ; Sun, 12 Jun 2016 10:54:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F4052160A06; Sun, 12 Jun 2016 08:54:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CD731160A2C for ; Sun, 12 Jun 2016 10:54:28 +0200 (CEST) Received: (qmail 25402 invoked by uid 500); 12 Jun 2016 08:54:28 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 25381 invoked by uid 99); 12 Jun 2016 08:54:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Jun 2016 08:54:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CB2B6DFB38; Sun, 12 Jun 2016 08:54:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Sun, 12 Jun 2016 08:54:28 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/4] camel git commit: Fixed CS archived-at: Sun, 12 Jun 2016 08:54:30 -0000 Fixed CS Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/40cda471 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/40cda471 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/40cda471 Branch: refs/heads/master Commit: 40cda4711e222d0100746eb797bb6d567ce08be6 Parents: d473d46 Author: Claus Ibsen Authored: Sun Jun 12 10:53:37 2016 +0200 Committer: Claus Ibsen Committed: Sun Jun 12 10:53:37 2016 +0200 ---------------------------------------------------------------------- .../management/mbean/CamelOpenMBeanTypes.java | 47 ++++++++++++-------- .../apache/camel/impl/DefaultCamelContext.java | 21 +-------- .../management/mbean/ManagedCamelContext.java | 7 ++- 3 files changed, 34 insertions(+), 41 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/40cda471/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java index cb39d62..25edc09 100644 --- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java +++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java @@ -36,7 +36,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType listTypeConvertersCompositeType() throws OpenDataException { - return new CompositeType("types", "From/To types", new String[]{"from", "to"}, + return new CompositeType("types", "From/To types", + new String[]{"from", "to"}, new String[]{"From type", "To type"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING}); } @@ -47,10 +48,9 @@ public final class CamelOpenMBeanTypes { } public static CompositeType listRestServicesCompositeType() throws OpenDataException { - return new CompositeType("rests", "Rest Services", new String[]{"url", "baseUrl", "basePath", "uriTemplate", "method", "consumes", - "produces", "inType", "outType", "state", "routeId", "description"}, - new String[]{"Url", "Base Url", "Base Path", "Uri Template", "Method", "Consumes", - "Produces", "Input Type", "Output Type", "State", "Route Id", "Description"}, + return new CompositeType("rests", "Rest Services", + new String[]{"url", "baseUrl", "basePath", "uriTemplate", "method", "consumes", "produces", "inType", "outType", "state", "routeId", "description"}, + new String[]{"Url", "Base Url", "Base Path", "Uri Template", "Method", "Consumes", "Produces", "Input Type", "Output Type", "State", "Route Id", "Description"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); } @@ -61,7 +61,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType listEndpointsCompositeType() throws OpenDataException { - return new CompositeType("endpoints", "Endpoints", new String[]{"url", "static", "dynamic"}, + return new CompositeType("endpoints", "Endpoints", + new String[]{"url", "static", "dynamic"}, new String[]{"Url", "Static", "Dynamic"}, new OpenType[]{SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN}); } @@ -72,7 +73,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType listRuntimeEndpointsCompositeType() throws OpenDataException { - return new CompositeType("endpoints", "Endpoints", new String[]{"index", "url", "routeId", "direction", "static", "dynamic", "hits"}, + return new CompositeType("endpoints", "Endpoints", + new String[]{"index", "url", "routeId", "direction", "static", "dynamic", "hits"}, new String[]{"Index", "Url", "Route Id", "Direction", "Static", "Dynamic", "Hits"}, new OpenType[]{SimpleType.INTEGER, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN, SimpleType.LONG}); } @@ -95,7 +97,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType explainDataFormatsCompositeType() throws OpenDataException { - return new CompositeType("dataformats", "DataFormats", new String[]{"option", "kind", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"}, + return new CompositeType("dataformats", "DataFormats", + new String[]{"option", "kind", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"}, new String[]{"Option", "Kind", "Label", "Type", "Java Type", "Deprecated", "Secret", "Value", "Default Value", "Description"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); @@ -108,7 +111,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType explainEndpointsCompositeType() throws OpenDataException { - return new CompositeType("endpoints", "Endpoints", new String[]{"option", "kind", "group", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"}, + return new CompositeType("endpoints", "Endpoints", + new String[]{"option", "kind", "group", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"}, new String[]{"Option", "Kind", "Group", "Label", "Type", "Java Type", "Deprecated", "Secret", "Value", "Default Value", "Description"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); @@ -120,7 +124,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType explainEipsCompositeType() throws OpenDataException { - return new CompositeType("eips", "EIPs", new String[]{"option", "kind", "label", "type", "java type", "deprecated", "value", "default value", "description"}, + return new CompositeType("eips", "EIPs", + new String[]{"option", "kind", "label", "type", "java type", "deprecated", "value", "default value", "description"}, new String[]{"Option", "Kind", "Label", "Type", "Java Type", "Deprecated", "Value", "Default Value", "Description"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); @@ -132,8 +137,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType listComponentsCompositeType() throws OpenDataException { - return new CompositeType("components", "Components", new String[]{"name", "title", "syntax", "description", "label", "deprecated", - "secret", "status", "type", "groupId", "artifactId", "version"}, + return new CompositeType("components", "Components", + new String[]{"name", "title", "syntax", "description", "label", "deprecated", "secret", "status", "type", "groupId", "artifactId", "version"}, new String[]{"Name", "Title", "Syntax", "Description", "Label", "Deprecated", "Secret", "Status", "Type", "GroupId", "ArtifactId", "Version"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); @@ -145,7 +150,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType listAwaitThreadsCompositeType() throws OpenDataException { - return new CompositeType("threads", "Threads", new String[]{"id", "name", "exchangeId", "routeId", "nodeId", "duration"}, + return new CompositeType("threads", "Threads", + new String[]{"id", "name", "exchangeId", "routeId", "nodeId", "duration"}, new String[]{"Thread Id", "Thread name", "ExchangeId", "RouteId", "NodeId", "Duration"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); } @@ -156,7 +162,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType listEipsCompositeType() throws OpenDataException { - return new CompositeType("eips", "EIPs", new String[]{"name", "title", "description", "label", "status", "type"}, + return new CompositeType("eips", "EIPs", + new String[]{"name", "title", "description", "label", "status", "type"}, new String[]{"Name", "Title", "Description", "Label", "Status", "Type"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); } @@ -167,7 +174,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType listInflightExchangesCompositeType() throws OpenDataException { - return new CompositeType("exchanges", "Exchanges", new String[]{"exchangeId", "fromRouteId", "routeId", "nodeId", "elapsed", "duration"}, + return new CompositeType("exchanges", "Exchanges", + new String[]{"exchangeId", "fromRouteId", "routeId", "nodeId", "elapsed", "duration"}, new String[]{"Exchange Id", "From RouteId", "RouteId", "NodeId", "Elapsed", "Duration"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); } @@ -178,7 +186,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType choiceCompositeType() throws OpenDataException { - return new CompositeType("predicates", "Predicates", new String[]{"predicate", "language", "matches"}, + return new CompositeType("predicates", "Predicates", + new String[]{"predicate", "language", "matches"}, new String[]{"Predicate", "Language", "Matches"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.LONG}); } @@ -189,7 +198,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType loadbalancerExceptionsCompositeType() throws OpenDataException { - return new CompositeType("exceptions", "Exceptions", new String[]{"exception", "failures"}, + return new CompositeType("exceptions", "Exceptions", + new String[]{"exception", "failures"}, new String[]{"Exception", "Failures"}, new OpenType[]{SimpleType.STRING, SimpleType.LONG}); } @@ -200,7 +210,8 @@ public final class CamelOpenMBeanTypes { } public static CompositeType endpointsUtilizationCompositeType() throws OpenDataException { - return new CompositeType("endpoints", "Endpoints", new String[]{"url", "hits"}, + return new CompositeType("endpoints", "Endpoints", + new String[]{"url", "hits"}, new String[]{"Url", "Hits"}, new OpenType[]{SimpleType.STRING, SimpleType.LONG}); } http://git-wip-us.apache.org/repos/asf/camel/blob/40cda471/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java index f3fc577..c325e89 100644 --- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java +++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java @@ -1879,7 +1879,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon if (json == null) { return null; } - List> rows = JsonSchemaHelper.parseJsonSchema("componentProperties", json, true); // selected rows to use for answer @@ -1892,12 +1891,10 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon for (Map.Entry entry : options.entrySet()) { String name = entry.getKey(); - // skip unwanted options which is default inherited from DefaultComponent if ("camelContext".equals(name) || "endpointClass".equals(name)) { continue; } - String value = ""; if (entry.getValue() != null) { value = entry.getValue().toString(); @@ -1930,7 +1927,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon break; } } - // add as selected row selected.put(name, new String[]{name, kind, group, label, required, type, javaType, deprecated, secret, value, defaultValue, description}); } @@ -1950,7 +1946,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon String secret = row.get("secret"); value = URISupport.sanitizePath(value); String description = row.get("description"); - // always include path options if (includeAllOptions) { // add as selected row @@ -1961,7 +1956,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon } json = ObjectHelper.before(json, " \"componentProperties\": {"); - StringBuilder buffer = new StringBuilder(" \"componentProperties\": {"); boolean first = true; @@ -2027,28 +2021,24 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon } buffer.append(" }"); } - buffer.append("\n }\n}\n"); - // insert the original first part of the json into the start of the buffer buffer.insert(0, json); return buffer.toString(); - } catch (Exception e) { // ignore and return empty response return null; } } + // CHECKSTYLE:OFF public String explainEndpointJson(String uri, boolean includeAllOptions) { try { URI u = new URI(uri); - String json = getComponentParameterJsonSchema(u.getScheme()); if (json == null) { return null; } - List> rows = JsonSchemaHelper.parseJsonSchema("properties", json, true); // selected rows to use for answer @@ -2070,7 +2060,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon value = entry.getValue().toString(); } value = URISupport.sanitizePath(value); - // find type and description from the json schema String type = null; String kind = null; @@ -2097,7 +2086,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon break; } } - // remember this option from the uri uriOptions.put(name, new String[]{name, kind, group, label, required, type, javaType, deprecated, secret, value, defaultValue, description}); } @@ -2117,9 +2105,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon String secret = row.get("secret"); value = URISupport.sanitizePath(value); String description = row.get("description"); - boolean isUriOption = uriOptions.containsKey(name); - // always include from uri or path options if (includeAllOptions || isUriOption || "path".equals(kind)) { if (!selected.containsKey(name)) { @@ -2135,7 +2121,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon // skip component properties json = ObjectHelper.before(json, " \"componentProperties\": {"); - // and rewrite properties StringBuilder buffer = new StringBuilder(" \"properties\": {"); @@ -2202,18 +2187,16 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon } buffer.append(" }"); } - buffer.append("\n }\n}\n"); - // insert the original first part of the json into the start of the buffer buffer.insert(0, json); return buffer.toString(); - } catch (Exception e) { // ignore and return empty response return null; } } + // CHECKSTYLE:ON public String createRouteStaticEndpointJson(String routeId) { // lets include dynamic as well as we want as much data as possible http://git-wip-us.apache.org/repos/asf/camel/blob/40cda471/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java index f4ea29b..98be807 100644 --- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java +++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java @@ -703,10 +703,9 @@ public class ManagedCamelContext extends ManagedPerformanceCounter implements Ti } CompositeType ct = CamelOpenMBeanTypes.listComponentsCompositeType(); - CompositeData data = new CompositeDataSupport(ct, new String[]{"name", "title", "syntax", "description", "label", "deprecated", "secret", - "status", "type", "groupId", "artifactId", "version"}, - new Object[]{name, title, syntax, description, label, deprecated, secret, - status, type, groupId, artifactId, version}); + CompositeData data = new CompositeDataSupport(ct, + new String[]{"name", "title", "syntax", "description", "label", "deprecated", "secret", "status", "type", "groupId", "artifactId", "version"}, + new Object[]{name, title, syntax, description, label, deprecated, secret, status, type, groupId, artifactId, version}); answer.put(data); } return answer;