L - the type of the protocol specific location, typically a subclass of NodeLocationS - the protocol specific Sessionpublic abstract class EndpointService<L,S extends Session<L>> extends Object implements SamplingService<L>
MonitoredEndpoint. This service also owns the single
ResourceManager associated with the given MonitoredEndpoint.| Modifier and Type | Field and Description |
|---|---|
protected ServiceStatus |
status |
| Constructor and Description |
|---|
EndpointService(String feedId,
MonitoredEndpoint<MonitorServiceConfiguration.EndpointConfiguration> endpoint,
ResourceTypeManager<L> resourceTypeManager,
LocationResolver<L> locationResolver,
ProtocolDiagnostics diagnostics) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInventoryListener(InventoryListener listener)
|
void |
discoverAll()
Discovers all resources, puts them in the
resourceManager,
and triggers any listeners listening for new inventory. |
boolean |
equals(Object obj) |
String |
generateAssociatedMetricId(MeasurementInstance<L,? extends MeasurementType<L>> instance)
Given a measurement instance, this will generate the key to be used when
storing that measurement instance's collected data to storage.
|
Map<String,String> |
generateAssociatedMetricTags(MeasurementInstance<L,? extends MeasurementType<L>> instance)
Given a measurement instance, this will generate the tags to be added to the
associated Hawkular Metrics metric definition.
|
ProtocolDiagnostics |
getDiagnostics() |
String |
getFeedId() |
LocationResolver<L> |
getLocationResolver() |
MonitoredEndpoint<MonitorServiceConfiguration.EndpointConfiguration> |
getMonitoredEndpoint() |
ResourceManager<L> |
getResourceManager() |
ResourceTypeManager<L> |
getResourceTypeManager() |
int |
hashCode() |
void |
measureAvails(Collection<MeasurementInstance<L,AvailType<L>>> instances,
Consumer<AvailDataPoint> consumer)
Checks the availabilities defined by
instances and reports them back to the given consumer. |
void |
measureMetrics(Collection<MeasurementInstance<L,MetricType<L>>> instances,
Consumer<MetricDataPoint> consumer)
Collects the metrics defined by
instances and reports them back to the given consumer. |
abstract S |
openSession()
Opens a new protocl specific
Session - do not forget to close it! |
void |
removeInventoryListener(InventoryListener listener)
|
void |
removeResources(L location)
Remove resources matching the given
location and all their direct and indirect descendant resources. |
void |
start() |
void |
stop() |
String |
toString() |
protected volatile ServiceStatus status
public EndpointService(String feedId, MonitoredEndpoint<MonitorServiceConfiguration.EndpointConfiguration> endpoint, ResourceTypeManager<L> resourceTypeManager, LocationResolver<L> locationResolver, ProtocolDiagnostics diagnostics)
public String getFeedId()
public MonitoredEndpoint<MonitorServiceConfiguration.EndpointConfiguration> getMonitoredEndpoint()
getMonitoredEndpoint in interface SamplingService<L>public ResourceManager<L> getResourceManager()
public ResourceTypeManager<L> getResourceTypeManager()
public LocationResolver<L> getLocationResolver()
public ProtocolDiagnostics getDiagnostics()
public void addInventoryListener(InventoryListener listener)
listener - to addpublic void removeInventoryListener(InventoryListener listener)
listener - to removepublic abstract S openSession()
Session - do not forget to close it!Sessionpublic void discoverAll()
resourceManager,
and triggers any listeners listening for new inventory.
This will look for all root resources (resources whose types are that of the root resource types
as defined by ResourceTypeManager.getRootResourceTypes() and then obtain all their
children (recursively down to all descendents). Effectively, this discovers the full
resource hierarchy.public void measureAvails(Collection<MeasurementInstance<L,AvailType<L>>> instances, Consumer<AvailDataPoint> consumer)
SamplingServiceinstances and reports them back to the given consumer.
If the relevant Endpoint is unreachable all instances are reported as Avail.DOWN.measureAvails in interface SamplingService<L>instances - the availabilities to checkconsumer - the consumer to send the results topublic void measureMetrics(Collection<MeasurementInstance<L,MetricType<L>>> instances, Consumer<MetricDataPoint> consumer)
SamplingServiceinstances and reports them back to the given consumer.measureMetrics in interface SamplingService<L>instances - the metrics to checkconsumer - the consumer to send the results topublic String generateAssociatedMetricId(MeasurementInstance<L,? extends MeasurementType<L>> instance)
SamplingServicethe endpoint configuration which contains a
metric ID template.
If this method is not implemented, the default behavior is to return the ID of
the measurement instance itself.generateAssociatedMetricId in interface SamplingService<L>instance - the measurement instance whose key is to be generatedMeasurementInstance#getAssociatedMetricId(String),
MeasurementInstance.setAssociatedMetricId(String)public Map<String,String> generateAssociatedMetricTags(MeasurementInstance<L,? extends MeasurementType<L>> instance)
SamplingServicethe endpoint configuration which contains
the metric tags.generateAssociatedMetricTags in interface SamplingService<L>instance - the measurement instance whose tags are to be generatedpublic void removeResources(L location)
location and all their direct and indirect descendant resources.location - a location that can contain wildcardspublic final void start()
public void stop()
Copyright © 2015–2016 Red Hat, Inc.. All rights reserved.