public static SessionIDCorrector create(){
  Map<String,String> serverToSite=new HashMap<>();
  try {
    for (    Object s : WebtopNaming.getAllServerIDs()) {
      String serverId=s.toString();
      String siteId=WebtopNaming.getSiteID(serverId);
      if (serverId.equals(siteId)) {
        siteId=null;
      }
      debug.message("{} Mapping Server {} to Site {}",HEADER,serverId,siteId);
      serverToSite.put(serverId,siteId);
    }
    debug.message("{} Mapping complete",HEADER);
  }
 catch (  Exception e) {
    debug.error("Failed to build Autocorrect Mapping",e);
    return null;
  }
  return new SessionIDCorrector(serverToSite);
}

public static SessionIDCorrector create ( ) { Map < String , String > serverToSite = new HashMap < > ( ) ; try { for ( Object s : WebtopNaming . getAllServerIDs ( ) ) { String serverId = s . toString ( ) ; String siteId = WebtopNaming . getSiteID ( serverId ) ; if ( serverId . equals ( siteId ) ) { siteId = null ; } debug . message ( "{} Mapping Server {} to Site {}" , HEADER , serverId , siteId ) ; serverToSite . put ( serverId , siteId ) ; } debug . message ( "{} Mapping complete" , HEADER ) ; } catch ( Exception e ) { debug . error ( "Failed to build Autocorrect Mapping" , e ) ; return null ; } return new SessionIDCorrector ( serverToSite ) ; }
factory method to generate an instance of sessionidcorrector based on the current webtopnaming settings . understands the server / siteid interactions which webtopnaming uses for modelling serers and sites . some of this is counter - intuitive . note : this code cannot directly listen to configuration changes because of the order in which updates to configuration are propagated throughout the system . instead it is intended to be called by webtopnaming ( which in turn is called by namingservice ) .
