class SessionConfiguration implements Serializable {

  static String initNode() {
    String node = getPropertySecured(NODE_ID, null);
    if (node != null) {
      return node;
    }
    // On Windows try the 'COMPUTERNAME' variable
    try {
      if (getPropertySecured("os.name", null).startsWith("Windows")) {
        node = System.getenv("COMPUTERNAME");
      } else {
        // If it is not Windows asume it is Unix-like OS and that it
        // has HOSTNAME variable
        String hostname = System.getenv("HOSTNAME");
        if (hostname != null) {
          node = hostname;
        }
      }
    } catch (SecurityException e) {
      logger.info("Security exception when trying to get environmnet variable", e);
    }
    if (node == null) {
      // Try portable way
      try {
        node = InetAddress.getLocalHost().getHostName();
      } catch (UnknownHostException e) {
        logger.info("Unable to resolve local host, that's a strange error, but somehow it occured.", e);
        // OK, last attempt: call hostname executable
        node = "unknown";
      }
    }
    return node;
  }

  public  SessionConfiguration();

}