note 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 -- Query Origo status. local l_msg: O_SYSTEM_STATUS_MESSAGE l_rep: A_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 (create {A_STRING_VALUE}.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.value end end end mail_all (a_session: STRING; a_subject: STRING; a_text: STRING): BOOLEAN_REF -- 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 (create {A_STRING_VALUE}.make (a_session), create {A_STRING_VALUE}.make (a_subject), create {A_STRING_VALUE}.make (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 -- 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 -- 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 = "status" mail_all_name: STRING = "mail_all" end