Package org.dspace.service
Interface ClientInfoService
- All Known Implementing Classes:
ClientInfoServiceImpl
public interface ClientInfoService
Service that can be used to retrieve information about DSpace clients
-
Method Summary
Modifier and TypeMethodDescriptiongetClientIp(jakarta.servlet.http.HttpServletRequest request) Get the client IP of this request taking into account the X-Forwarded-For header and the "useProxies" settinggetClientIp(String remoteIp, String xForwardedForHeaderValue) Get the client IP of this request taking into account the X-Forwarded-For header and the "useProxies" settingbooleanisRequestFromTrustedProxy(String ipAddress) Whether a request is from a trusted proxy or not.booleanDoes DSpace take into account HTTP proxy headers or not
-
Method Details
-
getClientIp
Get the client IP of this request taking into account the X-Forwarded-For header and the "useProxies" setting- Parameters:
request- The client HTTP request- Returns:
- The IP address of the originating client
-
getClientIp
Get the client IP of this request taking into account the X-Forwarded-For header and the "useProxies" setting- Parameters:
remoteIp- the remote address of the current requestxForwardedForHeaderValue- The value of the X-Forwarded-For header- Returns:
- The IP address of the originating client
-
isUseProxiesEnabled
boolean isUseProxiesEnabled()Does DSpace take into account HTTP proxy headers or not- Returns:
- true if this is the case, false otherwise
-
isRequestFromTrustedProxy
Whether a request is from a trusted proxy or not. Only returns true if trusted proxies are specified and the ipAddress is contained in those proxies. False in all other cases- Parameters:
ipAddress- IP address to check for- Returns:
- true if trusted, false otherwise
-