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 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 to
resourceManager and triggers
InventoryListener.discoverAllFinished(InventoryEvent). |
void |
discoverChildren(L parentLocation,
ResourceType<L> childType)
Discovers child resources of the given
parentLocation, puts them to resourceManager and triggers
InventoryListener.resourcesAdded(InventoryEvent). |
ProtocolDiagnostics |
getDiagnostics() |
MonitoredEndpoint |
getEndpoint() |
String |
getFeedId() |
LocationResolver<L> |
getLocationResolver() |
ResourceManager<L> |
getResourceManager() |
ResourceTypeManager<L> |
getResourceTypeManager() |
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 endpoint, ResourceTypeManager<L> resourceTypeManager, LocationResolver<L> locationResolver, ProtocolDiagnostics diagnostics)
public void addInventoryListener(InventoryListener listener)
listener - to addpublic abstract S openSession()
Session - do not forget to close it!Sessionpublic void discoverAll()
resourceManager and triggers
InventoryListener.discoverAllFinished(InventoryEvent).public void discoverChildren(L parentLocation, ResourceType<L> childType)
parentLocation, puts them to resourceManager and triggers
InventoryListener.resourcesAdded(InventoryEvent).parentLocation - the location under which the discovery should happenchildType - the resources of this type will be discovered.public MonitoredEndpoint getEndpoint()
getEndpoint in interface SamplingService<L>public String getFeedId()
getFeedId in interface SamplingService<L>feedId associated with the present endpointpublic ResourceManager<L> getResourceManager()
public ResourceTypeManager<L> getResourceTypeManager()
ResourceTypeManager used by this endpointpublic LocationResolver<L> getLocationResolver()
public ProtocolDiagnostics getDiagnostics()
public void measureAvails(Collection<MeasurementInstance<L,AvailType<L>>> instances, Consumer<AvailDataPoint> consumer)
SamplingServiceinstances and reports them back to the given consumer.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 void removeInventoryListener(InventoryListener listener)
listener - to removepublic 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 Red Hat, Inc.. All rights reserved.