|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MessageManager
Interface to creates, deletes and modify dream messages.
Field Summary | |
---|---|
static String |
ITF_NAME
The commonly used name of refer to this interface. |
Method Summary | ||
---|---|---|
void |
addChunk(Message message,
String chunkName,
AbstractChunk chunk)
Adds a chunk in the given message. |
|
AbstractChunk |
addOrReplaceChunk(Message message,
String chunkName,
AbstractChunk chunk)
Adds a chunk in the given message. |
|
void |
addSubMessage(Message message,
Message subMessage)
Adds a sub message to a message. |
|
|
cloneChunk(T chunk)
Clones the given chunk. |
|
|
createChunk(ChunkFactoryReference<T> chunkFactory)
Creates a chunk using the chunk factory referenced by the given reference. |
|
Message |
createMessage()
Creates a new message and returns a reference to the newly created message. |
|
void |
deleteChunk(AbstractChunk<?> chunk)
Deletes the given chunk. |
|
void |
deleteMessage(Message message)
Delete the message referenced by the given reference. |
|
Message |
duplicateMessage(Message message,
boolean clone)
Duplicates a message. |
|
AbstractChunk |
getChunk(Message message,
String chunkName)
Returns the chunk in the given message with the given name. |
|
|
getChunkFactory(Class<T> chunkType)
Returns a reference to a chunk factory for the given chunk type. |
|
Iterator<String> |
getChunkNameIterator(Message message)
Returns an iterator over the chunk names of the given message. |
|
Iterator<Message> |
getSubMessageIterator(Message message)
Returns an iterator over sub messages of the given message. |
|
boolean |
isEmpty(Message message)
Returns true if the message is empty (ie. contains no chunk
and no sub message). |
|
AbstractChunk |
removeChunk(Message message,
String chunkName)
Removes a chunk from the given message. |
|
void |
removeSubMessage(Message message,
Message subMessage)
Removes a sub message from a message. |
Field Detail |
---|
static final String ITF_NAME
Method Detail |
---|
Message createMessage()
void deleteMessage(Message message)
duplicateMessage(org.objectweb.dream.message.Message, boolean)
), this
operation releases the given reference. The message is effectively deleted
only if all its references have been released. In this case, chunks in the
message are removed and recycled, so as message instance.
message
- the reference of the message to delete.
InvalidReference
- if the given message reference is invalid.Message duplicateMessage(Message message, boolean clone)
deleteMessage(org.objectweb.dream.message.Message)
operation only deletes the
message when all the duplicated references have been released
message
- the reference of the message to be duplicated.clone
- the duplication mode. false
for reference
duplication, true
for value duplication.
InvalidReference
- if the given message reference is invalid.<T extends AbstractChunk<T>> ChunkFactoryReference<T> getChunkFactory(Class<T> chunkType)
T
- the chunk type.chunkType
- the class object of the required chunk type.
<T extends AbstractChunk<T>> T createChunk(ChunkFactoryReference<T> chunkFactory)
T
- the chunk type.chunkFactory
- a chunk factory reference.
InvalidReference
- if the given chunk factory reference is invalid.void deleteChunk(AbstractChunk<?> chunk)
chunk
- the chunk to delete.
InvalidReference
- if the given chunk is invalid.<T extends AbstractChunk<T>> T cloneChunk(T chunk)
T
- the type of the chunk to clone.chunk
- the chunk to clone.
InvalidReference
- if the given chunk is invalid.boolean isEmpty(Message message)
true
if the message is empty (ie. contains no chunk
and no sub message).
message
- the reference of a message
true
if the message is empty.
InvalidReference
- if the given message reference is invalid.AbstractChunk getChunk(Message message, String chunkName)
message
- the reference of the messagechunkName
- the name of the chunk.
null
if no chunk can be found.
InvalidReference
- if the given message reference is invalid.void addChunk(Message message, String chunkName, AbstractChunk chunk)
ChunkAlreadyExistException
is thrown.
message
- the reference of the message in which the chunk will be
added.chunkName
- the name of the chunk.chunk
- the chunk to add
InvalidReference
- if the given message reference is invalid.
ChunkAlreadyExistException
- if a chunk with the same name already
exist in the given message.AbstractChunk addOrReplaceChunk(Message message, String chunkName, AbstractChunk chunk)
message
- the reference of the message in which the message will be
added.chunkName
- the name of the chunk.chunk
- the chunk to add
null
.
InvalidReference
- if the given message reference is invalid.AbstractChunk removeChunk(Message message, String chunkName)
UnknownChunkException
is thrown.
message
- the reference of the message from which the chunk will be
removed.chunkName
- the name of the chunk.
InvalidReference
- if the given message reference is invalid.
UnknownChunkException
- if no chunk with the given name can be found
in the message.Iterator<String> getChunkNameIterator(Message message)
message
- a message reference.
InvalidReference
- if the given message reference is invalid.void addSubMessage(Message message, Message subMessage)
message
- the message where the sub message will be added.subMessage
- the sub message.
InvalidReference
- if the given message reference or sub message
reference are invalid.
IllegalArgumentException
- if this operation may creates a cycle (if
message
is already a sub message of
subMessage
). Since this check is expensive, some
implementations may not perform it.void removeSubMessage(Message message, Message subMessage)
message
- the message from which the sub message will be removed.subMessage
- the sub message.
InvalidReference
- if the given message reference or sub message
reference are invalid.
IllegalArgumentException
- if subMessage
is not a sub
message of message
.Iterator<Message> getSubMessageIterator(Message message)
message
- a message reference.
InvalidReference
- if the given message reference or sub message
reference are invalid.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |