Configuring Sun Master Indexes (Repository)

Specifying a Master Index Default Survivor Strategy (Repository)

The default survivor strategy specifies the name of the Java class that defines the survivor calculation strategy to use for most of the fields in the SBR. By defining a default strategy, you do not need to define a strategy for every candidate field; you only need to define a strategy for fields that do not use the default strategy.


Note –

If you create a customized class for the default survivor strategy, make sure the class implements com.stc.eindex.survivor.SurvivorStrategyInterface and is accessible by the EJB class loader.


ProcedureTo Specify a Default Survivor Strategy

  1. In the Projects window, expand the Configuration node in the project you want to modify, and then double-click the Best Record file.

    The file opens in the NetBeans XML editor.

  2. Scroll to the default-survivor-strategy element in the SurvivorHelperConfig element.

  3. To change the name of the default class, modify the value of the strategy-class element to the fully qualified name of the new default strategy class.

    For example:


    <default-survivor-strategy>
       <strategy-class>com.stc.eindex.survivor.impl.MySurvivorStrategy
       </strategy-class>
    </default-survivor-strategy>
  4. Configure the strategy parameters, as described in Configuring the Default Survivor Strategy.

  5. Save and close the file.

Configuring the Default Survivor Strategy

Once you define a default survivor strategy, you might need to specify certain parameters for the strategy. One parameter is required for the WeightedSurvivorStrategy and for the DefaultSurvivorStrategy. If you create a custom strategy, additional parameters can be used.

ProcedureTo Configure the Default Survivor Strategy

  1. In the Projects window, expand the Configuration node in the project you want to modify, and then double-click the Best Record file.

    The file opens in the NetBeans XML editor.

  2. Scroll to the default-survivor-strategy element, and then to the strategy-class element.

  3. Do any of the following:

    • To modify an existing parameter value, scroll to the parameter you want to modify, and then change the value of the parameter-value element.

      For example:


      <default-survivor-strategy>
         <strategy-class>com.stc.eindex.survivor.impl.MySurvivorStrategy
         </strategy-class>
         <parameters>
            <parameter>
               <parameter-name>ConfigModuleName</parameter-name>
               <parameter-type>java.lang.String</parameter-type>
               <parameter-value>MySurvivorCalculator</parameter-value>
            </parameter>
         </parameters>
      </default-survivor-strategy>
    • To add a new parameter, create a new parameter element within the parameters element, and then define the parameter elements described in Master Index Default Survivor Strategy Parameter Elements (Repository).

    • To delete a parameter, scroll to the parameters element, and then delete all text between and including the parameter element that define the parameter.

    • To delete all parameters, delete the all text between and including the parameters element.

  4. Save and close the file.