com.genesyslab.platform.webmedia.protocol
Class WebmediaChannel
java.lang.Object
com.genesyslab.platform.commons.protocol.AbstractChannel
com.genesyslab.platform.commons.protocol.DuplexChannel
com.genesyslab.platform.commons.protocol.ClientChannel
com.genesyslab.platform.webmedia.protocol.WebmediaChannel
- All Implemented Interfaces:
- AsyncChannel, AsyncChannelOperations, AsyncInvokerSupport, Channel, ChannelListenerSupport, ConfigurationSupport, ConnectionInvokerSupport, EndpointSupport, InputChannel, InterceptorSupport, LogMessageFilterSupport, MessageReceiver, MessageReceiverManagement, OutputChannel, Protocol, ProtocolDescriptionSupport, Receiver, ReceiverManagement, RequestChannel
- Direct Known Subclasses:
- CallbackProtocol, EmailProtocol, OptionalRegistrationChannel
public abstract class WebmediaChannel
- extends ClientChannel
It's an abstract base class for all WebMedia protocols including
BasicChat, FlexChat, Callback and XML based Email protocols.
It initializes XML transport for protocol connection.
Specific logic is included here for handling of some XML exceptions.
XML 1.0 specification accepts text values content with limited character range.
Allowed characters are described here -
http://www.w3.org/TR/REC-xml/#dt-character.
By this way, server working with XML 1.0 specification will reject messages with illegal characters
even if that values are properly encoded with entities like 
.
In this case it is possible to get error like
'SAXParseException: Character reference "" is an invalid XML character'.
Better solution in this case is to do not use illegal characters in WebMedia protocols: in chat messages,
email messages bodies, email messages fields like subject, and so on -
all text properties of all web media messages.
To help users to resolve this issue optional specific replacement logic has been added here.
So, user can configure WebMedia protocols to automatically eliminate illegal characters before send.
By this way wrong characters can be replaced with some marker or removed.
It can be done by two ways:
- Protocol instance configuration code
For example, EmailProtocol can be initialized like this:
protocol = new EmailProtocol(new Endpoint("emailServer", host, port));
PropertyConfiguration conf = new PropertyConfiguration();
conf.setBoolean(
WebmediaChannel.OPTION_NAME_REPLACE_ILLEGAL_UNICODE_CHARS,
true);
conf.setOption(
WebmediaChannel.OPTION_NAME_ILLEGAL_UNICODE_CHARS_REPLACEMENT,
"?");
protocol.configure(conf);
protocol.open();
- With system properties options
Use following system properties to enable replacement functionality:
-Dcom.genesyslab.platform.WebMedia.Email.replace-illegal-unicode-chars=true
-Dcom.genesyslab.platform.WebMedia.Email.illegal-unicode-chars-replacement=?
-Dcom.genesyslab.platform.WebMedia.BasicChat.replace-illegal-unicode-chars=true
-Dcom.genesyslab.platform.WebMedia.FlexChat.replace-illegal-unicode-chars=true
-Dcom.genesyslab.platform.WebMedia.Callback.replace-illegal-unicode-chars=true
...and so on...
These options affect all instances of particular protocol type, but are overridden
with explicit configuration code on particular protocol instance.
Replacement value property is optional. If it is not specified illegal chars will be removed.
- See Also:
BasicChatProtocol
,
FlexChatProtocol
,
CallbackProtocol
,
EmailProtocol
Methods inherited from class com.genesyslab.platform.commons.protocol.ClientChannel |
beginClose, beginOpen, beginRequest, close, close, closeAsync, closeAsync, disableConnectionOperations, doBeginRequest, doBeginRequest, doRequest, endRequest, endRequest, fireUnsolicitedEvents, getCopyResponse, getInvoker, getOpenTimeoutException, getReferenceBuilder, onOpen, onReceiveMessage, onSend, onUnexpectedHandshakeMessage, open, openAsync, openAsync, request, request, requestAsync, requestAsync, setAddressResolver, setAddressResolverParams, setAddressResolverParams, setCopyResponse, setEndpoint, setHandshakeFinished, setHandshakePhase, setHandshakeUnsolicitedEventsPassLimit, setRegistrationHandler, setState, submitRegMessage, throwOnUnReferenceableRequest |
Methods inherited from class com.genesyslab.platform.commons.protocol.DuplexChannel |
addListener, cancelCloseTimeout, cancelOpenTimeout, clearInput, close, closeAsync, createChannelClosedEvent, createConnectionClosedEvent, doBeginClose, doClose, doSend, downgradeConnection, getDefaultRestriction, getEnpointPrefixInfo, getInputSize, getInterceptor, getLocalEndPoint, getLocalEndpointInfo, getLogMessageFilter, getProtocolDescription, getProtocolFactory, getProtocolId, getRemoteEndPoint, getTimeoutException, initPackager, isMessageAllowed, notifyWithObject, onClose, onFireClosed, onFireErrorEvent, onFireOpened, open, openAsync, openAsync, processClose, processCloseAll, receive, receive, receivedMessage, releaseReceivers, removeListener, resetReceiver, resumeReading, send, setConnectionInvoker, setExternalTransport, setInputSize, setLogMessageFilter, setMessageHandler, setProtocolData, setReceiver, startUpgradeConnection, stopReading, toString, triggerWithObject, upgradeConnection, waitForObject |
Methods inherited from class com.genesyslab.platform.commons.protocol.AbstractChannel |
addChannelListener, configure, connectionContext, copyTLSSettings, fireClosed, fireErrorEvent, fireErrorEvent, generateChannelId, getChannelId, getConfiguration, getDefaultInvoker, getEndpoint, getListenerHelper, getServerContext, getState, getStateMods, getTimeout, internal, onSetEndpoint, releaseDefaultInvoker, removeChannelListener, setConfiguration, setInvoker, setServerContext, setState, setTimeout, throwNotClosed, throwNotOpened, throwNotOpenedOnClose, throwNotOpenedOnSend, throwNull, throwNullEndpoint |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OPTION_NAME_TARGET_XML_VERSION
public static final java.lang.String OPTION_NAME_TARGET_XML_VERSION
- See Also:
- Constant Field Values
OPTION_NAME_REPLACE_ILLEGAL_UNICODE_CHARS
public static final java.lang.String OPTION_NAME_REPLACE_ILLEGAL_UNICODE_CHARS
- See Also:
- Constant Field Values
OPTION_NAME_ILLEGAL_UNICODE_CHARS_REPLACEMENT
public static final java.lang.String OPTION_NAME_ILLEGAL_UNICODE_CHARS_REPLACEMENT
- See Also:
- Constant Field Values
WebmediaChannel
public WebmediaChannel(ProtocolFactory protocolFactory,
ReferenceBuilder refBuilder,
long timeout)
WebmediaChannel
public WebmediaChannel(Endpoint endpoint,
ProtocolFactory protocolFactory,
ReferenceBuilder refBuilder,
long timeout)
createConnection
protected Connection createConnection(Endpoint endpoint)
- Overrides:
createConnection
in class DuplexChannel
getDialect
protected abstract com.genesyslab.platform.commons.connection.impl.xml.ProtocolDialect getDialect()
applyConfiguration
public void applyConfiguration()
- Overrides:
applyConfiguration
in class DuplexChannel
lookupConnectionParameter
protected java.lang.String lookupConnectionParameter(java.lang.String propName,
PsdkCustomization.PsdkOption psdkOption)
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.