Add a Binding to the New Algorithm Implementation

Guice bindings are used to map the algorithm to the correct algorithm implementation.

Figure 1. Binding the Algorithm
/*
 * Copyright 2011 Curam Software Ltd.
 * All rights reserved.
 *
 * This software is the confidential and proprietary 
 * information of Curam Software, Ltd. 
 * ("Confidential Information").  You shall not 
 * disclose such Confidential Information and shall 
 * use it only in accordance with the terms of the 
 * license agreement you entered into with Curam Software.
 */
package curam.samplingstrategy.impl;

import com.google.inject.AbstractModule;
import com.google.inject.multibindings.MapBinder;
import curam.codetable.impl.SAMPLINGSTRATEGYEntry;

/**
 * Guice module for binding Sampling Strategies.
 * 
 */
public class Module extends AbstractModule {

  @Override  
  public void configure() {
    
    // register sampling strategies
    final MapBinder<SAMPLINGSTRATEGYEntry, SamplingStrategy> 
      samplingStrategies = MapBinder.newMapBinder(binder(), 
        SAMPLINGSTRATEGYEntry.class, SamplingStrategy.class);
    
    samplingStrategies.addBinding(
      SAMPLINGSTRATEGYEntry.EVERYNTHCASE).to(EveryNthCase.class);
  }
}

The new algorithm is now ready to be associated with a Case Audit Configuration in the Administration Application. For more information on Case Audit Configuration see the Cúram Case Audits Business Guide.