@Override public void modifyService(SSOToken token,IdType type,String name,String serviceName,SchemaType sType,Map<String,Set<String>> attrMap) throws IdRepoException {
  if (DEBUG.messageEnabled()) {
    DEBUG.message("modifyService invoked");
  }
  if (type.equals(IdType.USER)) {
    if (sType.equals(SchemaType.DYNAMIC)) {
      throw newIdRepoException(IdRepoErrorCode.CANNOT_MODIFY_SERVICE,CLASS_NAME,sType.toString(),type.getName());
    }
 else {
      setAttributes(token,type,name,(Map)attrMap,false,true,false);
    }
  }
 else   if (type.equals(IdType.REALM)) {
    Map<String,Set<String>> previousAttrs=serviceMap.get(serviceName);
    if (previousAttrs == null || previousAttrs.isEmpty()) {
      serviceMap.put(serviceName,new HashMap<String,Set<String>>(attrMap));
    }
 else {
      Set<String> previousAttrNames=new CaseInsensitiveHashSet(previousAttrs.keySet());
      for (      Map.Entry<String,Set<String>> entry : attrMap.entrySet()) {
        String attrName=entry.getKey();
        Set<String> values=entry.getValue();
        if (previousAttrNames.contains(attrName)) {
          Set<String> current=previousAttrs.get(attrName);
          current.clear();
          current.addAll(values);
        }
 else {
          previousAttrs.put(attrName,values);
        }
      }
      serviceMap.put(serviceName,previousAttrs);
    }
    if (idRepoListener != null) {
      idRepoListener.setServiceAttributes(serviceName,serviceMap);
    }
  }
 else {
    throw new IdRepoUnsupportedOpException(IdRepoBundle.BUNDLE_NAME,IdRepoErrorCode.SERVICES_NOT_SUPPORTED_FOR_AGENTS_AND_GROUPS,new Object[]{CLASS_NAME});
  }
}

@ Override public void modifyService ( SSOToken token , IdType type , String name , String serviceName , SchemaType sType , Map < String , Set < String > > attrMap ) throws IdRepoException { if ( DEBUG . messageEnabled ( ) ) { DEBUG . message ( "modifyService invoked" ) ; } if ( type . equals ( IdType . USER ) ) { if ( sType . equals ( SchemaType . DYNAMIC ) ) { throw newIdRepoException ( IdRepoErrorCode . CANNOT_MODIFY_SERVICE , CLASS_NAME , sType . toString ( ) , type . getName ( ) ) ; } else { setAttributes ( token , type , name , ( Map ) attrMap , false , true , false ) ; } } else if ( type . equals ( IdType . REALM ) ) { Map < String , Set < String > > previousAttrs = serviceMap . get ( serviceName ) ; if ( previousAttrs == null || previousAttrs . isEmpty ( ) ) { serviceMap . put ( serviceName , new HashMap < String , Set < String > > ( attrMap ) ) ; } else { Set < String > previousAttrNames = new CaseInsensitiveHashSet ( previousAttrs . keySet ( ) ) ; for ( Map . Entry < String , Set < String > > entry : attrMap . entrySet ( ) ) { String attrName = entry . getKey ( ) ; Set < String > values = entry . getValue ( ) ; if ( previousAttrNames . contains ( attrName ) ) { Set < String > current = previousAttrs . get ( attrName ) ; current . clear ( ) ; current . addAll ( values ) ; } else { previousAttrs . put ( attrName , values ) ; } } serviceMap . put ( serviceName , previousAttrs ) ; } if ( idRepoListener != null ) { idRepoListener . setServiceAttributes ( serviceName , serviceMap ) ; } } else { throw new IdRepoUnsupportedOpException ( IdRepoBundle . BUNDLE_NAME , IdRepoErrorCode . SERVICES_NOT_SUPPORTED_FOR_AGENTS_AND_GROUPS , new Object [ ] { CLASS_NAME } ) ; } }
modifies the service attributes based on the incoming attributemap . in case of a user the attributes will be saved in case the schema type is not dynamic . in case of a realm this will only modify the locally stored map structure by making sure that non - modified attributes are kept .
