public void unassignService(String serviceName) throws IdRepoException, SSOException {
  IdServices idServices=IdServicesFactory.getDataStoreServices();
  Set OCs=getServiceOCs(token,serviceName);
  Map tMap=new HashMap();
  tMap.put(serviceName,OCs);
  Set assignedServices=idServices.getAssignedServices(token,type,name,tMap,orgName,univDN);
  if (!assignedServices.contains(serviceName)) {
    Object args[]={serviceName};
    throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,IdRepoErrorCode.SERVICE_NOT_ASSIGNED,args);
  }
  Map attrMap=new HashMap();
  Set objectclasses=getAttribute("objectclass");
  if (objectclasses != null && !objectclasses.isEmpty()) {
    Set removeOCs=AMCommonUtils.updateAndGetRemovableOCs(objectclasses,OCs);
    try {
      Set attrNames=new HashSet();
      ServiceSchemaManager ssm=new ServiceSchemaManager(serviceName,token);
      ServiceSchema uss=ssm.getSchema(type.getName());
      if (uss != null) {
        attrNames=uss.getAttributeSchemaNames();
      }
      Iterator it=attrNames.iterator();
      while (it.hasNext()) {
        String a=(String)it.next();
        attrMap.put(a,Collections.EMPTY_SET);
      }
    }
 catch (    SMSException smse) {
    }
    attrMap.put("objectclass",removeOCs);
  }
  idServices.unassignService(token,type,name,serviceName,attrMap,orgName,univDN);
}

public void unassignService ( String serviceName ) throws IdRepoException , SSOException { IdServices idServices = IdServicesFactory . getDataStoreServices ( ) ; Set OCs = getServiceOCs ( token , serviceName ) ; Map tMap = new HashMap ( ) ; tMap . put ( serviceName , OCs ) ; Set assignedServices = idServices . getAssignedServices ( token , type , name , tMap , orgName , univDN ) ; if ( ! assignedServices . contains ( serviceName ) ) { Object args [ ] = { serviceName } ; throw new IdRepoException ( IdRepoBundle . BUNDLE_NAME , IdRepoErrorCode . SERVICE_NOT_ASSIGNED , args ) ; } Map attrMap = new HashMap ( ) ; Set objectclasses = getAttribute ( "objectclass" ) ; if ( objectclasses != null && ! objectclasses . isEmpty ( ) ) { Set removeOCs = AMCommonUtils . updateAndGetRemovableOCs ( objectclasses , OCs ) ; try { Set attrNames = new HashSet ( ) ; ServiceSchemaManager ssm = new ServiceSchemaManager ( serviceName , token ) ; ServiceSchema uss = ssm . getSchema ( type . getName ( ) ) ; if ( uss != null ) { attrNames = uss . getAttributeSchemaNames ( ) ; } Iterator it = attrNames . iterator ( ) ; while ( it . hasNext ( ) ) { String a = ( String ) it . next ( ) ; attrMap . put ( a , Collections . EMPTY_SET ) ; } } catch ( SMSException smse ) { } attrMap . put ( "objectclass" , removeOCs ) ; } idServices . unassignService ( token , type , name , serviceName , attrMap , orgName , univDN ) ; }
removes a service from the identity . this method is only valid for amidentity object of type user .
