001/** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.camel.api.management.mbean; 018 019import javax.management.openmbean.CompositeType; 020import javax.management.openmbean.OpenDataException; 021import javax.management.openmbean.OpenType; 022import javax.management.openmbean.SimpleType; 023import javax.management.openmbean.TabularType; 024 025/** 026 * Various JMX openmbean types used by Camel. 027 */ 028public final class CamelOpenMBeanTypes { 029 030 private CamelOpenMBeanTypes() { 031 } 032 033 public static TabularType listTypeConvertersTabularType() throws OpenDataException { 034 CompositeType ct = listTypeConvertersCompositeType(); 035 return new TabularType("listTypeConverters", "Lists all the type converters in the registry (from -> to)", ct, new String[]{"from", "to"}); 036 } 037 038 public static CompositeType listTypeConvertersCompositeType() throws OpenDataException { 039 return new CompositeType("types", "From/To types", 040 new String[]{"from", "to"}, 041 new String[]{"From type", "To type"}, 042 new OpenType[]{SimpleType.STRING, SimpleType.STRING}); 043 } 044 045 public static TabularType listRestServicesTabularType() throws OpenDataException { 046 CompositeType ct = listRestServicesCompositeType(); 047 return new TabularType("listRestServices", "Lists all the rest services in the registry", ct, new String[]{"url", "method"}); 048 } 049 050 public static CompositeType listRestServicesCompositeType() throws OpenDataException { 051 return new CompositeType("rests", "Rest Services", 052 new String[]{"url", "baseUrl", "basePath", "uriTemplate", "method", "consumes", "produces", "inType", "outType", "state", "routeId", "description"}, 053 new String[]{"Url", "Base Url", "Base Path", "Uri Template", "Method", "Consumes", "Produces", "Input Type", "Output Type", "State", "Route Id", "Description"}, 054 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, 055 SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); 056 } 057 058 public static TabularType listEndpointsTabularType() throws OpenDataException { 059 CompositeType ct = listEndpointsCompositeType(); 060 return new TabularType("listEndpoints", "Lists all the endpoints in the registry", ct, new String[]{"url"}); 061 } 062 063 public static CompositeType listEndpointsCompositeType() throws OpenDataException { 064 return new CompositeType("endpoints", "Endpoints", 065 new String[]{"url", "static", "dynamic"}, 066 new String[]{"Url", "Static", "Dynamic"}, 067 new OpenType[]{SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN}); 068 } 069 070 public static TabularType listRuntimeEndpointsTabularType() throws OpenDataException { 071 CompositeType ct = listRuntimeEndpointsCompositeType(); 072 return new TabularType("listRuntimeEndpoints", "Lists all the input and output endpoints gathered during runtime", ct, new String[]{"index"}); 073 } 074 075 public static CompositeType listRuntimeEndpointsCompositeType() throws OpenDataException { 076 return new CompositeType("endpoints", "Endpoints", 077 new String[]{"index", "url", "routeId", "direction", "static", "dynamic", "hits"}, 078 new String[]{"Index", "Url", "Route Id", "Direction", "Static", "Dynamic", "Hits"}, 079 new OpenType[]{SimpleType.INTEGER, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN, SimpleType.LONG}); 080 } 081 082 public static TabularType explainComponentTabularType() throws OpenDataException { 083 CompositeType ct = explainComponentCompositeType(); 084 return new TabularType("explainComponent", "Explain how this component is configured", ct, new String[]{"option"}); 085 } 086 087 public static CompositeType explainComponentCompositeType() throws OpenDataException { 088 return new CompositeType("components", "Components", new String[]{"option", "kind", "group", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"}, 089 new String[]{"Option", "Kind", "Group", "Label", "Type", "Java Type", "Deprecated", "Secret", "Value", "Default Value", "Description"}, 090 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, 091 SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); 092 } 093 094 public static TabularType explainDataFormatTabularType() throws OpenDataException { 095 CompositeType ct = explainDataFormatsCompositeType(); 096 return new TabularType("explainDataFormat", "Explain how this dataformat is configured", ct, new String[]{"option"}); 097 } 098 099 public static CompositeType explainDataFormatsCompositeType() throws OpenDataException { 100 return new CompositeType("dataformats", "DataFormats", 101 new String[]{"option", "kind", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"}, 102 new String[]{"Option", "Kind", "Label", "Type", "Java Type", "Deprecated", "Secret", "Value", "Default Value", "Description"}, 103 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, 104 SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); 105 } 106 107 108 public static TabularType explainEndpointTabularType() throws OpenDataException { 109 CompositeType ct = explainEndpointsCompositeType(); 110 return new TabularType("explainEndpoint", "Explain how this endpoint is configured", ct, new String[]{"option"}); 111 } 112 113 public static CompositeType explainEndpointsCompositeType() throws OpenDataException { 114 return new CompositeType("endpoints", "Endpoints", 115 new String[]{"option", "kind", "group", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"}, 116 new String[]{"Option", "Kind", "Group", "Label", "Type", "Java Type", "Deprecated", "Secret", "Value", "Default Value", "Description"}, 117 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, 118 SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); 119 } 120 121 public static TabularType explainEipTabularType() throws OpenDataException { 122 CompositeType ct = explainEipsCompositeType(); 123 return new TabularType("explainEip", "Explain how this EIP is configured", ct, new String[]{"option"}); 124 } 125 126 public static CompositeType explainEipsCompositeType() throws OpenDataException { 127 return new CompositeType("eips", "EIPs", 128 new String[]{"option", "kind", "label", "type", "java type", "deprecated", "value", "default value", "description"}, 129 new String[]{"Option", "Kind", "Label", "Type", "Java Type", "Deprecated", "Value", "Default Value", "Description"}, 130 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, 131 SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); 132 } 133 134 public static TabularType listComponentsTabularType() throws OpenDataException { 135 CompositeType ct = listComponentsCompositeType(); 136 return new TabularType("listComponents", "Lists all the components", ct, new String[]{"name"}); 137 } 138 139 public static CompositeType listComponentsCompositeType() throws OpenDataException { 140 return new CompositeType("components", "Components", 141 new String[]{"name", "title", "syntax", "description", "label", "deprecated", "secret", "status", "type", "groupId", "artifactId", "version"}, 142 new String[]{"Name", "Title", "Syntax", "Description", "Label", "Deprecated", "Secret", "Status", "Type", "GroupId", "ArtifactId", "Version"}, 143 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, 144 SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); 145 } 146 147 public static TabularType listAwaitThreadsTabularType() throws OpenDataException { 148 CompositeType ct = listAwaitThreadsCompositeType(); 149 return new TabularType("listAwaitThreads", "Lists blocked threads by the routing engine", ct, new String[]{"id"}); 150 } 151 152 public static CompositeType listAwaitThreadsCompositeType() throws OpenDataException { 153 return new CompositeType("threads", "Threads", 154 new String[]{"id", "name", "exchangeId", "routeId", "nodeId", "duration"}, 155 new String[]{"Thread Id", "Thread name", "ExchangeId", "RouteId", "NodeId", "Duration"}, 156 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); 157 } 158 159 public static TabularType listEipsTabularType() throws OpenDataException { 160 CompositeType ct = listEipsCompositeType(); 161 return new TabularType("listEips", "Lists all the EIPs", ct, new String[]{"name"}); 162 } 163 164 public static CompositeType listEipsCompositeType() throws OpenDataException { 165 return new CompositeType("eips", "EIPs", 166 new String[]{"name", "title", "description", "label", "status", "type"}, 167 new String[]{"Name", "Title", "Description", "Label", "Status", "Type"}, 168 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); 169 } 170 171 public static TabularType listInflightExchangesTabularType() throws OpenDataException { 172 CompositeType ct = listInflightExchangesCompositeType(); 173 return new TabularType("listInflightExchanges", "Lists inflight exchanges", ct, new String[]{"exchangeId"}); 174 } 175 176 public static CompositeType listInflightExchangesCompositeType() throws OpenDataException { 177 return new CompositeType("exchanges", "Exchanges", 178 new String[]{"exchangeId", "fromRouteId", "routeId", "nodeId", "elapsed", "duration"}, 179 new String[]{"Exchange Id", "From RouteId", "RouteId", "NodeId", "Elapsed", "Duration"}, 180 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING}); 181 } 182 183 public static TabularType choiceTabularType() throws OpenDataException { 184 CompositeType ct = choiceCompositeType(); 185 return new TabularType("choice", "Choice statistics", ct, new String[]{"predicate"}); 186 } 187 188 public static CompositeType choiceCompositeType() throws OpenDataException { 189 return new CompositeType("predicates", "Predicates", 190 new String[]{"predicate", "language", "matches"}, 191 new String[]{"Predicate", "Language", "Matches"}, 192 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.LONG}); 193 } 194 195 public static TabularType loadbalancerExceptionsTabularType() throws OpenDataException { 196 CompositeType ct = loadbalancerExceptionsCompositeType(); 197 return new TabularType("exception", "Exception statistics", ct, new String[]{"exception"}); 198 } 199 200 public static CompositeType loadbalancerExceptionsCompositeType() throws OpenDataException { 201 return new CompositeType("exceptions", "Exceptions", 202 new String[]{"exception", "failures"}, 203 new String[]{"Exception", "Failures"}, 204 new OpenType[]{SimpleType.STRING, SimpleType.LONG}); 205 } 206 207 public static TabularType endpointsUtilizationTabularType() throws OpenDataException { 208 CompositeType ct = endpointsUtilizationCompositeType(); 209 return new TabularType("endpointsUtilization", "Endpoint utilization statistics", ct, new String[]{"url"}); 210 } 211 212 public static CompositeType endpointsUtilizationCompositeType() throws OpenDataException { 213 return new CompositeType("endpoints", "Endpoints", 214 new String[]{"url", "hits"}, 215 new String[]{"Url", "Hits"}, 216 new OpenType[]{SimpleType.STRING, SimpleType.LONG}); 217 } 218 219 public static TabularType listTransformersTabularType() throws OpenDataException { 220 CompositeType ct = listTransformersCompositeType(); 221 return new TabularType("listTransformers", "Lists all the transformers in the registry", ct, new String[]{"scheme", "from", "to"}); 222 } 223 224 public static CompositeType listTransformersCompositeType() throws OpenDataException { 225 return new CompositeType("transformers", "Transformers", 226 new String[]{"scheme", "from", "to", "static", "dynamic", "description"}, 227 new String[]{"Scheme", "From", "To", "Static", "Dynamic", "Description"}, 228 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, 229 SimpleType.BOOLEAN, SimpleType.BOOLEAN, SimpleType.STRING}); 230 } 231 232 public static TabularType listValidatorsTabularType() throws OpenDataException { 233 CompositeType ct = listValidatorsCompositeType(); 234 return new TabularType("listValidators", "Lists all the validators in the registry", ct, new String[]{"type"}); 235 } 236 237 public static CompositeType listValidatorsCompositeType() throws OpenDataException { 238 return new CompositeType("validators", "Validators", 239 new String[]{"type", "static", "dynamic", "description"}, 240 new String[]{"Type", "Static", "Dynamic", "Description"}, 241 new OpenType[]{SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN, SimpleType.STRING}); 242 } 243 244 245 246 247 public static CompositeType camelHealthDetailsCompositeType() throws OpenDataException { 248 return new CompositeType("healthDetails", "Health Details", 249 new String[]{"id", "group", "state", "enabled", "interval", "failureThreshold"}, 250 new String[]{"ID", "Group", "State", "Enabled", "Interval", "Failure Threshold"}, 251 new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.LONG, SimpleType.INTEGER}); 252 } 253 254 public static TabularType camelHealthDetailsTabularType() throws OpenDataException { 255 CompositeType ct = camelHealthDetailsCompositeType(); 256 return new TabularType("healthDetails", "Health Details", ct, new String[]{"id"}); 257 } 258}