indexing description: "Community change group message." author: "Marco Zietzling " date: "$Date$" revision: "$Revision$" class O_COMMUNITY_CHANGE_GROUP_MESSAGE inherit O_SESSION_MESSAGE rename make as make_session redefine make_from_generic, arguments end O_COMMUNITY_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_session: like session; a_community: like community; a_user: like user; a_group: like group) is -- Create. require a_session_ok: a_session /= Void and then not a_session.is_empty a_community_ok: a_community /= Void and then not a_community.is_empty a_user_ok: a_user /= Void and then not a_user.is_empty a_group_ok: a_group >= 0 do make_session (a_session) community := a_community user := a_user group := a_group ensure community_set: community = a_community user_set: user = a_user group_set: group = a_group end make_from_generic (a_msg: O_GENERIC_MESSAGE) is -- Create from a generic message. local l_args: HASH_TABLE [STRING, STRING] do Precursor (a_msg) l_args := a_msg.arguments community := l_args.item (community_argument) user := l_args.item (user_argument) group := l_args.item (group_argument).to_integer end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := community_namespace end type: STRING is -- Type of the message. once Result := community_change_group_type end community: STRING -- Community name user: STRING -- User name group: INTEGER -- Access group id arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do Result := Precursor Result.force (community, community_argument) Result.force (user, user_argument) Result.force (group.out, group_argument) end feature {NONE} -- Implementation community_argument: STRING is "community" user_argument: STRING is "user" group_argument: STRING is "group" invariant community_ok: community /= Void and then not community.is_empty user_ok: user /= Void and then not user.is_empty group_ok: group >= 0 end