com.genesyslab.platform.commons.connection.impl.xml.XmlStructureHandler
, ConfigurationSupport
, com.genesyslab.platform.commons.protocol.runtime.codec.CustomPackager
, com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
BasicChatEventListCodec
, EventInfoListCodec
, SearchResultCodec
public abstract class XmlComplexTypeListCodec extends com.genesyslab.platform.commons.protocol.runtime.codec.NoDataCodec implements com.genesyslab.platform.commons.connection.impl.xml.XmlStructureHandler, com.genesyslab.platform.commons.protocol.runtime.codec.CustomPackager, ConfigurationSupport
Constructor | Description |
---|---|
XmlComplexTypeListCodec() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
append(java.lang.Object state,
java.lang.String propertyName,
CompoundValue complex) |
|
void |
appendLogValue(java.lang.StringBuffer buf,
java.lang.Object customTypeObject,
boolean truncate,
boolean hide) |
Appends value of the custom-type object to the buffer.
|
void |
configure(ConnectionConfiguration config) |
|
protected abstract CompoundValue |
createCompoundValue(java.lang.Object state,
java.lang.String attributeId) |
|
protected java.lang.String |
createElement(DataSupport data,
com.genesyslab.platform.commons.connection.impl.xml.XmlMessage xmlMessage,
AttributeDescription info) |
|
protected abstract java.util.List |
createList(java.lang.Object state,
java.lang.String attributeId) |
|
java.lang.Object |
decodeFromXml(javax.xml.transform.Source attributeElement,
AttributeDescription attributeDescription) |
Deserializes custom-type object from xml representation.
|
java.lang.Object |
encodeForConnection(java.lang.Object customTypeObject,
java.lang.String id,
MessageTransport transport,
java.lang.Object transportState) |
Serializes custom-type object to the form, that can be accepted
by connection.
|
void |
encodeToXml(java.lang.Object customTypeObject,
javax.xml.transform.Result attributeElement) |
Serializes custom-type object to xml.
|
ConnectionConfiguration |
getConfiguration() |
|
protected java.util.List |
getList(java.lang.Object state,
java.lang.String propertyName) |
|
boolean |
needsProcessing(java.lang.Object state,
java.lang.String attributeId,
org.w3c.dom.Element complexElement) |
|
void |
onAttribute(java.lang.String id,
java.lang.Object value) |
|
java.lang.Object |
onComplexAttribute(java.lang.Object state,
java.lang.String attributeId,
org.w3c.dom.Element complexElement) |
Indicates that complex (compound) attribute is processed.
|
java.lang.Object |
onComplexEnd(java.lang.Object state,
java.lang.String attributeId) |
|
void |
onMessageEnd() |
|
void |
onMessageStart(Message message) |
|
void |
setMessage(Message message) |
Sets message this codec works on.
|
void |
setProtocolData(java.lang.Object protocolData) |
Sets additional protocol specific data for this codec.
|
protected abstract java.lang.String |
translateAttributeId(java.lang.String attributeId) |
getLogType, getNS
public void setProtocolData(java.lang.Object protocolData)
com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
It is highly recommended to implement the protocolData object
as set of interfaces that in turn provide access to codec specific
data. Do not use protocolData as an object for a single codec,
since it will be impossible to extend such object.
Wrong: CodecData data = (CodecData) protocolData;
Right: CodecData data =
((CodecDataHolder) protocolData).getCodecData();
setProtocolData
in interface com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
setProtocolData
in class com.genesyslab.platform.commons.protocol.runtime.codec.NoDataCodec
protocolData
- protocol specific datapublic void setMessage(Message message)
com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
setMessage
in interface com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
setMessage
in class com.genesyslab.platform.commons.protocol.runtime.codec.NoDataCodec
message
- protocol specific datapublic java.lang.Object encodeForConnection(java.lang.Object customTypeObject, java.lang.String id, MessageTransport transport, java.lang.Object transportState) throws PlatformException
com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
encodeForConnection
in interface com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
customTypeObject
- object to serializeid
- attribute idtransport
- message transporttransportState
- state of the transportPlatformException
- if some problems occurredprotected java.lang.String createElement(DataSupport data, com.genesyslab.platform.commons.connection.impl.xml.XmlMessage xmlMessage, AttributeDescription info)
public java.lang.Object decodeFromXml(javax.xml.transform.Source attributeElement, AttributeDescription attributeDescription) throws com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
decodeFromXml
in interface com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
attributeElement
- xml attribute to restore the data fromattributeDescription
- attribute description objectcom.genesyslab.platform.commons.protocol.runtime.codec.CodecException
- if there is problems with xml datapublic void encodeToXml(java.lang.Object customTypeObject, javax.xml.transform.Result attributeElement) throws com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
encodeToXml
in interface com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
customTypeObject
- object to serializeattributeElement
- xml attribute to store the data incom.genesyslab.platform.commons.protocol.runtime.codec.CodecException
- if some codec problems occurredpublic void appendLogValue(java.lang.StringBuffer buf, java.lang.Object customTypeObject, boolean truncate, boolean hide) throws com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
appendLogValue
in interface com.genesyslab.platform.commons.protocol.runtime.codec.CustomTypeCodec
buf
- buffer to append datacustomTypeObject
- value of custom-type objecttruncate
- whether long value should be truncatedhide
- whether value should be hiddencom.genesyslab.platform.commons.protocol.runtime.codec.CodecException
- if some codec problems occurredpublic java.lang.Object onComplexAttribute(java.lang.Object state, java.lang.String attributeId, org.w3c.dom.Element complexElement) throws com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
com.genesyslab.platform.commons.connection.impl.xml.XmlStructureHandler
onComplexAttribute
in interface com.genesyslab.platform.commons.connection.impl.xml.XmlStructureHandler
state
- state of the handlerattributeId
- attribute namecomplexElement
- DOM element of complex typecom.genesyslab.platform.commons.protocol.runtime.codec.CodecException
public boolean needsProcessing(java.lang.Object state, java.lang.String attributeId, org.w3c.dom.Element complexElement)
needsProcessing
in interface com.genesyslab.platform.commons.connection.impl.xml.XmlStructureHandler
public java.lang.Object onComplexEnd(java.lang.Object state, java.lang.String attributeId)
onComplexEnd
in interface com.genesyslab.platform.commons.connection.impl.xml.XmlStructureHandler
public void onAttribute(java.lang.String id, java.lang.Object value) throws com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
onAttribute
in interface com.genesyslab.platform.commons.protocol.runtime.codec.CustomPackager
com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
public void onMessageEnd() throws com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
onMessageEnd
in interface com.genesyslab.platform.commons.protocol.runtime.codec.CustomPackager
com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
public void onMessageStart(Message message)
onMessageStart
in interface com.genesyslab.platform.commons.protocol.runtime.codec.CustomPackager
protected abstract CompoundValue createCompoundValue(java.lang.Object state, java.lang.String attributeId) throws com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
protected abstract java.lang.String translateAttributeId(java.lang.String attributeId)
protected abstract java.util.List createList(java.lang.Object state, java.lang.String attributeId)
protected void append(java.lang.Object state, java.lang.String propertyName, CompoundValue complex)
protected java.util.List getList(java.lang.Object state, java.lang.String propertyName)
public ConnectionConfiguration getConfiguration()
getConfiguration
in interface ConfigurationSupport
public void configure(ConnectionConfiguration config)
configure
in interface ConfigurationSupport
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.