public class KrakenTransportLayerMappingFactory extends Object
TransportLayerMappingStrategy
implementations given a specific strategy identifier string.
Handles both, the UDP and TCP strategies, i.e.: KrakenTcpProtocolMapperStrategy
and KrakenUdpProtocolMapperStrategy
.
Custom strategies may be registered during runtime.
The default factory createDefaultKrakenTransportLayerMappingFactory()
only provides a
destination port strategy for TCP/UDP.Modifier and Type | Field and Description |
---|---|
static String |
DESTINATION_PORT_STRATEGY |
Constructor and Description |
---|
KrakenTransportLayerMappingFactory() |
Modifier and Type | Method and Description |
---|---|
static KrakenTransportLayerMappingFactory |
createDefaultKrakenTransportLayerMappingFactory()
Creates a default transport layer mapping factory that consists of only one strategy: a Destination port to
application layer protocol strategy, i.e.
|
KrakenTcpProtocolMapperStrategy |
createTcpMappingStrategy(String mappingStrategy)
Tries to create a new mapping strategy using the passed identifier to determine the mapping class that will be
instantiated using the default constructor.
|
KrakenUdpProtocolMapperStrategy |
createUdpMappingStrategy(String mappingStrategy)
Tries to create a new mapping strategy using the passed identifier to determine the mapping class that will be
instantiated using the default constructor.
|
void |
registerTcpStrategy(String tcpStrategyId,
Class<? extends KrakenTcpProtocolMapperStrategy> tcpStrategyClass)
Registers a new TCP mapping strategy, the provided class must define a default constructor.
|
void |
registerUdpStrategy(String udpStrategyId,
Class<? extends KrakenUdpProtocolMapperStrategy> udpStrategyClass)
Registers a new UDP mapping strategy, the provided class must define a default constructor
|
public static final String DESTINATION_PORT_STRATEGY
public static KrakenTransportLayerMappingFactory createDefaultKrakenTransportLayerMappingFactory()
KrakenTcpDestinationPortProtocolMapper
and KrakenUdpDestinationPortProtocolMapper
.public void registerTcpStrategy(String tcpStrategyId, Class<? extends KrakenTcpProtocolMapperStrategy> tcpStrategyClass)
tcpStrategyId
- the unique strategy identifiertcpStrategyClass
- the class to map to the identifierpublic void registerUdpStrategy(String udpStrategyId, Class<? extends KrakenUdpProtocolMapperStrategy> udpStrategyClass)
udpStrategyId
- the unique strategy identifierudpStrategyClass
- the class to map to the identifierpublic KrakenTcpProtocolMapperStrategy createTcpMappingStrategy(String mappingStrategy)
mappingStrategy
- the identifier that was used to register the TCP mapping strategypublic KrakenUdpProtocolMapperStrategy createUdpMappingStrategy(String mappingStrategy)
mappingStrategy
- the identifier that was used to register the UDP mapping strategyCopyright © 2013–2015 Institute of networks and security. All rights reserved.