public static interface ContractNetInitiator.MessageAccess
An interface to access the messages handled by a contract net initiator. This interface is required in order to access the messages from call-back sub-behaviors registered to handle states of the initiator. It is not required by the corresponding call-back methods because they can get and set these messages with their parameters and return values, respectively.
It is important to note that the access to the methods is only possible if the initiator is currently in an appropriate state. Otherwise, an illegal state exception is thrown. The corresponding states can be found in the documentation for each access method.
ContractNetInitiator
,
ContractNetInitiator.getMessageAccess()
Modifier and Type | Method and Description |
---|---|
List<ModifiableMessage> |
getAllAcceptances()
Returns a modifiable list of all acceptances of proposals that will
be sent to the respective responders.
|
List<Message> |
getAllResponses()
Returns an unmodifiable list of all responses to be handled.
|
List<Message> |
getAllResultNotifications()
Returns an unmodifiable list of all result notifications to be
handled.
|
ModifiableMessage |
getCfp()
Returns the call-for-proposals message provided in the constructor.
|
Message |
getMessage()
Returns an incoming message to be handled.
|
void |
setCfp(ModifiableMessage cfp)
Sets the prepared call-for-proposals message.
|
ModifiableMessage getCfp()
Returns the call-for-proposals message provided in the constructor.
This method can be called in the prepare-cfp state only.
IllegalStateException
- if the method is called in an illegal statevoid setCfp(ModifiableMessage cfp)
Sets the prepared call-for-proposals message.
This method can be called in the prepare-cfp state only.
cfp
- the prepared call-for-proposals messageIllegalStateException
- if the method is called in an illegal stateMessage getMessage()
Returns an incoming message to be handled.
This method can be called in all states handling incoming messages ( propose, refuse, not-understood, inform, failure, out-of-sequence).
IllegalStateException
- if the method is called in an illegal stateList<Message> getAllResponses()
Returns an unmodifiable list of all responses to be handled. As an alternative to propose messages, the protocol also allows refuse and not-understood messages.
This method can be called in the
handle-all-responses
state only.
IllegalStateException
- if the method is called in an illegal stateList<ModifiableMessage> getAllAcceptances()
Returns a modifiable list of all acceptances of proposals that will be sent to the respective responders. Actually, these messages can be either an accept-proposal or a reject-proposal message. Agents may add further messages and modify or remove existing ones.
This method can be called in the handle-propose and handle-all-responses states only.
IllegalStateException
- if the method is called in an illegal stateList<Message> getAllResultNotifications()
Returns an unmodifiable list of all result notifications to be handled.
This method can be called in the handle-all-result-notifications state only.
IllegalStateException
- if the method is called in an illegal stateCopyright © Aimpulse Intelligent Systems GmbH
All rights reserved.