indexing description: "API interface to debug services." author: "Patrick Ruckstuhl " date: "$Date$" revision: "$Revision$" class SYSTEM_SERVICE inherit API_SERVICE create make feature -- Basic operations status (a_session: STRING): STRING is -- Query Origo status. local l_msg: O_SYSTEM_STATUS_MESSAGE l_rep: O_GENERAL_STRING_MESSAGE do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session else -- generate and send message create l_msg.make (a_session) send_and_wait_for_reply (l_msg) if is_ok then l_rep ?= last_reply check string_message: l_rep /= Void end Result := l_rep.string end end end mail_all (a_session: STRING; a_subject: STRING; a_text: STRING): BOOLEAN_REF is -- Send a mail to all origo users. local l_msg: O_SYSTEM_MAIL_ALL_MESSAGE do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session else -- generate and send message create l_msg.make (a_session, a_subject, a_text) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end feature -- Creation new_tuple (a_name: STRING): TUPLE is -- Tuple of default-valued arguments to pass to call `a_name'. do if a_name.is_equal (status_name) then create {TUPLE [STRING]}Result elseif a_name.is_equal (mail_all_name) then create {TUPLE [STRING, STRING, STRING]}Result end end feature -- Initialisation self_register is -- Register all actions for this service do register_with_help (agent status, status_name, "Query node status information. (needs system_status permission)") register_with_help (agent mail_all, mail_all_name, "Send a mail to all origo users. (needs system_mail_all permission)") end feature {NONE} -- Implementation status_name: STRING is "status" mail_all_name: STRING is "mail_all" end