io.undertow.server.handlers.proxy

## Class RouteIteratorFactory

- java.lang.Object
- - io.undertow.server.handlers.proxy.RouteIteratorFactory

    public class RouteIteratorFactory
    extends Object

Factory for route/affinity iterator parser. This implementation lazily parses routes while supporting strategies in `RouteParsingStrategy` including ranked routing. The iterator never creates new String instances but returns a CharSequence wrapper from the existing session ID.

Author:
  Radoslav Husar

### Nested Class Summary

Nested Classes
`static class` `RouteIteratorFactory.ParsingCompatibility`

### Constructor Summary

Constructors
Constructor and Description
`RouteIteratorFactory(RouteParsingStrategy routeParsingStrategy, RouteIteratorFactory.ParsingCompatibility parsingCompatibility)`
`RouteIteratorFactory(RouteParsingStrategy routeParsingStrategy, RouteIteratorFactory.ParsingCompatibility parsingCompatibility, String rankedRouteDelimiter)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Iterator<CharSequence>` `iterator(String sessionId)` Returns an `Iterator<CharSequence>` of routes.

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

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

### Constructor Detail

#### RouteIteratorFactory

    public RouteIteratorFactory(RouteParsingStrategy routeParsingStrategy,
                                RouteIteratorFactory.ParsingCompatibility parsingCompatibility)

Parameters:
  `routeParsingStrategy` - route parsing strategy
  `parsingCompatibility` - route parsing compatibility behavior

#### RouteIteratorFactory

    public RouteIteratorFactory(RouteParsingStrategy routeParsingStrategy,
                                RouteIteratorFactory.ParsingCompatibility parsingCompatibility,
                                String rankedRouteDelimiter)

Parameters:
  `routeParsingStrategy` - route parsing strategy
  `parsingCompatibility` - route parsing compatibility behavior
  `rankedRouteDelimiter` - String sequence to split routes at if ranked routing is enabled

### Method Detail

#### iterator

    public Iterator<CharSequence> iterator(String sessionId)

Returns an `Iterator<CharSequence>` of routes.

Parameters:
  `sessionId` - String of sessionID from the cookie/parameter possibly including encoded/appended affinity/route information
Returns:
  routes iterator; never returns `null`