private void checkPrivilege(final String name,final Node configNode,final ServiceConfig privilegesConfig) throws SMSException, SSOException {
  final ServiceConfig privilegeConfig=privilegesConfig.getSubConfig(name);
  if (privilegeConfig != null) {
    @SuppressWarnings("unchecked") final Map<String,Set<String>> existingAttributes=privilegeConfig.getAttributes();
    final Map<String,Set<String>> passedAttributes=parseAttributeValuePairTags(configNode);
    final Set<String> existingPermissionList=existingAttributes.get(LIST_OF_PERMISSIONS);
    final Set<String> passedPermissionList=passedAttributes.get(LIST_OF_PERMISSIONS);
    final Set<String> newPermissions=new HashSet<String>();
    for (    String passedPermission : passedPermissionList) {
      if (!existingPermissionList.contains(passedPermission)) {
        newPermissions.add(passedPermission);
      }
    }
    if (!newPermissions.isEmpty()) {
      privilegeUpdates.add(ChangeSet.newInstance(name,newPermissions));
    }
  }
 else {
    newPrivileges.add(ChangeSet.newInstance(name,configNode));
  }
}

private void checkPrivilege ( final String name , final Node configNode , final ServiceConfig privilegesConfig ) throws SMSException , SSOException { final ServiceConfig privilegeConfig = privilegesConfig . getSubConfig ( name ) ; if ( privilegeConfig != null ) { @ SuppressWarnings ( "unchecked" ) final Map < String , Set < String > > existingAttributes = privilegeConfig . getAttributes ( ) ; final Map < String , Set < String > > passedAttributes = parseAttributeValuePairTags ( configNode ) ; final Set < String > existingPermissionList = existingAttributes . get ( LIST_OF_PERMISSIONS ) ; final Set < String > passedPermissionList = passedAttributes . get ( LIST_OF_PERMISSIONS ) ; final Set < String > newPermissions = new HashSet < String > ( ) ; for ( String passedPermission : passedPermissionList ) { if ( ! existingPermissionList . contains ( passedPermission ) ) { newPermissions . add ( passedPermission ) ; } } if ( ! newPermissions . isEmpty ( ) ) { privilegeUpdates . add ( ChangeSet . newInstance ( name , newPermissions ) ) ; } } else { newPrivileges . add ( ChangeSet . newInstance ( name , configNode ) ) ; } }
given the privilege name identifies whether that privilege already exists . if it doesn ' t it registers creation of a new privilege . if it does it compares that the privileges ' permissions list is up to date . if new permissions are present it registers the privilege for an update .
