public abstract class MessageType
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
MessageType.ParameterSpecification
A class representing a parameter or parameter set specification.
|
Modifier and Type | Field and Description |
---|---|
protected MessageType.ParameterSpecification[] |
conversationparams
The conversation relevant parameters.
|
protected java.lang.String |
name
The name of the message type.
|
protected java.util.Map<java.lang.String,MessageType.ParameterSpecification> |
parammap
The parameters by name (name -> parameter spec).
|
protected MessageType.ParameterSpecification[] |
params
The allowed parameters.
|
protected MessageType.ParameterSpecification[] |
paramsets
The allowed parameter sets.
|
Constructor and Description |
---|
MessageType(java.lang.String name,
MessageType.ParameterSpecification[] params,
MessageType.ParameterSpecification[] paramsets)
Create a new message type.
|
Modifier and Type | Method and Description |
---|---|
static void |
addMessageType(MessageType type)
Add a new message type.
|
java.util.Map<java.lang.String,java.lang.Object> |
createReply(java.util.Map<java.lang.String,java.lang.Object> msg)
Create a reply to a message.
|
boolean |
equals(java.lang.Object o)
Test if two message types are equal (based on the name).
|
IContentCodec |
findContentCodec(IContentCodec[] codecs,
IMessageAdapter message,
java.lang.String param)
Find a matching content codec for a given message parameter.
|
IContentCodec |
findContentCodec(IContentCodec[] codecs,
java.util.Map<java.lang.String,java.lang.Object> message,
java.lang.String param)
Find a matching content codec for a given message parameter.
|
abstract java.lang.String[] |
getCodecInfos(java.lang.String name)
Get the en/decode info (important) for a parameter/set.
|
MessageType.ParameterSpecification[] |
getConversationIdentifiers()
Get the conversation identifiers.
|
abstract java.lang.String |
getIdIdentifier()
Get the identifier for fetching the message id.
|
static MessageType |
getMessageType(java.lang.String type)
Get the message type per name.
|
java.lang.String |
getName()
The name of the message type.
|
abstract java.lang.String |
getNonFunctionalPropertiesIdentifier()
Get the identifier for fetching the non-functional properties.
|
MessageType.ParameterSpecification |
getParameter(java.lang.String name)
Get a parameter specification by name (including parameter sets).
|
java.lang.String[] |
getParameterNames()
Get all parameter names.
|
MessageType.ParameterSpecification[] |
getParameters()
Get the default parameters.
|
MessageType.ParameterSpecification |
getParameterSet(java.lang.String name)
Get a parameter specification by name (including parameter sets).
|
java.lang.String[] |
getParameterSetNames()
Get all parameter set names.
|
MessageType.ParameterSpecification[] |
getParameterSets()
Get the default parameter sets.
|
abstract java.lang.String |
getRealReceiverIdentifier()
Get the identifier for fetching the resource identifier id.
|
abstract java.lang.String |
getReceiverIdentifier()
Get the identifier for fetching the receivers.
|
abstract java.lang.String |
getResourceIdIdentifier()
Get the identifier for fetching the resource identifier id.
|
abstract java.lang.String |
getSenderIdentifier()
Get the identifier for fetching the sender.
|
abstract java.lang.String |
getSimplifiedRepresentation(java.util.Map<java.lang.String,java.lang.Object> msg)
Get a simplified human readable representation of the message content.
|
abstract java.lang.String |
getTimestampIdentifier()
Get the identifier for fetching the send date.
|
protected java.lang.String name
protected MessageType.ParameterSpecification[] params
protected MessageType.ParameterSpecification[] paramsets
protected MessageType.ParameterSpecification[] conversationparams
protected java.util.Map<java.lang.String,MessageType.ParameterSpecification> parammap
public MessageType(java.lang.String name, MessageType.ParameterSpecification[] params, MessageType.ParameterSpecification[] paramsets)
name
- The name of the message type.public static MessageType getMessageType(java.lang.String type)
type
- The type name.public static void addMessageType(MessageType type)
type
- The message type.public java.lang.String getName()
public MessageType.ParameterSpecification[] getParameters()
public MessageType.ParameterSpecification[] getParameterSets()
public java.lang.String[] getParameterNames()
public java.lang.String[] getParameterSetNames()
public MessageType.ParameterSpecification getParameter(java.lang.String name)
public MessageType.ParameterSpecification getParameterSet(java.lang.String name)
public MessageType.ParameterSpecification[] getConversationIdentifiers()
public abstract java.lang.String getReceiverIdentifier()
public abstract java.lang.String getSenderIdentifier()
public abstract java.lang.String getIdIdentifier()
public abstract java.lang.String getTimestampIdentifier()
public abstract java.lang.String getResourceIdIdentifier()
public abstract java.lang.String getNonFunctionalPropertiesIdentifier()
public abstract java.lang.String getRealReceiverIdentifier()
public abstract java.lang.String[] getCodecInfos(java.lang.String name)
The
- name of the parameter/set.public abstract java.lang.String getSimplifiedRepresentation(java.util.Map<java.lang.String,java.lang.Object> msg)
The
- message.public IContentCodec findContentCodec(IContentCodec[] codecs, java.util.Map<java.lang.String,java.lang.Object> message, java.lang.String param)
codecs
- The available codecs.message
- The message.param
- The parameter to be (en/de)coded.public IContentCodec findContentCodec(IContentCodec[] codecs, IMessageAdapter message, java.lang.String param)
codecs
- The available codecs.message
- The message.param
- The parameter to be (en/de)coded.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.util.Map<java.lang.String,java.lang.Object> createReply(java.util.Map<java.lang.String,java.lang.Object> msg)
mag
- The message.