note description: "API interface to non-public system services." author: "B. Herlig" date: "$Date$" revision: "$Revision$" class INTERNAL_SYSTEM_SERVICE inherit API_SERVICE O_CONSTANTS create make feature -- Basic operations retrieve_active_projects (a_threshold: INTEGER_REF; a_retrieve_older: BOOLEAN_REF): ARRAY [STRING] -- Retrieves a list of project names with have work-item activity newer or -- older than `threshold' (cutoff in seconds), depending on `a_retrieve_older'. local l_msg: O_SYSTEM_RETRIEVE_ACTIVE_PROJECTS_MESSAGE l_reply: O_SYSTEM_RETRIEVE_ACTIVE_PROJECTS_REPLY_MESSAGE l_reply_list: DS_ARRAYED_LIST [A_STRING_VALUE] l_project_list: DS_ARRAYED_LIST [STRING] do -- argument validiation if a_threshold = Void or else a_threshold < 0 then last_fault := err_invalid_threshold else -- generate and send message create l_msg.make (a_threshold.item, a_retrieve_older.item) send_and_wait_for_reply (l_msg) if is_ok then l_reply ?= last_reply check exists: l_reply /= Void end l_reply_list := l_reply.project_names.sequence create l_project_list.make (l_reply_list.count) from l_reply_list.start until l_reply_list.after loop l_project_list.force_last (l_reply_list.item_for_iteration) -- increment l_reply_list.forth end create Result.make_from_array (l_project_list.to_array) 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 (retrieve_active_projects_name) then create {TUPLE [INTEGER_REF, BOOLEAN_REF]}Result end end feature -- Initialisation self_register -- Register all actions for this service do register_with_help (agent retrieve_active_projects, retrieve_active_projects_name, "Retrieves a list of project names with have work-item activity newer or older than `threshold' (cutoff in seconds), depending on `retrieve_newer'.") end feature {NONE} -- Implementation retrieve_active_projects_name: STRING = "retrieve_active_projects" end