*/
public ProfilingRule getRuleForPrincipal( Principal principal, String locatorName )
{
ProfilingRule rule = null;
// lookup the rule for the given principal in our user/rule table
PrincipalRule pr = lookupPrincipalRule(principal.getName(), locatorName);
// if not found, fallback to the locator named rule or system wide rule
if (pr == null)
{
// find rule on locator name
rule = getRule(locatorName);
if ( rule == null )
{
// if not found, fallback to the system wide rule
rule = getDefaultRule();
}
}
else
{
// Get the associated rule
rule = pr.getProfilingRule();
}
return rule;
}