class KerberosUserMapper extends AbstractUserMapper {

    @Override
    public String map(String name) {
        Context context = new Context();
        KerberosName principal = new KerberosName(name);
        context.put("principal", principal.getFullName());
        context.put("primary", principal.getPrimary());
        context.put("instance", principal.getInstance());
        context.put("realm", principal.getRealm());
        // Look through the list of rules
        for (Rule rule : rulesList) {
            boolean isApplicable = rule.evaluateIfCondition(context);
            if (isApplicable) {
                // An applicable rule was found. Apply it to get the user mapping.
                return rule.evaluateThenExpression(context);
            }
        }
        throw new IllegalArgumentException("Principal `" + name + "` cannot be mapped to a Google identity.");
    }

    public  KerberosUserMapper();

}