org.rhq.enterprise.server.resource.disambiguation
Interface DisambiguationUpdateStrategy

All Known Implementing Classes:
DefaultDisambiguationUpdateStrategies

public interface DisambiguationUpdateStrategy

Defines a strategy for updating a results list with the disambiguation information.

See DefaultDisambiguationUpdateStrategies for a couple of implemented strategies.

Author:
Lukas Krejci
See Also:
DefaultDisambiguationUpdateStrategies

Method Summary
 EnumSet<ResourceResolution> alwaysRepartitionableResolutions()
           
<T> boolean
partitionFurther(ReportPartitions<T> partitions)
          The disambiguation procedure calls this method for every not yet fully unique partitions set when it determines that further disambiguation should be performed.
 EnumSet<ResourceResolution> resourceLevelRepartitionableResolutions()
           
<T> void
update(DisambiguationPolicy policy, MutableDisambiguationReport<T> report)
          Updates the report using the policy.
 

Method Detail

update

<T> void update(DisambiguationPolicy policy,
                MutableDisambiguationReport<T> report)
Updates the report using the policy. It is guaranteed that the resource and its parents in the report are already processed using the ResourceResolution#update(MutableDisambiguationReport.Resource) method. This method is then called to ensure that the report as a whole conforms to the policy *and* this strategy. This might entail removing some elements from the parent list for example.

Type Parameters:
T -
Parameters:
policy -
report -

resourceLevelRepartitionableResolutions

EnumSet<ResourceResolution> resourceLevelRepartitionableResolutions()
Returns:
a set of resolutions for which the unique reports need to be repartitioned at the resource level. In another words this forces the disambiguation to continue on up the disambiguation chain even if the it disambiguates the resuts successfully at the resource level.

alwaysRepartitionableResolutions

EnumSet<ResourceResolution> alwaysRepartitionableResolutions()
Returns:
a set of resolutions for which uniquely disambiguated reports are to be repartitioned further. The resolutions from this set apply on the parents (on any level), unlike the resolutions from resourceLevelRepartitionableResolutions().

partitionFurther

<T> boolean partitionFurther(ReportPartitions<T> partitions)
The disambiguation procedure calls this method for every not yet fully unique partitions set when it determines that further disambiguation should be performed.

But this is not always necessary, depending on the update strategy implementation.

This method is therefore the means for the update strategy to short-circuit the disambiguation procedure when it determines that further disambiguation would not make sense for this strategy.

Type Parameters:
T -
Parameters:
partitions - the partitions object holding a subset of the results being disambiguated along with the policy that is used to disambiguate them
Returns:
true if further disambiguation is useful, false otherwise


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.