package de.ivu.elect.business.system.boundary;

import java.net.InetAddress;


import static org.apache.commons.lang3.StringUtils.isNotBlank;

/**
 *  on 24.11.2015.
 */
public class SystemName {

  private static final String UNKNOWN = "*Unknown*";

  public String getSystemName() {
    try {
      InetAddress host = InetAddress.getLocalHost();

      if (isNotBlank(host.getHostName())) {
        return host.getHostName();
      }
    } catch (Exception ignored) {
    }

    return UNKNOWN;
  }
}
