indexing description: "User send message message." author: "Marco Zietzling " date: "$Date$" revision: "$Revision$" class O_USER_SEND_MESSAGE_MESSAGE inherit O_SESSION_MESSAGE rename make as make_session redefine make_from_generic, arguments end O_USER_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_session: like session; a_username: like username; a_subject: like subject; a_message: like message) is -- Create. require a_session_ok: a_session /= Void and then not a_session.is_empty a_username_ok: a_username /= Void and then not a_username.is_empty a_subject_ok: a_subject /= Void and then not a_subject.is_empty a_message_ok: a_message /= Void and then not a_message.is_empty do make_session (a_session) username := a_username subject := a_subject message := a_message ensure username_set: username = a_username subject_set: subject = a_subject message_set: message = a_message 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 username := l_args.item (username_argument) subject := l_args.item (subject_argument) message := l_args.item (message_argument) end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := user_namespace end type: STRING is -- Type of the message. once Result := user_send_message_type end username: STRING -- Username to send message to. subject: STRING -- Subject of the message. message: STRING -- Body of the message. arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do Result := Precursor Result.force (username.out, username_argument) Result.force (subject.out, subject_argument) Result.force (message.out, message_argument) end feature {NONE} -- Implementation username_argument: STRING is "username" subject_argument: STRING is "subject" message_argument: STRING is "message" invariant username_ok: username /= Void and then not username.is_empty subject_ok: subject /= Void and then not subject.is_empty message_ok: message /= Void and then not message.is_empty end