org.rhq.enterprise.server.resource.disambiguation
Class DisambiguationPolicy
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<DisambiguationPolicy.Level>
org.rhq.enterprise.server.resource.disambiguation.DisambiguationPolicy
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<DisambiguationPolicy.Level>, Collection<DisambiguationPolicy.Level>, List<DisambiguationPolicy.Level>, RandomAccess
public class DisambiguationPolicy
- extends ArrayList<DisambiguationPolicy.Level>
A disambiguation policy determines whether two disambiguation reports are still ambiguous or not.
The policy is basically a list of ResourceResolution instances each corresponding to either
the resource itself of some of its parent in the hierarchy. Each of the ResourceResolution instances
in the list determines how the appropriate part of the report is disambiguated.
- Author:
- Lukas Krejci
- See Also:
- Serialized Form
| Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
DisambiguationPolicy
public DisambiguationPolicy(DisambiguationUpdateStrategy parentsDisambiguationStrategy,
List<String> ambiguousTypeNames)
DisambiguationPolicy
public DisambiguationPolicy(DisambiguationPolicy other)
getUniqueNamePolicy
public static DisambiguationPolicy getUniqueNamePolicy(DisambiguationUpdateStrategy parentsDisambiguationStrategy,
List<String> ambiguousTypeNames)
- Creates a "starting" disambiguation policy that is used to try and disambiguate
the resources by just their name.
- Parameters:
parentsDisambiguationStrategy - ambiguousTypeNames - the list of ambiguous type names
- Returns:
- See Also:
DisambiguationPolicy(DisambiguationUpdateStrategy, List),
getAmbiguousTypeNames()
getParentsUpdateStrategy
public DisambiguationUpdateStrategy getParentsUpdateStrategy()
setParentsUpdateStrategy
public void setParentsUpdateStrategy(DisambiguationUpdateStrategy parentsUpdateStrategy)
getAmbiguousTypeNames
public List<String> getAmbiguousTypeNames()
- Returns:
- the list of type names that are defined in multiple plugins. Such type names
should be disambiguated no matter if it is needed or not.
setAmbiguousTypeNames
public void setAmbiguousTypeNames(List<String> ambiguousTypeNames)
areAmbiguous
public <T> boolean areAmbiguous(MutableDisambiguationReport<T> a,
MutableDisambiguationReport<T> b)
- Tells whether the last resolution in this policy determines the reports ambiguous.
- Type Parameters:
T - - Parameters:
a - b -
- Returns:
getCurrentLevel
public DisambiguationPolicy.Level getCurrentLevel()
- Returns:
- the last element in this policy
getNext
public DisambiguationPolicy getNext()
- If the user of this class determines that this policy can't disambiguate some list of reports,
s/he can get the next policy to try by calling this method.
- Returns:
- the next policy in "chain" of possible policies
getNextRepartitioningPolicy
public DisambiguationPolicy getNextRepartitioningPolicy()
- Returns:
- a policy to be used to repartition unique reports using some other criteria or null
if the current policy doesn't require repartitioning of unique reports.
Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.