throws SPLException
{
logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluatePolicies");
// Iterate over the List of maps
EvaluationResults result = new EvaluationResults();
Iterator instanceMapKeyIt = instanceMap.keySet().iterator();
// System.out.println("Iterating over all instances of Anchor class");
while(instanceMapKeyIt.hasNext())
{
String className = (String)instanceMapKeyIt.next();
List instancesForClass = (List)instanceMap.get(className);
Iterator instancesForClassIt = instancesForClass.iterator();
if(logger.isLoggable(Level.FINE))
logger.fine(Thread.currentThread().getName()+" iterating over instances ");
// System.out.println(">>>>>>>>>>>"+"Starting policy Evaluation"+"<<<<<<<<<<<");
// auditloggerString+=">>>>>>>>>>>"+"Starting policy Evaluation"+"<<<<<<<<<<<"+"\n";
int instanceCount=1;
while(instancesForClassIt.hasNext())
{
// System.out.println("+++++++++++"+"Evaluating policy against instance "+instanceCount+"+++++++++++");
auditloggerString+="+++++++++++"+"Evaluating policy against instance "+instanceCount+"+++++++++++"+"\n";
InstanceInfo instanceOfClass = (InstanceInfo)instancesForClassIt.next();
String instanceName = instanceOfClass.getInstanceName();
Object instance = instanceOfClass.getInstance();
Map instanceSymbolMap = instanceOfClass.getInstanceSymbolsMap();
// populate the symboltable with information from the map
_symTab.populateInstanceValuesForInstance(className, instanceName,instance, instanceSymbolMap);
}
}
//evaluate the declaration to populate the values for the constants
if(_declaration != null)
{
_declaration.evaluate();
}
// iterate over all the policies
for(int j=0; j<_policyList.size();j++)
{
// System.out.println("***********"+"evaluating sub policy number "+(j+1)+"***********");
auditloggerString+="***********"+"evaluating sub policy number "+(j+1)+"***********"+"\n";
PolicyStatement pStatement = (PolicyStatement)_policyList.get(j);
// evaluate each policy
EvaluationResults er1 = pStatement.evaluateForResults(dc,ac);
result.appendResult(er1);
int result1 = result.getStatusCode(); // pStatement.evaluate(dc,ac);
auditloggerString+=pStatement.getAuditLogString();
if(result1 == POLICY_EVALUATION_FAILED) // report failure even if a single policy fails