Platform SDK Java 8.5 API Reference

com.genesyslab.platform.webmedia.protocol.callback
Class CallbackProtocolFactory

java.lang.Object
  extended by com.genesyslab.platform.commons.protocol.AbstractProtocolFactory
      extended by com.genesyslab.platform.webmedia.protocol.callback.CallbackProtocolFactory
All Implemented Interfaces:
ProtocolDescriptionSupport, ProtocolFactory
Direct Known Subclasses:
CallbackInternalProtocolFactory

public class CallbackProtocolFactory
extends AbstractProtocolFactory

Callback protocol specific messages factory.
It is internally used by the Callback protocol for messages transportation.

It also may be used for user XML serializer creation:

 XmlMessageSerializer serializer = new XmlMessageSerializer(new CallbackProtocolFactory());

 // save message to file:
 serializer.serialize(msg, new StreamResult(new FileWriter(filename)));

 // restore message from file:
 msg = serializer.deserialize(new StreamSource(new FileReader(filename)));
 

See Also:
XmlMessageSerializer

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.genesyslab.platform.commons.protocol.ProtocolFactory
ProtocolFactory.MessageVerificationReason, ProtocolFactory.MessageVerificationSupport
 
Field Summary
 boolean enableProtocolUnknownMessageDelivery
          Flag to enable support of "protocol unknown" event messages.
It is enabled by default and can be switched off in case of backward compatibility issues.
Disabling PSDK Customization option is PsdkCustomization.PsdkOption.DisableUnknownProtocolMessageDelivery.
static ProtocolDescription PROTOCOL_DESCRIPTION
           
 
Constructor Summary
CallbackProtocolFactory()
           
 
Method Summary
protected  Message createEvent(int id)
           
 Message createMessage(int id)
          Creates protocol Message by id.
 Message createMessage(int id, java.lang.String name)
          Creates protocol Message by id.
protected  Message createRequest(int id)
           
protected  java.lang.String getEventMessageName(int id)
           
 java.lang.Class<? extends Message> getMessageClass(java.lang.String messageName)
           
static int getMessageId(java.lang.String tagName)
           
 java.lang.String getMessageName(int id)
          Returns message name by its id.
static java.lang.String getMessageTagName(int messageId)
           
 ProtocolDescription getProtocolDescription()
          Returns protocol description in format <Category>.<Name>
 java.lang.String getProtocolVersion()
          Returns protocol version.
 java.lang.String getReferenceAttributeName()
          Gets protocol's reference attribute name.
protected  java.lang.String getRequestMessageName(int id)
           
 Message unknownProtocolMessage(int messageId)
          Creates unknown message with a specified message id.
 
Methods inherited from class com.genesyslab.platform.commons.protocol.AbstractProtocolFactory
getProtocolData, setProtocolData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROTOCOL_DESCRIPTION

public static final ProtocolDescription PROTOCOL_DESCRIPTION

enableProtocolUnknownMessageDelivery

public boolean enableProtocolUnknownMessageDelivery
Flag to enable support of "protocol unknown" event messages.
It is enabled by default and can be switched off in case of backward compatibility issues.
Disabling PSDK Customization option is PsdkCustomization.PsdkOption.DisableUnknownProtocolMessageDelivery.

Constructor Detail

CallbackProtocolFactory

public CallbackProtocolFactory()
Method Detail

getProtocolDescription

public ProtocolDescription getProtocolDescription()
Description copied from interface: ProtocolFactory
Returns protocol description in format <Category>.<Name>

Returns:
protocol category and name

getProtocolVersion

public java.lang.String getProtocolVersion()
Description copied from interface: ProtocolFactory
Returns protocol version.

Returns:
protocol version

createRequest

protected Message createRequest(int id)

createEvent

protected Message createEvent(int id)

getEventMessageName

protected java.lang.String getEventMessageName(int id)

getRequestMessageName

protected java.lang.String getRequestMessageName(int id)

getMessageClass

public java.lang.Class<? extends Message> getMessageClass(java.lang.String messageName)
Overrides:
getMessageClass in class AbstractProtocolFactory

getMessageName

public java.lang.String getMessageName(int id)
Description copied from interface: ProtocolFactory
Returns message name by its id.

Parameters:
id - message id
Returns:
message name

createMessage

public Message createMessage(int id)
Description copied from class: AbstractProtocolFactory
Creates protocol Message by id.

Specified by:
createMessage in interface ProtocolFactory
Overrides:
createMessage in class AbstractProtocolFactory
Parameters:
id - id of the message
Returns:
Message subclass for the specified id

createMessage

public Message createMessage(int id,
                             java.lang.String name)
Creates protocol Message by id. It also may use message name to recognize request or event message type to help with handling of messages with equal message ids (in some protocols).

Parameters:
id - id of the message
name - name of the message or null
Returns:
Message subclass for the specified id
Throws:
java.lang.IllegalArgumentException - if message with such id can't be created

getMessageTagName

public static java.lang.String getMessageTagName(int messageId)
                                          throws ProtocolException
Throws:
ProtocolException

getMessageId

public static int getMessageId(java.lang.String tagName)
                        throws ProtocolException
Throws:
ProtocolException

unknownProtocolMessage

public Message unknownProtocolMessage(int messageId)
Description copied from class: AbstractProtocolFactory
Creates unknown message with a specified message id.

Overrides:
unknownProtocolMessage in class AbstractProtocolFactory
Returns:
unknown message with a specified message id

getReferenceAttributeName

public java.lang.String getReferenceAttributeName()
Description copied from class: AbstractProtocolFactory
Gets protocol's reference attribute name.

Overrides:
getReferenceAttributeName in class AbstractProtocolFactory
Returns:
reference attribute name or null.

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.