1 #ifndef FIPA_SERVICE_MESSAGE_TRANSPORT_SERVICE_HPP 2 #define FIPA_SERVICE_MESSAGE_TRANSPORT_SERVICE_HPP 5 #include <fipa_acl/fipa_acl.h> 6 #include <boost/function.hpp> 8 #include <fipa_services/transports/Transport.hpp> 9 #include <fipa_services/transports/Configuration.hpp> 10 #include <fipa_services/ServiceDirectory.hpp> 13 namespace agent_management {
14 const std::string
ONTOLOGY =
"fipa-agent-management";
20 namespace message_transport {
73 fipa::acl::AgentID mAgentId;
76 MessageTransportHandlerMap mMessageTransportHandlerMap;
77 MessageTransportPriorityList mMessageTransportPriorityList;
79 mutable std::map<transports::Transport::Type, transports::Transport::Ptr> mActiveTransports;
80 std::vector<transports::Configuration> mTransportConfigurations;
83 std::vector<fipa::services::ServiceLocation> mTransportEndpoints;
92 std::string mServiceSignature;
93 std::set<std::string> mAcceptedServiceSignatures;
99 void stamp(fipa::acl::Letter& msg)
const;
105 bool hasStamp(
const fipa::acl::Letter& msg)
const;
110 fipa::acl::ACLMessage createInternalErrorMessage(
const fipa::acl::ACLMessage& msg,
const std::string& description)
const;
116 bool localForward(
const std::string& receiverName,
const fipa::acl::Letter& msg)
const;
121 fipa::acl::AgentIDList forward(
const fipa::acl::Letter& letter)
const;
123 void forward(
const std::string& receiverName,
const ServiceLocation& location,
const fipa::acl::Letter& letter)
const;
129 bool hasActiveTransport(
const std::string& protocol)
const;
141 void handleData(
const std::string& data);
146 static void removeFromList(
const fipa::acl::AgentID& receiver, fipa::acl::AgentIDList& receiversList);
166 void configure(
const std::vector<transports::Configuration>& configurations) { mTransportConfigurations = configurations; }
175 void activateTransports(
const std::vector<std::string>& transports);
198 std::vector<fipa::services::ServiceLocation> getTransportEndpoints()
const;
205 void handle(fipa::acl::Letter& msg);
211 void handleError(
const fipa::acl::Letter& msg)
const;
218 void registerMessageTransport(
const std::string&
id, MessageTransportHandler handler);
224 void deregisterMessageTransport(
const std::string&
id);
230 void modifyMessageTransport(
const std::string&
id, MessageTransportHandler handler);
239 bool handleInternalCommunication(
const fipa::acl::Letter& letter);
287 void registerClient(
const std::string& clientName,
const std::string& clientDescription);
296 void deregisterClient(
const std::string& clientName);
302 std::string serializeLetter(
const fipa::acl::Letter& letter,
const std::string& signature)
const;
310 #endif // FIPA_SERVICE_MESSAGE_TRANSPORT_SERVICE_HPP boost::function2< bool, const std::string &, const fipa::acl::Letter & > MessageTransportHandler
MessageTransportHandler needs to return success of the delivery.
Definition: MessageTransport.hpp:23
ServiceDirectory::Ptr getServiceDirectory()
Definition: MessageTransport.hpp:278
Type
Builtin transport types that can be activated.
Definition: Transport.hpp:28
std::vector< std::string > MessageTransportPriorityList
Definition: MessageTransport.hpp:26
boost::shared_ptr< ServiceDirectory > Ptr
Definition: ServiceDirectory.hpp:29
const std::string INTERNAL_ERROR
Definition: MessageTransport.hpp:15
void setInternalMessageRepresentationType(const fipa::acl::representation::Type &representation)
Definition: MessageTransport.hpp:245
fipa::acl::representation::Type getInternalMessageRepresentationType() const
Definition: MessageTransport.hpp:251
const std::string ONTOLOGY
Definition: MessageTransport.hpp:14
const std::string INTERNAL_COMMUNICATION
Definition: MessageTransport.hpp:16
std::map< std::string, MessageTransportHandler > MessageTransportHandlerMap
Definition: MessageTransport.hpp:25
std::string getServiceSignature() const
Definition: MessageTransport.hpp:262
void addAcceptedServiceSignature(const std::string &signature)
Definition: MessageTransport.hpp:272
void configure(const std::vector< transports::Configuration > &configurations)
Definition: MessageTransport.hpp:166
std::string Type
Definition: ServiceDirectoryEntry.hpp:14
boost::shared_ptr< Transport > Ptr
Definition: Transport.hpp:46
Service responsible for handling FIPA message and managing the forwarding and relaying.
Definition: MessageTransport.hpp:70
Class to describe the location of a service.
Definition: ServiceLocator.hpp:14
Definition: DistributedServiceDirectory.cpp:5
fipa::acl::AgentID getAgentID() const
Definition: MessageTransport.hpp:164