001/*
002 * Copyright 2012-2018 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.boot.actuate.autoconfigure.cloudfoundry.servlet;
018
019import org.springframework.boot.actuate.autoconfigure.cloudfoundry.HealthEndpointCloudFoundryExtension;
020import org.springframework.boot.actuate.endpoint.annotation.EndpointExtension;
021import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
022import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
023import org.springframework.boot.actuate.health.Health;
024import org.springframework.boot.actuate.health.HealthEndpoint;
025import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
026import org.springframework.boot.actuate.health.ShowDetails;
027
028/**
029 * {@link EndpointExtension} for the {@link HealthEndpoint} that always exposes full
030 * health details.
031 *
032 * @author Madhura Bhave
033 * @since 2.0.0
034 */
035@HealthEndpointCloudFoundryExtension
036public class CloudFoundryHealthEndpointWebExtension {
037
038        private final HealthEndpointWebExtension delegate;
039
040        public CloudFoundryHealthEndpointWebExtension(HealthEndpointWebExtension delegate) {
041                this.delegate = delegate;
042        }
043
044        @ReadOperation
045        public WebEndpointResponse<Health> getHealth() {
046                return this.delegate.getHealth(null, ShowDetails.ALWAYS);
047        }
048
049}