Class AuditUtils
- java.lang.Object
-
- org.openehealth.ipf.commons.audit.utils.AuditUtils
-
public class AuditUtils extends Object
Utility functions for obtaining local system context such as local hostname or IP address- Since:
- 3.5
- Author:
- Christian Ohr
-
-
Constructor Summary
Constructors Constructor Description AuditUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getHostFromUrl(String url)
static String
getLocalHostName()
static String
getLocalIPAddress()
static String
getProcessId()
static String
getUserName()
static Optional<InetAddress>
localInetAddress()
-
-
-
Method Detail
-
getProcessId
public static String getProcessId()
- Returns:
- the process ID of the running process
-
getLocalIPAddress
public static String getLocalIPAddress()
- Returns:
- the IP Address of the local host or "unknown"
-
getLocalHostName
public static String getLocalHostName()
- Returns:
- the name of the host or "unknown"
-
getUserName
public static String getUserName()
- Returns:
- the name of the user running the process
-
getHostFromUrl
public static String getHostFromUrl(String url)
- Parameters:
url
- a (remote) url- Returns:
- the host name extracted from the provided URL
-
localInetAddress
public static Optional<InetAddress> localInetAddress()
-
-