public void registerService(SSOToken token,String orgDN,String serviceName) throws AMException, SSOException {
  try {
    Set attrNames=getServiceAttributesWithQualifier(token,serviceName);
    if ((attrNames != null) && !attrNames.isEmpty()) {
      PersistentObject po=UMSObject.getObjectHandle(token,new Guid(orgDN));
      DirectCOSDefinition dcos=createCOSDefinition(serviceName,attrNames);
      COSManager cm=COSManager.getCOSManager(token,po.getGuid());
      cm.addDefinition(dcos);
    }
  }
 catch (  AccessRightsException e) {
    debug.error("DirectoryServicesImpl.registerService() " + "Insufficient access rights to register service: " + serviceName,e);
    throw new AMException(token,"460");
  }
catch (  EntryAlreadyExistsException e) {
    if (debug.warningEnabled()) {
      debug.warning("DirectoryServicesImpl.registerService() " + "Service " + serviceName + " already registered",e);
    }
    Object args[]={serviceName};
    String locale=CommonUtils.getUserLocale(token);
    throw new AMException(AMSDKBundle.getString("464",args,locale),"464",args);
  }
catch (  SMSException e) {
    debug.error("DirectoryServicesImpl.registerService() Unable to " + "register service: " + serviceName,e);
    throw new AMException(token,"914");
  }
catch (  UMSException e) {
    debug.error("DirectoryServicesImpl.registerService() Unable to " + "register service: " + serviceName,e);
    throw new AMException(token,"914",e);
  }
}

public void registerService ( SSOToken token , String orgDN , String serviceName ) throws AMException , SSOException { try { Set attrNames = getServiceAttributesWithQualifier ( token , serviceName ) ; if ( ( attrNames != null ) && ! attrNames . isEmpty ( ) ) { PersistentObject po = UMSObject . getObjectHandle ( token , new Guid ( orgDN ) ) ; DirectCOSDefinition dcos = createCOSDefinition ( serviceName , attrNames ) ; COSManager cm = COSManager . getCOSManager ( token , po . getGuid ( ) ) ; cm . addDefinition ( dcos ) ; } } catch ( AccessRightsException e ) { debug . error ( "DirectoryServicesImpl.registerService() " + "Insufficient access rights to register service: " + serviceName , e ) ; throw new AMException ( token , "460" ) ; } catch ( EntryAlreadyExistsException e ) { if ( debug . warningEnabled ( ) ) { debug . warning ( "DirectoryServicesImpl.registerService() " + "Service " + serviceName + " already registered" , e ) ; } Object args [ ] = { serviceName } ; String locale = CommonUtils . getUserLocale ( token ) ; throw new AMException ( AMSDKBundle . getString ( "464" , args , locale ) , "464" , args ) ; } catch ( SMSException e ) { debug . error ( "DirectoryServicesImpl.registerService() Unable to " + "register service: " + serviceName , e ) ; throw new AMException ( token , "914" ) ; } catch ( UMSException e ) { debug . error ( "DirectoryServicesImpl.registerService() Unable to " + "register service: " + serviceName , e ) ; throw new AMException ( token , "914" , e ) ; } }
register a service for an org or org unit policy to a profile
