Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.acegisecurity.util
Class PortMapperImpl

    java.lang.Object
      org.acegisecurity.util.PortMapperImpl

All Implemented Interfaces:
  PortMapper

    public class PortMapperImpl

extends Object
implements PortMapper

Concrete implementation of `PortMapper` that 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)`.

Version:
  $Id: PortMapperImpl.java,v 1.4 2005/11/25 04:29:32 benalex Exp $
Author:
  Ben Alex, colin sampaleanu

Constructor Summary
`PortMapperImpl()`

Method Summary
`Map` | `getTranslatedPortMappings()` Returns the translated (Integer -> Integer) version of the original port mapping specified via setHttpsPortMapping()
`Integer` | `lookupHttpPort(Integer httpsPort)` Locates the HTTP port associated with the specified HTTPS port.
`Integer` | `lookupHttpsPort(Integer httpPort)` Locates the HTTPS port associated with the specified HTTP port.
`void` | `setPortMappings(Map newMappings)` Set to override the default HTTP port to HTTPS port mappings of 80:443, and 8080:8443.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PortMapperImpl

    public PortMapperImpl()

Method Detail

### setPortMappings

    public void setPortMappings(Map 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:
    `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.

### getTranslatedPortMappings

    public Map getTranslatedPortMappings()

  Returns the translated (Integer -> Integer) version of the original port mapping specified via setHttpsPortMapping()

  Returns:
    DOCUMENT ME!

### lookupHttpPort

    public Integer lookupHttpPort(Integer httpsPort)

  Description copied from interface: `PortMapper`
  Locates the HTTP port associated with the specified HTTPS port.

  Returns `null` if unknown.

  Specified by:
    `lookupHttpPort` in interface `PortMapper`
  Returns:
    the HTTP port or `null` if unknown

### lookupHttpsPort

    public Integer lookupHttpsPort(Integer httpPort)

  Description copied from interface: `PortMapper`
  Locates the HTTPS port associated with the specified HTTP port.

  Returns `null` if unknown.

  Specified by:
    `lookupHttpsPort` in interface `PortMapper`
  Returns:
    the HTTPS port or `null` if unknown

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.