Class HealthCheckMetadata
- java.lang.Object
-
- org.apache.felix.hc.api.execution.HealthCheckMetadata
-
@ProviderType public class HealthCheckMetadata extends java.lang.Object
This class helps retrieving meta data information about a health check service.- Since:
- 1.1
-
-
Constructor Summary
Constructors Constructor Description HealthCheckMetadata(ServiceReference ref)Creates a HealthCheckMetadata from an OSGi service based on the service properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetAsyncCronExpression()Return the cron expression used for asynchronous execution.java.lang.LonggetAsyncIntervalInSec()Return the interval in sec used for asynchronous execution.java.lang.LonggetKeepNonOkResultsStickyForSec()Makes non-ok results stick for the given amount of time.java.lang.StringgetMBeanName()The mbean name of the health check as defined through theHealthCheck.MBEAN_NAMEproperty.java.lang.StringgetName()The name of the health check as defined through theHealthCheck.NAMEproperty.java.lang.LonggetResultCacheTtlInMs()TTL for the result cache in ms.longgetServiceId()Return the service id.ServiceReferencegetServiceReference()Get the service reference.java.util.List<java.lang.String>getTags()Return the list of defined tags for this check as set throughtagsjava.lang.StringgetTitle()The title of the health check.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
HealthCheckMetadata
public HealthCheckMetadata(ServiceReference ref)
Creates a HealthCheckMetadata from an OSGi service based on the service properties.- Parameters:
ref- the ServiceReference for the HC service
-
-
Method Detail
-
getName
public java.lang.String getName()
The name of the health check as defined through theHealthCheck.NAMEproperty.- Returns:
- The name or
null
-
getMBeanName
public java.lang.String getMBeanName()
The mbean name of the health check as defined through theHealthCheck.MBEAN_NAMEproperty.- Returns:
- The mbean name or
null
-
getTitle
public java.lang.String getTitle()
The title of the health check. If the health check has a name, this is used as the title. Otherwise the description, PID and service ID are checked for values.- Returns:
- The computed title
-
getTags
public java.util.List<java.lang.String> getTags()
Return the list of defined tags for this check as set throughtags- Returns:
- list of tags (may be empty but never returns
null)
-
getAsyncCronExpression
public java.lang.String getAsyncCronExpression()
Return the cron expression used for asynchronous execution.- Returns:
- the async cron expression (or
nullif not set)
-
getAsyncIntervalInSec
public java.lang.Long getAsyncIntervalInSec()
Return the interval in sec used for asynchronous execution.- Returns:
- the async interval (or
nullif not set)
-
getServiceId
public long getServiceId()
Return the service id.- Returns:
- the service id (never
null)
-
getServiceReference
public ServiceReference getServiceReference()
Get the service reference.- Returns:
- the service reference (never
null)
-
getResultCacheTtlInMs
public java.lang.Long getResultCacheTtlInMs()
TTL for the result cache in ms.- Returns:
- TTL for the result cache or
nullif not configured.
-
getKeepNonOkResultsStickyForSec
public java.lang.Long getKeepNonOkResultsStickyForSec()
Makes non-ok results stick for the given amount of time.- Returns:
- Time to make non-ok results sticky in seconds.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-