indexing description: "Core origo node." author: "Patrick Ruckstuhl " date: "$Date$" revision: "$Revision$" class NODE_CORE inherit O_NODE redefine register_message_handlers, peer_module end O_CONSTANTS create make feature -- Access Name: STRING is "Origo Core" Version: STRING is "$Revision$" Peer_name: STRING is -- Node's peer name do Result := Core_peer_name end Peer_description: STRING is -- Node's peer description do Result := "Origo core node" end peer_module: P2P_MODULE_CORE -- Peer module. feature {NONE} -- Implementation peergroup_loader (a_pg: P2P_PEERGROUP; an_id: P2P_ID; a_mia: P2P_MODULE_IMPLEMENTATION_ADVERTISEMENT): P2P_MODULE is -- Load OPG do if a_pg = vampeer and an_id.is_equal (origo_peergroup_id) and origo_peergroup_msid.is_equal (a_mia.specification_id) then create {PEERGROUP_CORE} Result.init (a_pg, an_id, a_mia) end end feature -- Message sending send_message_node (a_message: O_MESSAGE; a_node: STRING) is -- Send a_message to a_node. require a_message_ok: a_message /= Void a_node_ok: a_node /= Void and then not a_node.is_empty peer_module_set: peer_module /= Void do if not peer_module.send_message_node (a_message, a_node) then origo_logger.error ("Could not send message "+a_message.out+" to "+a_node) end end feature {NONE} -- Implementation use_cases: ARRAYED_LIST [USE_CASE] -- List of registered use cases. register_use_cases is -- Register use cases. do create use_cases.make (50) use_cases.force (create {BUILD}.make (Current)) use_cases.force (create {COMMUNITY_LIST}.make (Current)) use_cases.force (create {COMMUNITY_RETRIEVE}.make (Current)) use_cases.force (create {COMMUNITY_CREATE}.make (Current)) use_cases.force (create {COMMUNITY_CHANGE_GROUP}.make (Current)) use_cases.force (create {COMMUNITY_LIST_MEMBERS}.make (Current)) use_cases.force (create {COMMUNITY_LIST_PROJECTS}.make (Current)) use_cases.force (create {COMMUNITY_ADD_PROJECT}.make (Current)) use_cases.force (create {COMMUNITY_REMOVE_PROJECT}.make (Current)) use_cases.force (create {COMMUNITY_DELETE}.make (Current)) use_cases.force (create {COMMUNITY_CHANGE_DESCRIPTION}.make (Current)) use_cases.force (create {COMMUNITY_LIST_WIKI_PAGES}.make (Current)) use_cases.force (create {COMMUNITY_RETRIEVE_WIKI_PAGE}.make (Current)) use_cases.force (create {COMMUNITY_ADD_WIKI_PAGE}.make (Current)) use_cases.force (create {COMMUNITY_EDIT_WIKI_PAGE}.make (Current)) use_cases.force (create {COMMUNITY_RENAME_WIKI_PAGE}.make (Current)) use_cases.force (create {COMMUNITY_DELETE_WIKI_PAGE}.make (Current)) use_cases.force (create {USER_CREATE}.make (Current)) use_cases.force (create {USER_LOGIN}.make (Current)) use_cases.force (create {USER_LOGIN_AUTHENTICATED}.make (Current)) use_cases.force (create {USER_LOGIN_KEY}.make (Current)) use_cases.force (create {USER_MY_NAME}.make (Current)) use_cases.force (create {USER_MY_PASSWORD}.make (Current)) use_cases.force (create {USER_MY_EMAIL}.make (Current)) use_cases.force (create {USER_RETRIEVE_PASSWORD}.make (Current)) use_cases.force (create {USER_RETRIEVE_EMAIL}.make (Current)) use_cases.force (create {USER_RETRIEVE_USER_FROM_EMAIL}.make (Current)) use_cases.force (create {USER_PROFILE_VISIBLE}.make (Current)) use_cases.force (create {USER_CHANGE_PROFILE_VISIBLE}.make (Current)) use_cases.force (create {USER_RETRIEVE_OPENIDS_FROM_USER}.make (Current)) use_cases.force (create {USER_RETRIEVE_USER_FROM_OPENID}.make (Current)) use_cases.force (create {USER_ADD_OPENID}.make (Current)) use_cases.force (create {USER_REMOVE_OPENID}.make (Current)) use_cases.force (create {USER_CHANGE_OPENID}.make (Current)) use_cases.force (create {USER_RETRIEVE_FOAF}.make (Current)) use_cases.force (create {USER_REMOVE_FOAF}.make (Current)) use_cases.force (create {USER_ADD_FOAF}.make (Current)) use_cases.force (create {USER_RETRIEVE_INFORMATION}.make (Current)) use_cases.force (create {USER_SET_INFORMATION}.make (Current)) use_cases.force (create {USER_SET_ICON}.make (Current)) use_cases.force (create {USER_RESET_ICON}.make (Current)) use_cases.force (create {USER_KEY}.make (Current)) use_cases.force (create {USER_KEY_GENERATE}.make (Current)) use_cases.force (create {USER_CHANGE_EMAIL}.make (Current)) use_cases.force (create {USER_CHANGE_ACCOUNT_ENABLED}.make (Current)) use_cases.force (create {USER_CHANGE_PASSWORD}.make (Current)) use_cases.force (create {USER_RESET_PASSWORD}.make (Current)) use_cases.force (create {USER_ADD_BOOKMARK}.make (Current)) use_cases.force (create {USER_REMOVE_BOOKMARK}.make (Current)) use_cases.force (create {USER_LIST_BOOKMARK}.make (Current)) use_cases.force (create {USER_SET_WORKITEM_SUBSCRIPTION}.make (Current)) use_cases.force (create {USER_LIST_WORKITEM_SUBSCRIPTION}.make (Current)) use_cases.force (create {USER_LIST_REPORTED_ISSUES}.make (Current)) use_cases.force (create {USER_REQUEST_FRIENDSHIP}.make (Current)) use_cases.force (create {USER_PROCESS_FRIENDSHIP_REQUEST}.make (Current)) use_cases.force (create {USER_REMOVE_FRIENDSHIP}.make (Current)) use_cases.force (create {USER_LIST_FRIENDS}.make (Current)) use_cases.force (create {USER_SEND_MESSAGE}.make (Current)) use_cases.force (create {USER_DISABLE_ACCOUNT}.make (Current)) use_cases.force (create {USER_LIST_COMMUNITIES}.make (Current)) use_cases.force (create {PROJECT_CREATE}.make (Current)) use_cases.force (create {PROJECT_RETRIEVE_ID}.make (Current)) use_cases.force (create {PROJECT_REQUEST_ADD}.make (Current)) use_cases.force (create {PROJECT_REQUEST_RETRIEVE}.make (Current)) use_cases.force (create {PROJECT_LIST}.make (Current)) use_cases.force (create {PROJECT_LIST_PARTIAL}.make (Current)) use_cases.force (create {PROJECT_LIST_PARTIAL_INTERNAL}.make (Current)) use_cases.force (create {PROJECT}.make (Current)) use_cases.force (create {PROJECT_LIST_OF_USER}.make (Current)) use_cases.force (create {PROJECT_MEMBERS}.make (Current)) use_cases.force (create {PROJECT_CHANGE_DESCRIPTION}.make (Current)) use_cases.force (create {PROJECT_CHANGE_LOGO}.make (Current)) use_cases.force (create {PROJECT_LIST_BOOKMARKERS}.make (Current)) use_cases.force (create {PROJECT_LIST_COMMUNITIES}.make (Current)) use_cases.force (create {PROJECT_LIST_INTERNAL}.make (Current)) use_cases.force (create {PROJECT_INTERNAL}.make (Current)) use_cases.force (create {PROJECT_CHANGE_GROUP}.make (Current)) use_cases.force (create {PROJECT_RETRIEVE_STATISTICS}.make (Current)) use_cases.force (create {PROJECT_CHANGE_SETTINGS}.make (Current)) use_cases.force (create {PROJECT_RETRIEVE_STATISTICS_INTERNAL}.make (Current)) use_cases.force (create {AUTH_ALLOWED_FOR_PROJECT}.make (Current)) use_cases.force (create {AUTH_ALLOWED_FOR_COMMUNITY}.make (Current)) use_cases.force (create {WORKITEM_RETRIEVE}.make (Current)) use_cases.force (create {WORKITEM_LIST}.make (Current)) use_cases.force (create {WORKITEM_LIST_PROJECTS}.make (Current)) use_cases.force (create {WORKITEM_LIST_PROJECT}.make (Current)) use_cases.force (create {WORKITEM_SET_READ_STATUS}.make (Current)) use_cases.force (create {WORKITEM_SET_READ_STATUS_PROJECT}.make (Current)) use_cases.force (create {COMMIT_ADD}.make (Current)) use_cases.force (create {WIKI_ADD}.make (Current)) use_cases.force (create {WIKI_RENDER_HTML}.make (Current)) use_cases.force (create {COMMENT_ADD}.make (Current)) use_cases.force (create {RELEASE_ADD}.make (Current)) use_cases.force (create {RELEASE_LIST}.make (Current)) use_cases.force (create {RELEASE_RETRIEVE}.make (Current)) use_cases.force (create {RELEASE_LIST_INTERNAL}.make (Current)) use_cases.force (create {RELEASE_RETRIEVE_INTERNAL}.make (Current)) use_cases.force (create {RELEASE_DELETE}.make (Current)) use_cases.force (create {BLOG_ADD}.make (Current)) use_cases.force (create {ISSUE_ADD}.make (Current)) use_cases.force (create {ISSUE_UPDATE}.make (Current)) use_cases.force (create {ISSUE_COMMENT}.make (Current)) use_cases.force (create {ISSUE_LIST}.make (Current)) use_cases.force (create {ISSUE_LIST_CHANGED}.make (Current)) use_cases.force (create {ISSUE_LIST_TAGS}.make (Current)) use_cases.force (create {ISSUE_RETRIEVE}.make (Current)) use_cases.force (create {ISSUE_SEARCH}.make (Current)) use_cases.force (create {SYSTEM_STATUS}.make (Current)) use_cases.force (create {SYSTEM_MAIL_ALL}.make (Current)) ensure use_cases_set: use_cases /= Void end register_message_handlers is -- Register message handlers. do -- register all use cases register_use_cases use_cases.do_all (agent (a_use_case: USE_CASE) do register_message_handler (a_use_case.namespace, a_use_case.type, agent a_use_case.start) end) end end