This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push: new 3c0bd87 Remove unusued code 3c0bd87 is described below commit 3c0bd87663258bc898b1dbddaa007a97a9c8a1d8 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Mar 24 13:18:44 2022 +0100 Remove unusued code --- .../camel/spring/boot/model/RouteDetails.java | 216 --------------------- .../camel/spring/boot/model/RouteDetailsInfo.java | 42 ---- .../apache/camel/spring/boot/model/RouteInfo.java | 73 ------- 3 files changed, 331 deletions(-) diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/model/RouteDetails.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/model/RouteDetails.java deleted file mode 100644 index 2bd137c..0000000 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/model/RouteDetails.java +++ /dev/null @@ -1,216 +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.spring.boot.model; - -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonInclude; -import org.apache.camel.api.management.mbean.ManagedRouteMBean; -import org.apache.camel.api.management.mbean.RouteError; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class RouteDetails { - - private long deltaProcessingTime; - - private long exchangesInflight; - - private long exchangesTotal; - - private long externalRedeliveries; - - private long failuresHandled; - - private String firstExchangeCompletedExchangeId; - - private Date firstExchangeCompletedTimestamp; - - private String firstExchangeFailureExchangeId; - - private Date firstExchangeFailureTimestamp; - - private String lastExchangeCompletedExchangeId; - - private Date lastExchangeCompletedTimestamp; - - private String lastExchangeFailureExchangeId; - - private Date lastExchangeFailureTimestamp; - - private long lastProcessingTime; - - private String load01; - - private String load05; - - private String load15; - - private long maxProcessingTime; - - private long meanProcessingTime; - - private long minProcessingTime; - - private Long oldestInflightDuration; - - private String oldestInflightExchangeId; - - private long redeliveries; - - private long totalProcessingTime; - - private RouteError lastError; - - private boolean hasRouteController; - - public RouteDetails(ManagedRouteMBean managedRoute) { - try { - this.deltaProcessingTime = managedRoute.getDeltaProcessingTime(); - this.exchangesInflight = managedRoute.getExchangesInflight(); - this.exchangesTotal = managedRoute.getExchangesTotal(); - this.externalRedeliveries = managedRoute.getExternalRedeliveries(); - this.failuresHandled = managedRoute.getFailuresHandled(); - this.firstExchangeCompletedExchangeId = managedRoute.getFirstExchangeCompletedExchangeId(); - this.firstExchangeCompletedTimestamp = managedRoute.getFirstExchangeCompletedTimestamp(); - this.firstExchangeFailureExchangeId = managedRoute.getFirstExchangeFailureExchangeId(); - this.firstExchangeFailureTimestamp = managedRoute.getFirstExchangeFailureTimestamp(); - this.lastExchangeCompletedExchangeId = managedRoute.getLastExchangeCompletedExchangeId(); - this.lastExchangeCompletedTimestamp = managedRoute.getLastExchangeCompletedTimestamp(); - this.lastExchangeFailureExchangeId = managedRoute.getLastExchangeFailureExchangeId(); - this.lastExchangeFailureTimestamp = managedRoute.getLastExchangeFailureTimestamp(); - this.lastProcessingTime = managedRoute.getLastProcessingTime(); - this.load01 = managedRoute.getLoad01(); - this.load05 = managedRoute.getLoad05(); - this.load15 = managedRoute.getLoad15(); - this.maxProcessingTime = managedRoute.getMaxProcessingTime(); - this.meanProcessingTime = managedRoute.getMeanProcessingTime(); - this.minProcessingTime = managedRoute.getMinProcessingTime(); - this.oldestInflightDuration = managedRoute.getOldestInflightDuration(); - this.oldestInflightExchangeId = managedRoute.getOldestInflightExchangeId(); - this.redeliveries = managedRoute.getRedeliveries(); - this.totalProcessingTime = managedRoute.getTotalProcessingTime(); - this.lastError = managedRoute.getLastError(); - this.hasRouteController = managedRoute.getHasRouteController(); - } catch (Exception e) { - // Ignore - } - } - - public long getDeltaProcessingTime() { - return deltaProcessingTime; - } - - public long getExchangesInflight() { - return exchangesInflight; - } - - public long getExchangesTotal() { - return exchangesTotal; - } - - public long getExternalRedeliveries() { - return externalRedeliveries; - } - - public long getFailuresHandled() { - return failuresHandled; - } - - public String getFirstExchangeCompletedExchangeId() { - return firstExchangeCompletedExchangeId; - } - - public Date getFirstExchangeCompletedTimestamp() { - return firstExchangeCompletedTimestamp; - } - - public String getFirstExchangeFailureExchangeId() { - return firstExchangeFailureExchangeId; - } - - public Date getFirstExchangeFailureTimestamp() { - return firstExchangeFailureTimestamp; - } - - public String getLastExchangeCompletedExchangeId() { - return lastExchangeCompletedExchangeId; - } - - public Date getLastExchangeCompletedTimestamp() { - return lastExchangeCompletedTimestamp; - } - - public String getLastExchangeFailureExchangeId() { - return lastExchangeFailureExchangeId; - } - - public Date getLastExchangeFailureTimestamp() { - return lastExchangeFailureTimestamp; - } - - public long getLastProcessingTime() { - return lastProcessingTime; - } - - public String getLoad01() { - return load01; - } - - public String getLoad05() { - return load05; - } - - public String getLoad15() { - return load15; - } - - public long getMaxProcessingTime() { - return maxProcessingTime; - } - - public long getMeanProcessingTime() { - return meanProcessingTime; - } - - public long getMinProcessingTime() { - return minProcessingTime; - } - - public Long getOldestInflightDuration() { - return oldestInflightDuration; - } - - public String getOldestInflightExchangeId() { - return oldestInflightExchangeId; - } - - public long getRedeliveries() { - return redeliveries; - } - - public long getTotalProcessingTime() { - return totalProcessingTime; - } - - public RouteError getLastError() { - return lastError; - } - - public boolean getHasRouteController() { - return hasRouteController; - } -} diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/model/RouteDetailsInfo.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/model/RouteDetailsInfo.java deleted file mode 100644 index fbcfe69..0000000 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/model/RouteDetailsInfo.java +++ /dev/null @@ -1,42 +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.spring.boot.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.camel.CamelContext; -import org.apache.camel.Route; -import org.apache.camel.api.management.ManagedCamelContext; - -/** - * Container for exposing {@link org.apache.camel.Route} information - * with route details as JSON. Route details are retrieved from JMX. - */ -public class RouteDetailsInfo extends RouteInfo { - - @JsonProperty("details") - private RouteDetails routeDetails; - - public RouteDetailsInfo(final CamelContext camelContext, final Route route) { - super(route); - - ManagedCamelContext mc = camelContext.getExtension(ManagedCamelContext.class); - if (mc != null) { - this.routeDetails = new RouteDetails(mc.getManagedRoute(route.getId())); - } - } - -} diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/model/RouteInfo.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/model/RouteInfo.java deleted file mode 100644 index e858214..0000000 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/model/RouteInfo.java +++ /dev/null @@ -1,73 +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.spring.boot.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import org.apache.camel.Route; -import org.apache.camel.StatefulService; - -/** - * Container for exposing {@link org.apache.camel.Route} information as JSON. - */ -@JsonPropertyOrder({"id", "description", "uptime", "uptimeMillis"}) -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class RouteInfo { - - private final String id; - - private final String description; - - private final String uptime; - - private final long uptimeMillis; - - private final String status; - - public RouteInfo(Route route) { - this.id = route.getId(); - this.description = route.getDescription(); - this.uptime = route.getUptime(); - this.uptimeMillis = route.getUptimeMillis(); - - if (route instanceof StatefulService) { - this.status = ((StatefulService) route).getStatus().name(); - } else { - this.status = null; - } - } - - public String getId() { - return id; - } - - public String getDescription() { - return description; - } - - public String getUptime() { - return uptime; - } - - public long getUptimeMillis() { - return uptimeMillis; - } - - public String getStatus() { - return status; - } -}