public interface MessagingClient
Interface that describes all agent activities related to message sending and receiving.
The MessagingClient
provides messages from its message queue.
Receiving a message from that queue will remove it. In this regard the
MessagingClient
is different from a usual mail client which also
stores messages for repeated retrieval. Instead, the
MessagingClient
user will need to store received messages
itself, if necessary.
Modifier and Type | Method and Description |
---|---|
UniqueIdentifier |
generateUniqueIdentifier()
Generates an identifier that is globally
unique throughout the whole multiagent system.
|
AgentIdentifier |
getAddress()
Returns the identifier of the agent itself.
|
boolean |
hasMessages()
Checks whether messages are available.
|
boolean |
hasMessages(MessagePattern pattern)
Checks whether messages matching a given pattern are available.
|
Message |
receive()
Receives a message if one is available.
|
Message |
receive(MessagePattern pattern)
Returns a message matching a given pattern if one is available.
|
Message |
send(Message message)
Sets the sender of the message and passes the message to the message
transport system.
|
AgentIdentifier getAddress()
Message send(Message message)
message
- the message to be sentboolean hasMessages()
true
if messages are available, false
otherwiseboolean hasMessages(MessagePattern pattern)
pattern
- the pattern the messages should matchtrue
if messages match the given pattern,
false
otherwiseMessage receive() throws NoSuchMessageException
NoSuchMessageException
- if no message is availableMessage receive(MessagePattern pattern) throws NoSuchMessageException
pattern
- the pattern the message should matchNoSuchMessageException
- if no matching message is availableUniqueIdentifier generateUniqueIdentifier()
Generates an identifier that is globally unique throughout the whole multiagent system. Such unique identifiers can be employed in order to identify messages in terms of the current conversation and the original message they reply to.
Without coordination with other agents, globally unique message identifiers can be created based on the agent identifier which is guaranteed to be unique.
Copyright © Aimpulse Intelligent Systems GmbH
All rights reserved.