public static void addSiteSecondaryURLs(SSOToken ssoToken,String siteName,Collection secondaryURLs) throws SMSException, SSOException, ConfigurationException {
  ServiceConfig rootNode=getRootSiteConfig(ssoToken);
  ServiceConfig sc=rootNode.getSubConfig(siteName);
  ServiceConfig accessPoint=sc.getSubConfig(SUBCONFIG_ACCESS_URL);
  Set toAdd=new HashSet(secondaryURLs.size() * 2);
  toAdd.addAll(secondaryURLs);
  Set secondary=accessPoint.getSubConfigNames("*");
  if ((secondary != null) && !secondary.isEmpty()) {
    toAdd.removeAll(secondary);
  }
  Set allURLs=getAllSiteURLs(ssoToken);
  for (Iterator i=toAdd.iterator(); i.hasNext(); ) {
    String url=(String)i.next();
    if (allURLs.contains(url)) {
      String[] param={url};
      throw new ConfigurationException("duplicated.site.url",param);
    }
  }
  for (Iterator i=toAdd.iterator(); i.hasNext(); ) {
    String url=(String)i.next();
    Map values=new HashMap(2);
    Set set=new HashSet(2);
    set.add(getNextId(ssoToken));
    values.put(ATTR_SEC_ID,set);
    accessPoint.addSubConfig(url,SUBCONFIG_SEC_URLS,0,values);
  }
}

public static void addSiteSecondaryURLs ( SSOToken ssoToken , String siteName , Collection secondaryURLs ) throws SMSException , SSOException , ConfigurationException { ServiceConfig rootNode = getRootSiteConfig ( ssoToken ) ; ServiceConfig sc = rootNode . getSubConfig ( siteName ) ; ServiceConfig accessPoint = sc . getSubConfig ( SUBCONFIG_ACCESS_URL ) ; Set toAdd = new HashSet ( secondaryURLs . size ( ) * 2 ) ; toAdd . addAll ( secondaryURLs ) ; Set secondary = accessPoint . getSubConfigNames ( "*" ) ; if ( ( secondary != null ) && ! secondary . isEmpty ( ) ) { toAdd . removeAll ( secondary ) ; } Set allURLs = getAllSiteURLs ( ssoToken ) ; for ( Iterator i = toAdd . iterator ( ) ; i . hasNext ( ) ; ) { String url = ( String ) i . next ( ) ; if ( allURLs . contains ( url ) ) { String [ ] param = { url } ; throw new ConfigurationException ( "duplicated.site.url" , param ) ; } } for ( Iterator i = toAdd . iterator ( ) ; i . hasNext ( ) ; ) { String url = ( String ) i . next ( ) ; Map values = new HashMap ( 2 ) ; Set set = new HashSet ( 2 ) ; set . add ( getNextId ( ssoToken ) ) ; values . put ( ATTR_SEC_ID , set ) ; accessPoint . addSubConfig ( url , SUBCONFIG_SEC_URLS , 0 , values ) ; } }
adds the secondary urls of a site .
