Class Neo4jHealthIndicator
- java.lang.Object
- org.springframework.boot.actuate.health.AbstractHealthIndicator
- org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator
- All Implemented Interfaces:
HealthIndicator
public class Neo4jHealthIndicator extends AbstractHealthIndicator
HealthIndicator
that tests the status of a Neo4j by executing a Cypher statement.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description Neo4jHealthIndicator(org.neo4j.ogm.session.SessionFactory sessionFactory)
Create a newNeo4jHealthIndicator
using the specifiedSessionFactory
.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doHealthCheck(Health.Builder builder)
Actual health check logic.protected void
extractResult(org.neo4j.ogm.session.Session session, Health.Builder builder)
Provide health details using the specifiedSession
andBuilder
.Methods inherited from class org.springframework.boot.actuate.health.AbstractHealthIndicator
health
Constructor Detail
Neo4jHealthIndicator
public Neo4jHealthIndicator(org.neo4j.ogm.session.SessionFactory sessionFactory)
Create a newNeo4jHealthIndicator
using the specifiedSessionFactory
.- Parameters:
sessionFactory
- the SessionFactory
Method Detail
doHealthCheck
protected void doHealthCheck(Health.Builder builder) throws Exception
Description copied from class:AbstractHealthIndicator
Actual health check logic.- Specified by:
doHealthCheck
in classAbstractHealthIndicator
- Parameters:
builder
- theHealth.Builder
to report health status and details- Throws:
Exception
- anyException
that should create aStatus.DOWN
system status.
extractResult
protected void extractResult(org.neo4j.ogm.session.Session session, Health.Builder builder) throws Exception
Provide health details using the specifiedSession
andBuilder
.- Parameters:
session
- the session to use to execute a cypher statementbuilder
- the builder to add details to- Throws:
Exception
- if getting health details failed