if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_VIEWHARDTOKENS)){ System.out.println("BasicAccessRuleSetEncoder: currentendentityrules add : ENDENTITY_VIEWHARDTOKESN");
if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_VIEWHARDTOKENS)){
	private void initCurrentRules(Collection currentaccessrules){		System.out.println("BasicAccessRuleSetEncoder: >initCurrentRules ");		Iterator iter = currentaccessrules.iterator();		HashMap endentityrules = new HashMap();				Integer general = new Integer(0);		endentityrules.put(general, new Integer(0));						while(iter.hasNext()){			AccessRule ar = (AccessRule) iter.next();			System.out.println("BasicAccessRuleSetEncoder: " + ar.getAccessRule() + ", " + this.forceadvanced);												if(ar.getAccessRule().startsWith(AvailableAccessRules.REGULAR_RAFUNCTIONALITY) &&				ar.getAccessRule().length() > AvailableAccessRules.REGULAR_RAFUNCTIONALITY.length() &&			   !ar.getAccessRule().equals(AvailableAccessRules.REGULAR_EDITENDENTITYPROFILES)){				if(ar.getRule() == AccessRule.RULE_ACCEPT && !ar.isRecursive()){					if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_VIEWENDENTITY)){						System.out.println("BasicAccessRuleSetEncoder: currentendentityrules add : ENDENTITY_VIEW");						currentendentityrules.add(new Integer(BasicAccessRuleSet.ENDENTITY_VIEW));						endentityrules.put(general,  new Integer(((Integer) endentityrules.get(general)).intValue() + BasicAccessRuleSet.ENDENTITY_VIEW));						}else				    if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_VIEWENDENTITYHISTORY)){				    	System.out.println("BasicAccessRuleSetEncoder: currentendentityrules add : ENDENTITY_VIEWHISTORY");				    	currentendentityrules.add(new Integer(BasicAccessRuleSet.ENDENTITY_VIEWHISTORY));											    	endentityrules.put(general,  new Integer(((Integer) endentityrules.get(general)).intValue() + BasicAccessRuleSet.ENDENTITY_VIEWHISTORY));				    }else				    if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_CREATEENDENTITY)){				    	System.out.println("BasicAccessRuleSetEncoder: currentendentityrules add : ENDENTITY_CREATE");				    	currentendentityrules.add(new Integer(BasicAccessRuleSet.ENDENTITY_CREATE));											    	endentityrules.put(general,  new Integer(((Integer) endentityrules.get(general)).intValue() + BasicAccessRuleSet.ENDENTITY_CREATE));				    					    }else				    if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_DELETEENDENTITY)){				    	System.out.println("BasicAccessRuleSetEncoder: currentendentityrules add : ENDENTITY_DELETE");				    	currentendentityrules.add(new Integer(BasicAccessRuleSet.ENDENTITY_DELETE));											    	endentityrules.put(general,  new Integer(((Integer) endentityrules.get(general)).intValue() + BasicAccessRuleSet.ENDENTITY_DELETE));				    					    }else				    if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_EDITENDENTITY)){				    	System.out.println("BasicAccessRuleSetEncoder: currentendentityrules add : ENDENTITY_EDIT");				    	currentendentityrules.add(new Integer(BasicAccessRuleSet.ENDENTITY_EDIT));											    	endentityrules.put(general,  new Integer(((Integer) endentityrules.get(general)).intValue() + BasicAccessRuleSet.ENDENTITY_EDIT));				    					    }else				     if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_REVOKEENDENTITY)){				     	System.out.println("BasicAccessRuleSetEncoder: currentendentityrules add : ENDENTITY_REVOKE");				     	currentendentityrules.add(new Integer(BasicAccessRuleSet.ENDENTITY_REVOKE));											     	endentityrules.put(general,  new Integer(((Integer) endentityrules.get(general)).intValue() + BasicAccessRuleSet.ENDENTITY_REVOKE));				     					    }else				    					    if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_VIEWHARDTOKENS)){				    	System.out.println("BasicAccessRuleSetEncoder: currentendentityrules add : ENDENTITY_VIEWHARDTOKESN");				    	currentendentityrules.add(new Integer(BasicAccessRuleSet.ENDENTITY_VIEWHARDTOKENS));											    	endentityrules.put(general,  new Integer(((Integer) endentityrules.get(general)).intValue() + BasicAccessRuleSet.ENDENTITY_VIEWHARDTOKENS));				    					    }else				    if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_KEYRECOVERY)){				    	System.out.println("BasicAccessRuleSetEncoder: currentendentityrules add : ENDENTITY_KEYRECOVERY");				    	currentendentityrules.add(new Integer(BasicAccessRuleSet.ENDENTITY_KEYRECOVER));											    	endentityrules.put(general,  new Integer(((Integer) endentityrules.get(general)).intValue() + BasicAccessRuleSet.ENDENTITY_KEYRECOVER));				    					    }				    										}else{				   this.forceadvanced = true;				   break;				}							}else{				if(ar.getAccessRule().equals(AvailableAccessRules.ENDENTITYPROFILEBASE)){				  if(ar.getRule() == AccessRule.RULE_ACCEPT && ar.isRecursive()){				  	System.out.println("BasicAccessRuleSetEncoder: currentendentityprofiles : add all");				       this.currentendentityprofiles.add(new Integer(BasicAccessRuleSet.ENDENTITYPROFILE_ALL));				  }else{				  	this.forceadvanced = true;				  	break;				  					  }				}else				if(ar.getAccessRule().startsWith(AvailableAccessRules.ENDENTITYPROFILEPREFIX)){				  if(ar.getRule() == AccessRule.RULE_ACCEPT && !ar.isRecursive()){                    Integer profileid = null; 				  	if(ar.getAccessRule().lastIndexOf('/') > AvailableAccessRules.ENDENTITYPROFILEPREFIX.length()){					  profileid = new Integer(ar.getAccessRule().substring(AvailableAccessRules.ENDENTITYPROFILEPREFIX.length(), ar.getAccessRule().lastIndexOf('/')));				  	}else{				  		this.forceadvanced = true;				  		break;				  	}					int currentval = 0;					if(endentityrules.get(profileid) != null)						currentval = ((Integer) endentityrules.get(profileid)).intValue();										if(ar.getAccessRule().endsWith(AvailableAccessRules.VIEW_RIGHTS)){						currentval += BasicAccessRuleSet.ENDENTITY_VIEW;					}else					if(ar.getAccessRule().endsWith(AvailableAccessRules.HISTORY_RIGHTS)){						currentval += BasicAccessRuleSet.ENDENTITY_VIEWHISTORY;						}else					if(ar.getAccessRule().endsWith(AvailableAccessRules.HARDTOKEN_RIGHTS)){						currentval += BasicAccessRuleSet.ENDENTITY_VIEWHARDTOKENS;													}else					if(ar.getAccessRule().endsWith(AvailableAccessRules.CREATE_RIGHTS)){						currentval += BasicAccessRuleSet.ENDENTITY_CREATE;									}else					if(ar.getAccessRule().endsWith(AvailableAccessRules.DELETE_RIGHTS)){						currentval += BasicAccessRuleSet.ENDENTITY_DELETE;									}else					if(ar.getAccessRule().endsWith(AvailableAccessRules.EDIT_RIGHTS)){						currentval += BasicAccessRuleSet.ENDENTITY_EDIT;					}else					if(ar.getAccessRule().endsWith(AvailableAccessRules.REVOKE_RIGHTS)){						currentval += BasicAccessRuleSet.ENDENTITY_REVOKE;					}else											if(ar.getAccessRule().endsWith(AvailableAccessRules.KEYRECOVERY_RIGHTS)){						currentval += BasicAccessRuleSet.ENDENTITY_KEYRECOVER;					}					endentityrules.put(profileid, new Integer(currentval));									  }else{				  	this.forceadvanced = true;				  	break;				  }				}else{                  if(ar.getAccessRule().equals(AvailableAccessRules.CABASE)){                  	if(ar.getRule() == AccessRule.RULE_ACCEPT && ar.isRecursive()){                  	                  	  this.currentcas.add(new Integer(BasicAccessRuleSet.CA_ALL));                    }else{                  	  this.forceadvanced = true;                  	  break;                    }                                    }else{                   	 if(ar.getAccessRule().startsWith(AvailableAccessRules.CAPREFIX)){                   	 	if(ar.getRule() == AccessRule.RULE_ACCEPT && !ar.isRecursive()){                  	                           Integer caid = new Integer(ar.getAccessRule().substring(AvailableAccessRules.CAPREFIX.length()));                           this.currentcas.add(caid);                   	 	}else{                   	 		this.forceadvanced = true;                   	 		break;                   	 	}                                     	 	                  	 }else{                  	 	  if(ar.getAccessRule().equals(AvailableAccessRules.REGULAR_VIEWLOG)){                  	 	      if(ar.getRule() == AccessRule.RULE_ACCEPT && ar.isRecursive()){                  	 	  	    this.currentotherrules.add( new Integer(BasicAccessRuleSet.OTHER_VIEWLOG));                  	 	      }else{                  	 	      	this.forceadvanced = true;                  	 	      	break;                  	 	      	                  	 	      }                  	 	  }else                  	 	  if(ar.getAccessRule().equals(AvailableAccessRules.HARDTOKEN_ISSUEHARDTOKENS)){                  	 	  		if(ar.getRule() == AccessRule.RULE_ACCEPT){                  	 	  			this.currentotherrules.add( new Integer(BasicAccessRuleSet.OTHER_ISSUEHARDTOKENS));                  	 	  		}else{                  	 	  			this.forceadvanced = true;                  	 	  			break;                  	 	      	                  	 	  			                  	 	  		}                  	 	  }                  	 }                  }				}			}					}				System.out.println("BasicAccessRuleSetEncoder: forced " + this.forceadvanced);										int endentityruleval = ((Integer) endentityrules.get(general)).intValue();					iter = endentityrules.keySet().iterator();		while(iter.hasNext()){			Integer next = (Integer) iter.next();			if(!next.equals(general)){				if(((Integer) endentityrules.get(next)).intValue() == endentityruleval ){					this.currentendentityprofiles.add(next);				}else					this.forceadvanced = true;			}					}				System.out.println("BasicAccessRuleSetEncoder: <initCurrentRules ");	}