static PolicyDecision mergePolicyDecisions(ServiceType serviceType,PolicyDecision pd1,PolicyDecision pd2){
  Map actionDecisions1=pd1.getActionDecisions();
  Set actions=new HashSet();
  actions.addAll(actionDecisions1.keySet());
  Iterator iter=actions.iterator();
  while (iter.hasNext()) {
    String action=(String)iter.next();
    ActionDecision ad1=(ActionDecision)actionDecisions1.get(action);
    pd2.addActionDecision(ad1,serviceType);
  }
  Map mergedReponseAttrsMap=new HashMap();
  PolicyUtils.appendMapToMap(pd1.getResponseAttributes(),mergedReponseAttrsMap);
  PolicyUtils.appendMapToMap(pd2.getResponseAttributes(),mergedReponseAttrsMap);
  pd2.setResponseAttributes(mergedReponseAttrsMap);
  return pd2;
}

static PolicyDecision mergePolicyDecisions ( ServiceType serviceType , PolicyDecision pd1 , PolicyDecision pd2 ) { Map actionDecisions1 = pd1 . getActionDecisions ( ) ; Set actions = new HashSet ( ) ; actions . addAll ( actionDecisions1 . keySet ( ) ) ; Iterator iter = actions . iterator ( ) ; while ( iter . hasNext ( ) ) { String action = ( String ) iter . next ( ) ; ActionDecision ad1 = ( ActionDecision ) actionDecisions1 . get ( action ) ; pd2 . addActionDecision ( ad1 , serviceType ) ; } Map mergedReponseAttrsMap = new HashMap ( ) ; PolicyUtils . appendMapToMap ( pd1 . getResponseAttributes ( ) , mergedReponseAttrsMap ) ; PolicyUtils . appendMapToMap ( pd2 . getResponseAttributes ( ) , mergedReponseAttrsMap ) ; pd2 . setResponseAttributes ( mergedReponseAttrsMap ) ; return pd2 ; }
merges two policy decisions . merging policy decisions merges each action decision of the policy with the corresponding action decision of the other policy . this method also merges responseproviderdecision of one policy ( response attributes per policy ) with that of the other policy . these are the rules followed to merge each action decision : if the action schema has boolean syntax , boolean false value overrides boolean true value . the time to live of boolean false value overrides the time to live of boolean true value . otherwise , action values are simply aggregated . time to live is set to the minimum of time to live ( s ) of all values of the action . for response attributes , all response attributes are aggregated . in case of mutiple values for the same attribute they appear as multi valued data for the attribute .
