Search in sources :

Example 1 with WebServerNamespace

use of org.springframework.boot.actuate.endpoint.web.WebServerNamespace in project spring-boot by spring-projects.

the class AdditionalHealthEndpointPath method from.

/**
 * Creates an {@link AdditionalHealthEndpointPath} from the given input. The input
 * must contain a prefix and value separated by a `:`. The value must be limited to
 * one path segment. For example, `server:/healthz`.
 * @param value the value to parse
 * @return the new instance
 */
public static AdditionalHealthEndpointPath from(String value) {
    Assert.hasText(value, "Value must not be null");
    String[] values = value.split(":");
    Assert.isTrue(values.length == 2, "Value must contain a valid namespace and value separated by ':'.");
    Assert.isTrue(StringUtils.hasText(values[0]), "Value must contain a valid namespace.");
    WebServerNamespace namespace = WebServerNamespace.from(values[0]);
    validateValue(values[1]);
    return new AdditionalHealthEndpointPath(namespace, values[1]);
}
Also used : WebServerNamespace(org.springframework.boot.actuate.endpoint.web.WebServerNamespace)

Example 2 with WebServerNamespace

use of org.springframework.boot.actuate.endpoint.web.WebServerNamespace in project spring-boot by spring-projects.

the class CachingOperationInvoker method getCacheKey.

private CacheKey getCacheKey(InvocationContext context) {
    ApiVersion contextApiVersion = context.resolveArgument(ApiVersion.class);
    Principal principal = context.resolveArgument(Principal.class);
    WebServerNamespace serverNamespace = context.resolveArgument(WebServerNamespace.class);
    return new CacheKey(contextApiVersion, principal, serverNamespace);
}
Also used : ApiVersion(org.springframework.boot.actuate.endpoint.ApiVersion) WebServerNamespace(org.springframework.boot.actuate.endpoint.web.WebServerNamespace) Principal(java.security.Principal)

Aggregations

WebServerNamespace (org.springframework.boot.actuate.endpoint.web.WebServerNamespace)2 Principal (java.security.Principal)1 ApiVersion (org.springframework.boot.actuate.endpoint.ApiVersion)1