|
@@ -56,14 +56,23 @@ public class ApiConstants { |
|
|
|
|
|
|
|
|
public static final ObjectMapper DB_JSON_MAPPER = COMPACT_MAPPER; |
|
|
public static final ObjectMapper DB_JSON_MAPPER = COMPACT_MAPPER; |
|
|
|
|
|
|
|
|
@Getter(lazy=true) private static final String debugFqdn = initDebugFqdn(); |
|
|
|
|
|
private static String initDebugFqdn() { |
|
|
|
|
|
try { |
|
|
|
|
|
return FileUtil.toString(HOME_DIR+"/debug_fqdn").trim(); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.debug("initDebugFqdn: "+shortError(e)); |
|
|
|
|
|
return "~debug_fqdn_disabled~"; // will never match any fqdn |
|
|
|
|
|
|
|
|
// for some reason @Getter(lazy=true) causes compilation problems when other classes try to call getter |
|
|
|
|
|
// so we implement lombok lazy-getter logic manuall here |
|
|
|
|
|
private static final AtomicReference<String> debugFqdn = new AtomicReference<>(); |
|
|
|
|
|
public static String getDebugFqdn () { |
|
|
|
|
|
if (debugFqdn.get() == null) { |
|
|
|
|
|
synchronized (debugFqdn) { |
|
|
|
|
|
if (debugFqdn.get() == null) { |
|
|
|
|
|
try { |
|
|
|
|
|
debugFqdn.set(FileUtil.toString(HOME_DIR + "/debug_fqdn").trim()); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.debug("initDebugFqdn: " + shortError(e)); |
|
|
|
|
|
debugFqdn.set("~debug_fqdn_disabled~"); // will never match any fqdn |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
return debugFqdn.get(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static String initDefaultDomain() { |
|
|
private static String initDefaultDomain() { |
|
|