private void assignServices(OrganizationConfigManager ocm,List newServiceNames) throws SMSException {
  try {
    Set assignedServices=ocm.getAssignedServices();
    Set allServices=new HashSet(newServiceNames.size() + assignedServices.size());
    allServices.addAll(assignedServices);
    allServices.addAll(newServiceNames);
    for (    Object tmp : allServices) {
      String serviceName=(String)tmp;
      if (newServiceNames.contains(serviceName) && assignedServices.contains(serviceName)) {
      }
 else       if (newServiceNames.contains(serviceName) && !assignedServices.contains(serviceName)) {
        ocm.assignService(serviceName,null);
      }
 else       if (!newServiceNames.contains(serviceName) && assignedServices.contains(serviceName)) {
        ocm.unassignService(serviceName);
      }
    }
  }
 catch (  SMSException smse) {
    debug.error("RealmResource.assignServices() : Unable to assign services");
    throw smse;
  }
}

private void assignServices ( OrganizationConfigManager ocm , List newServiceNames ) throws SMSException { try { Set assignedServices = ocm . getAssignedServices ( ) ; Set allServices = new HashSet ( newServiceNames . size ( ) + assignedServices . size ( ) ) ; allServices . addAll ( assignedServices ) ; allServices . addAll ( newServiceNames ) ; for ( Object tmp : allServices ) { String serviceName = ( String ) tmp ; if ( newServiceNames . contains ( serviceName ) && assignedServices . contains ( serviceName ) ) { } else if ( newServiceNames . contains ( serviceName ) && ! assignedServices . contains ( serviceName ) ) { ocm . assignService ( serviceName , null ) ; } else if ( ! newServiceNames . contains ( serviceName ) && assignedServices . contains ( serviceName ) ) { ocm . unassignService ( serviceName ) ; } } } catch ( SMSException smse ) { debug . error ( "RealmResource.assignServices() : Unable to assign services" ) ; throw smse ; } }
assigns services to a realm
