public abstract class AbstractActuatorTemplate extends Object implements ActuatorOperations
| Modifier and Type | Field and Description |
|---|---|
protected AppDeployer |
appDeployer |
protected org.apache.commons.logging.Log |
logger |
protected org.springframework.web.client.RestTemplate |
restTemplate |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractActuatorTemplate(org.springframework.web.client.RestTemplate restTemplate,
AppDeployer appDeployer,
AppAdmin appAdmin) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract String |
actuatorUrlForInstance(AppInstanceStatus appInstanceStatus) |
protected String |
getActuatorUrl(AppInstanceStatus appInstanceStatus) |
<T> T |
getFromActuator(String deploymentId,
String guid,
String endpoint,
Class<T> responseType,
Optional<org.springframework.http.HttpHeaders> optionalRequestHeaders)
Get a resource from an actuator path.
|
protected Optional<org.springframework.http.HttpHeaders> |
httpHeadersForInstance(AppInstanceStatus appInstanceStatus)
Hook to allow subclasses to add special headers derived
AppInstanceStatus metadata if necessary. |
<T,R> R |
postToActuator(String deploymentId,
String guid,
String endpoint,
T body,
Class<R> responseType,
Optional<org.springframework.http.HttpHeaders> optionalRequestHeaders)
Post to resource on actuator path.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFromActuator, getFromActuator, getFromActuator, postToActuatorprotected final org.apache.commons.logging.Log logger
protected final org.springframework.web.client.RestTemplate restTemplate
protected final AppDeployer appDeployer
protected AbstractActuatorTemplate(org.springframework.web.client.RestTemplate restTemplate,
AppDeployer appDeployer,
AppAdmin appAdmin)
public <T> T getFromActuator(String deploymentId, String guid, String endpoint, Class<T> responseType, Optional<org.springframework.http.HttpHeaders> optionalRequestHeaders)
ActuatorOperationsgetFromActuator in interface ActuatorOperationsT - type of the response.deploymentId - the deployment ID of the deployed app.guid - unique id for the app instance.endpoint - the endpoint path relative to the base actuator URL for the instance, with or without preceding '/'.responseType - the expected response type.optionalRequestHeaders - optional request headers.public <T,R> R postToActuator(String deploymentId, String guid, String endpoint, T body, Class<R> responseType, Optional<org.springframework.http.HttpHeaders> optionalRequestHeaders)
ActuatorOperationspostToActuator in interface ActuatorOperationsT - type of the body.R - type of the response.deploymentId - the deployment ID of the deployed app.guid - unique id for the app instance.endpoint - the endpoint path relative to the base actuator URL for the instance, with or without preceding '/'.body - the request body.responseType - the expected response type.optionalRequestHeaders - optional request headers.protected final String getActuatorUrl(AppInstanceStatus appInstanceStatus)
protected abstract String actuatorUrlForInstance(AppInstanceStatus appInstanceStatus)
protected Optional<org.springframework.http.HttpHeaders> httpHeadersForInstance(AppInstanceStatus appInstanceStatus)
AppInstanceStatus metadata if necessary.appInstanceStatus - the AppInstanceStatus for the target instance.Copyright © 2023 Pivotal Software, Inc.. All rights reserved.