io.undertow.security.handlers

## Class SinglePortConfidentialityHandler

- java.lang.Object
- - io.undertow.security.handlers.AbstractConfidentialityHandler
  - - io.undertow.security.handlers.SinglePortConfidentialityHandler

All Implemented Interfaces:
  HttpHandler

    public class SinglePortConfidentialityHandler
    extends AbstractConfidentialityHandler

An extension to `AbstractConfidentialityHandler` that uses the Host header from the incoming message and specifies the confidential address by just switching the port.

Author:
  Darran Lofthouse

### Constructor Summary

Constructors
Constructor and Description
`SinglePortConfidentialityHandler(HttpHandler next, int redirectPort)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected URI` `getRedirectURI(HttpServerExchange exchange)` All sub-classes are required to provide an implementation of this method, using the HttpServerExchange for the current request return the address to use for a redirect should confidentiality be required and the request not be confidential.
`protected URI` `getRedirectURI(HttpServerExchange exchange, int port)`

### Methods inherited from class io.undertow.security.handlers.AbstractConfidentialityHandler

`confidentialityRequired, handleRequest, isConfidential`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SinglePortConfidentialityHandler

    public SinglePortConfidentialityHandler(HttpHandler next,
                                            int redirectPort)

### Method Detail

#### getRedirectURI

    protected URI getRedirectURI(HttpServerExchange exchange)
                          throws URISyntaxException

Description copied from class: `AbstractConfidentialityHandler`
All sub-classes are required to provide an implementation of this method, using the HttpServerExchange for the current request return the address to use for a redirect should confidentiality be required and the request not be confidential.

Specified by:
  `getRedirectURI` in class `AbstractConfidentialityHandler`
Parameters:
  `exchange` - - The `HttpServerExchange` for the request being processed.
Returns:
  The `URI` to redirect to.
Throws:
  `URISyntaxException`

#### getRedirectURI

    protected URI getRedirectURI(HttpServerExchange exchange,
                                 int port)
                          throws URISyntaxException

Throws:
  `URISyntaxException`