org.rhq.enterprise.server.resource.disambiguation
Enum DefaultDisambiguationUpdateStrategies

java.lang.Object
  extended by java.lang.Enum<DefaultDisambiguationUpdateStrategies>
      extended by org.rhq.enterprise.server.resource.disambiguation.DefaultDisambiguationUpdateStrategies
All Implemented Interfaces:
Serializable, Comparable<DefaultDisambiguationUpdateStrategies>, DisambiguationUpdateStrategy

public enum DefaultDisambiguationUpdateStrategies
extends Enum<DefaultDisambiguationUpdateStrategies>
implements DisambiguationUpdateStrategy

This enumerates different strategies that can be used to update the results to produce disambiguated list.

Author:
Lukas Krejci

Enum Constant Summary
EXACT
          The disambiguation policy is followed precisely.
KEEP_ALL_PARENTS
          All parents are preserved no matter what the policy says.
KEEP_AT_LEAST_ONE_PARENT
          Even if the disambiguation policy determined that parents are not needed to disambiguate the results, at least one of them is kept in the report.
KEEP_PARENTS_TO_TOPMOST_SERVERS
          The parentage of the report is retained at least up to the server/service directly under platform.
 
Method Summary
 EnumSet<ResourceResolution> alwaysRepartitionableResolutions()
           
static DefaultDisambiguationUpdateStrategies getDefault()
           
 EnumSet<ResourceResolution> resourceLevelRepartitionableResolutions()
           
static
<T> void
updateResources(DisambiguationPolicy policy, MutableDisambiguationReport<T> report, boolean honorAmbiguousTypeNamesList, boolean pushDownPluginInfo)
          This updates the resources in the report according to the resolutions contained in the policy.
static DefaultDisambiguationUpdateStrategies valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DefaultDisambiguationUpdateStrategies[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.rhq.enterprise.server.resource.disambiguation.DisambiguationUpdateStrategy
partitionFurther, update
 

Enum Constant Detail

EXACT

public static final DefaultDisambiguationUpdateStrategies EXACT
The disambiguation policy is followed precisely.


KEEP_AT_LEAST_ONE_PARENT

public static final DefaultDisambiguationUpdateStrategies KEEP_AT_LEAST_ONE_PARENT
Even if the disambiguation policy determined that parents are not needed to disambiguate the results, at least one of them is kept in the report.


KEEP_PARENTS_TO_TOPMOST_SERVERS

public static final DefaultDisambiguationUpdateStrategies KEEP_PARENTS_TO_TOPMOST_SERVERS
The parentage of the report is retained at least up to the server/service directly under platform. If the policy needs the platform to stay, it is of course preserved.


KEEP_ALL_PARENTS

public static final DefaultDisambiguationUpdateStrategies KEEP_ALL_PARENTS
All parents are preserved no matter what the policy says.

Method Detail

values

public static DefaultDisambiguationUpdateStrategies[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DefaultDisambiguationUpdateStrategies c : DefaultDisambiguationUpdateStrategies.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DefaultDisambiguationUpdateStrategies valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

updateResources

public static <T> void updateResources(DisambiguationPolicy policy,
                                       MutableDisambiguationReport<T> report,
                                       boolean honorAmbiguousTypeNamesList,
                                       boolean pushDownPluginInfo)
This updates the resources in the report according to the resolutions contained in the policy. This method is called as part of the DisambiguationUpdateStrategy.update(DisambiguationPolicy, MutableDisambiguationReport) implementations in this enum before the individual enums modify the parent list as they see fit. This method is left public because it is generic enough to be reused by other potential implementations of the DisambiguationUpdateStrategy interface.

Type Parameters:
T -
Parameters:
policy -
report -
honorAmbiguousTypeNamesList - whether to honor the list of ambiguous type names as listed in the policy when updating the resources.
pushDownPluginInfo - if true, the plugin information is pushed down as low in the resource hierarchy as possible. This means that if some parent needs plugin disambiguation or is of an ambiguous type and the resource comes from the same plugin, the plugin info is preserved on the resource rather than on the parent. This is mainly useful for the display purposes, because it just looks nicer to have that info at a resource than somewhere in the location string.

resourceLevelRepartitionableResolutions

public EnumSet<ResourceResolution> resourceLevelRepartitionableResolutions()
Specified by:
resourceLevelRepartitionableResolutions in interface DisambiguationUpdateStrategy
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

public EnumSet<ResourceResolution> alwaysRepartitionableResolutions()
Specified by:
alwaysRepartitionableResolutions in interface DisambiguationUpdateStrategy
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().

getDefault

public static DefaultDisambiguationUpdateStrategies getDefault()


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