35 #include <sys/socket.h>
78 const socklen_t& sock);
80 const socklen_t& sock);
82 const socklen_t& sock);
84 const socklen_t& sock);
86 const socklen_t& sock);
88 const socklen_t& sock);
90 const socklen_t& sock);
92 const socklen_t& sock);
94 const socklen_t& sock);
96 const socklen_t& sock);
102 const std::string& name)
const;
131 const socklen_t& sock)
const;
132 void notify(
const std::string& url,
133 const std::string& notification)
const;
135 const std::string& reference);
137 const std::string& reference);
139 const std::string& reference);
145 std::string
hub_url(
void)
const;
Abstract XML node base class.
std::vector< std::string > get_subscriptions(const GXml &xml) const
Returns subscriptions from XML document.
std::string m_hub_id
Hub identifier used by the hub when it sends message itself rather than forwarding from others...
void handle_request(const socklen_t &sock)
Reads the client message and runs appropriate function.
std::string hub_url(void) const
Return Hub URL.
void post_samp_void(const socklen_t &sock) const
Post SAMP void massage to client.
void delete_samp_file(void) const
Delete the lockfile.
std::string print(const GChatter &chatter=NORMAL) const
Print VO hub information.
GVOHub & operator=(const GVOHub &hub)
Assignment operator.
void free_members(void)
Delete class members.
void post_samp_ok(const socklen_t &sock) const
Post SAMP ok massage to client.
void request_declare_subscriptions(const GXml &xml, const socklen_t &sock)
Handles subscriptions declaration requests.
void request_get_subscriptions(const GXml &xml, const socklen_t &sock)
Handles subscriptions getting requests.
void notify_metadata(const client &client, const std::string &reference)
Notify client about the metadata of another client.
void request_register(const GXml &xml, const socklen_t &sock)
Handles registration requests.
Definition of interface for all GammaLib classes.
GVOHub(void)
Void constructor.
std::string documentation
std::string get_mtype(const GXml &xml) const
Extract mtype from XML request.
void request_get_subscribed_clients(const GXml &xml, const socklen_t &sock)
Handles subscribed client information requests.
std::string m_hub_path
Hub path.
void request_get_registered_clients(const GXml &xml, const socklen_t &sock)
Handles registered client information requests.
void init_members(void)
Initialise class members.
virtual ~GVOHub(void)
Destructor.
std::string random_string(const size_t &length) const
Generates random string of characters.
void start_hub(void)
Starts the SAMP hub socket and listens on it.
Interface class for all GammaLib classes.
std::string m_secret
Secret Hub key.
std::vector< client > m_clients
Clients.
void notify_register(const client &client, const std::string &reference)
Notify client about another client registering at Hub.
void request_declare_metadata(const GXml &xml, const socklen_t &sock)
Handles metadata declaration requests.
std::string get_hub_lockfile(void) const
Returns SAMP Hub lockfile URL.
void start(void)
Start Hub.
std::string get_client_key(const GXml &xml) const
Extract client key from XML request.
void request_get_metadata(const GXml &xml, const socklen_t &sock)
Handles a metadata requests.
std::vector< std::string > subscriptions
void request_notify_all(const GXml &xml, const socklen_t &sock)
Handle request to notify all clients.
GVOHub * clone(void) const
Clone object.
void post_string(const std::string &content, const socklen_t &sock) const
Post string content to client.
void request_unregister(const GXml &xml, const socklen_t &sock)
Handles unregistration requests.
std::string m_version
The version of the SAMP Standard Profile implemented by the hub.
void request_shutdown(const socklen_t &sock)
Handles Hub shutdown requests.
bool m_shutdown
Shutdown request.
std::string get_response_value(const GXmlNode *node, const std::string &name) const
Returns value for a named parameter.
void clear(void)
Clear object.
void request_set_xml_rpc_callback(const GXml &xml, const socklen_t &sock)
Handles XML-RPC callback setting requests.
void notify_table_load(const GVOHub::client &client, const GXml &xml)
Notify client about VO table loading.
void notify_unregister(const client &client, const std::string &reference)
Notify client about another client unregistering at Hub.
void create_samp_file(void) const
Create the lockfile.
std::string get_client_name(const GXml &xml) const
Return client name from XML message.
std::string m_hub_port
Hub port.
void request_ping(const socklen_t &sock)
Handles ping requests.
void copy_members(const GVOHub &client)
Copy class members.
void notify(const std::string &url, const std::string ¬ification) const
Send notification to client.
std::string get_callback_url(const GXml &xml) const
Returns callback URL of client.
int get_socket(void)
Get Hub socket.
std::string classname(void) const
Return class name.
std::string m_hub_host
Hub host.
int get_client_index(const GXml &xml) const
Extract client index in shared memory from XML request.
void notify_image_load(const client &client, const GXml &xml)
Notify client about image loading.