public abstract class ChannelTranslator extends Object
| Constructor and Description |
|---|
ChannelTranslator() |
| Modifier and Type | Method and Description |
|---|---|
static ChannelTranslator |
compositeTranslator(List<ChannelTranslator> translators)
Creates a channel translator that returns the first successful match
from the list of give translators.
|
static ChannelTranslator |
loadTranslator(InputStream input) |
static ChannelTranslator |
regexTranslator(String regex,
String substitution,
ChannelTranslation.Permission permission)
Creates a channel translator that uses the regex to match the channel and
the optional substitution string to perform the translation.
|
static ChannelTranslator |
regexTranslator(String regex,
String substitution,
ChannelTranslation.Permission permission,
Collection<String> allowedUsers)
Creates a channel translator that uses the regex to match the channel and
the optional substitution string to perform the translation.
|
abstract ChannelTranslation |
translate(ChannelRequest request)
Translates the channel request to the actual channel or formula to connect.
|
ChannelTranslation |
translate(String channel)
Translates the channel name to the actual channel or formula to connect.
|
public ChannelTranslation translate(String channel)
channel - the incoming channel namepublic abstract ChannelTranslation translate(ChannelRequest request)
request - the incoming channel requestpublic static ChannelTranslator regexTranslator(String regex, String substitution, ChannelTranslation.Permission permission)
regex - a regular expressionsubstitution - the substitution string; can be nullpermission - the permission to enforce on the channelpublic static ChannelTranslator regexTranslator(String regex, String substitution, ChannelTranslation.Permission permission, Collection<String> allowedUsers)
regex - a regular expressionsubstitution - the substitution string; can be nullpermission - the permission to enforce on the channelallowedUsers - the users allowed to access the channelpublic static ChannelTranslator compositeTranslator(List<ChannelTranslator> translators)
translators - a list of translatorspublic static ChannelTranslator loadTranslator(InputStream input)
Copyright © 2015. All rights reserved.