Package org.springframework.security.web
Class PortMapperImpl
- java.lang.Object
-
- org.springframework.security.web.PortMapperImpl
-
- All Implemented Interfaces:
PortMapper
public class PortMapperImpl extends java.lang.Object implements PortMapper
Concrete implementation ofPortMapperthat obtains HTTP:HTTPS pairs from the application context.By default the implementation will assume 80:443 and 8080:8443 are HTTP:HTTPS pairs respectively. If different pairs are required, use
setPortMappings(Map).
-
-
Constructor Summary
Constructors Constructor Description PortMapperImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.Integer,java.lang.Integer>getTranslatedPortMappings()Returns the translated (Integer -> Integer) version of the original port mapping specified via setHttpsPortMapping()java.lang.IntegerlookupHttpPort(java.lang.Integer httpsPort)Locates the HTTP port associated with the specified HTTPS port.java.lang.IntegerlookupHttpsPort(java.lang.Integer httpPort)Locates the HTTPS port associated with the specified HTTP port.voidsetPortMappings(java.util.Map<java.lang.String,java.lang.String> newMappings)Set to override the default HTTP port to HTTPS port mappings of 80:443, and 8080:8443.
-
-
-
Method Detail
-
getTranslatedPortMappings
public java.util.Map<java.lang.Integer,java.lang.Integer> getTranslatedPortMappings()
Returns the translated (Integer -> Integer) version of the original port mapping specified via setHttpsPortMapping()
-
lookupHttpPort
public java.lang.Integer lookupHttpPort(java.lang.Integer httpsPort)
Description copied from interface:PortMapperLocates the HTTP port associated with the specified HTTPS port.Returns
nullif unknown.- Specified by:
lookupHttpPortin interfacePortMapper- Returns:
- the HTTP port or
nullif unknown
-
lookupHttpsPort
public java.lang.Integer lookupHttpsPort(java.lang.Integer httpPort)
Description copied from interface:PortMapperLocates the HTTPS port associated with the specified HTTP port.Returns
nullif unknown.- Specified by:
lookupHttpsPortin interfacePortMapper- Returns:
- the HTTPS port or
nullif unknown
-
setPortMappings
public void setPortMappings(java.util.Map<java.lang.String,java.lang.String> newMappings)
Set to override the default HTTP port to HTTPS port mappings of 80:443, and 8080:8443. In a Spring XML ApplicationContext, a definition would look something like this:<property name="portMappings"> <map> <entry key="80"><value>443</value></entry> <entry key="8080"><value>8443</value></entry> </map> </property>- Parameters:
newMappings- A Map consisting of String keys and String values, where for each entry the key is the string representation of an integer HTTP port number, and the value is the string representation of the corresponding integer HTTPS port number.- Throws:
java.lang.IllegalArgumentException- if input map does not consist of String keys and values, each representing an integer port number in the range 1-65535 for that mapping.
-
-