com.zasysdev.zamae
Class ObjectMessenger

java.lang.Object
  extended by com.zasysdev.zamae.ObjectMessenger

public final class ObjectMessenger
extends java.lang.Object

This class provides all messaging facilities for inter-object communication in Prosciutto


Field Summary
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_OFFFOCUS
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_OFFFOCUS_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ON_APP_START
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ON_APP_START_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ON_ASKING_FOR_DELETION
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ON_ASKING_FOR_DELETION_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ON_RESET_APP
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ON_RESET_APP_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONAPP_EXIT
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONAPP_EXIT_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONEACH_REPAINT
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONEACH_REPAINT_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONFOCUS
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONFOCUS_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONHIDE
          Message event: indicates when this message should be attended (onhide)
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONHIDE_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_DOWN
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_DOWN_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_FIRE
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_FIRE_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_LEFT
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_LEFT_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_RIGHT
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_RIGHT_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_UP
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_UP_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW
          Message event: indicates when this message should be attended (onshow)
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_COMING_FROM_FORM
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_COMING_FROM_FORM_INT
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_PROCESS_IMMEDIATELY
          Message event: indicates when this message should be attended
static int K_ZA_UI_ATTR_MESSAGE_EVENT_PROCESS_IMMEDIATELY_INT
          Message event: indicates when this message should be attended
static java.lang.String K_ZA_UI_ATTR_MESSAGE_MOD_DISCARD
          Message modifier: discard this message upon processing
static int K_ZA_UI_ATTR_MESSAGE_MOD_DISCARD_INT
          Message modifier: keep this message (don't delete from inbox) upon processing
static java.lang.String K_ZA_UI_ATTR_MESSAGE_MOD_KEEP
          Message modifier: keep this message (don't delete from inbox) upon processing
static int K_ZA_UI_ATTR_MESSAGE_MOD_KEEP_INT
          Message modifier: discard this message upon processing
static java.lang.String K_ZA_UI_ATTR_MESSAGE_TYPE_ACTION
          Message type: requires the destination object to perform an action
static int K_ZA_UI_ATTR_MESSAGE_TYPE_ACTION_INT
          Message type: requires the destination object to perform an action
static java.lang.String K_ZA_UI_ATTR_MESSAGE_TYPE_INFO
          Message type: informational
static int K_ZA_UI_ATTR_MESSAGE_TYPE_INFO_INT
          Message type: informational
static int K_ZA_UI_ATTR_MESSAGEINBOX_ARRAY_QTY
          Quantity of attributes that each message object has (don't modify)
static int K_ZA_UI_ATTR_MESSAGEINBOX_DESTINATION_TYPE_IDX
          Index of attribute for message object
static int K_ZA_UI_ATTR_MESSAGEINBOX_DESTINATION_UID_IDX
          Index of attribute for message object
static int K_ZA_UI_ATTR_MESSAGEINBOX_EVENT_IDX
          Index of attribute for message object
static int K_ZA_UI_ATTR_MESSAGEINBOX_ITEM_TYPE_IDX
          Index of attribute for message object
static int K_ZA_UI_ATTR_MESSAGEINBOX_ITEM_UID_IDX
          Index of attribute for message object
static int K_ZA_UI_ATTR_MESSAGEINBOX_MESSAGE_IDX
          Index of attribute for message object
static int K_ZA_UI_ATTR_MESSAGEINBOX_MSG_MODIFIERS_IDX
          Index of attribute for message object
static int K_ZA_UI_ATTR_MESSAGEINBOX_MSG_TYPE_IDX
          Index of attribute for message object
static int K_ZA_UI_ATTR_MESSAGEINBOX_ORIGIN_TYPE_IDX
          Index of attribute for message object
static int K_ZA_UI_ATTR_MESSAGEINBOX_ORIGIN_UID_IDX
          Index of attribute for message object
static int K_ZA_UI_MAX_MESSAGEINBOX_QTY
          This sets the amount of inbox queues.
static java.lang.String K_ZA_UI_MESSAGEINBOX_ARRAY
          Element: MessageInbox array
static int K_ZA_UI_MESSAGEINBOX_ARRAY_INT
          Element: MessageInbox array
static int K_ZA_UI_MESSAGEINBOX_DELETEMARK_INT
          All messages are marked for deletion with this value
 
Constructor Summary
ObjectMessenger(TemporalView a_tmpViewObject)
          creator method
 
Method Summary
 void addElementDefinition()
          call this method always after the creation of a message.
 void addMessageListener(int iAction, ObjectMessenger_callbacks listener)
          for each event/action, the possible destination objects will implement a MessageListener interface.
 void addMessageToInbox(int a_msginbox_dest_uid, int a_msginbox_dest_type, int a_msginbox_orig_uid, int a_msginbox_orig_type, int a_msginbox_event, java.lang.String a_msginbox_message, int a_msginbox_msg_type, int a_msginbox_msg_modifiers)
          Similar to the creation of a message, this is a shortcut that will directly insert a message at the top of the Inbox stack
 void allocate(int a_iMaxMessagesPerMsgInbox)
          allocates memory to hold an amount of messages during the application lifecycle
 void createMessageDefinition(java.lang.String a_msginbox_dest_uid, java.lang.String a_msginbox_dest_type, java.lang.String a_msginbox_orig_uid, java.lang.String a_msginbox_orig_type, java.lang.String a_msginbox_event, java.lang.String a_msginbox_message, java.lang.String a_msginbox_msg_type, java.lang.String a_msginbox_msg_modifiers)
          This allows for creating a message and putting it in the last available position in the Inbox
 void endMessageInboxDefinition()
          always call this method after finishing the creation of a series of messages
 int getMessageAttributeValueByIndex(int a_msginbox_msg_Idx, int a_msginbox_msg_attridx)
          returns the value of a given message attribute given the message index
 int getMessageAttributeValueByMsgUID(int a_msginbox_msg_uid, int a_msginbox_msg_attridx)
          returns the value of a given message attribute given the message UID.
 int getMessageIndexFromInboxByDestinationUID(int a_msg_destination_uid)
          retrieves the first message index found, given the desintation object UID
 int getMessageIndexFromInboxByMsgUID(int a_msginbox_msg_uid)
          gets the message index given its UID
 int getMessageIndexFromInboxWhere(int a_msginbox_dest_uid, int a_msginbox_dest_type, int a_msginbox_orig_uid, int a_msginbox_orig_type, int a_msginbox_event, java.lang.String a_msginbox_message, int a_msginbox_msg_type, int a_msginbox_msg_modifiers, int a_iMsgStartingIndex, boolean a_bLookForSimilarIDs)
          this is sort of a SQL WHERE clause to find messages matching certain criteria of equalness for each of the message attributes.
 void markMessageForDeletion(int a_msginbox_msg_index)
          marks a message for deletion
 void processMessage(int iMsgIndex)
          given an index to an existing message in the Inbox, process it.
 void processMessagesOnEvent(int a_iEvent, int a_iItemUID, int a_iItemType, int a_iComingFromFormID)
          processes all messages that match the specified event
 void rearrangeMessageInbox()
          after manipulation and processing of messages, call this method in order to clean it and leave the inbox in an ordered fashion, so searches are faster next time the processing occurs.
 void removeAllMessagesWithThisType(java.lang.String a_strMsgType)
          removes all messages that match the criteria type = a_strMsgType
 void removeMessageFromInbox(int a_msginbox_msg_uid)
          removes a given message from the inbox, given its UID
 void removeMessageFromInboxByIndex(int a_msginbox_msg_index)
          given a message index, remove it from the Inbox queue.
 void removeMessageListener(int iAction, ObjectMessenger_callbacks listener)
          Removes a message listener from the given action
 void removeMessagesMarkedForDeletionFromInbox()
          all messages that are processed and do have the modifier MOD_DISCARD will be marked for deletion after they are processed.
 void reset()
          removes all messages from the inbox and reinitializes all variables.
 void startMessageInboxDefinition()
          always call this method before creating any series of messages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

K_ZA_UI_MAX_MESSAGEINBOX_QTY

public static final int K_ZA_UI_MAX_MESSAGEINBOX_QTY
This sets the amount of inbox queues. Don't modify this, leave it in 2.

See Also:
Constant Field Values

K_ZA_UI_MESSAGEINBOX_ARRAY

public static final java.lang.String K_ZA_UI_MESSAGEINBOX_ARRAY
Element: MessageInbox array

See Also:
Constant Field Values

K_ZA_UI_MESSAGEINBOX_ARRAY_INT

public static final int K_ZA_UI_MESSAGEINBOX_ARRAY_INT
Element: MessageInbox array

See Also:
Constant Field Values

K_ZA_UI_MESSAGEINBOX_DELETEMARK_INT

public static final int K_ZA_UI_MESSAGEINBOX_DELETEMARK_INT
All messages are marked for deletion with this value

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_ARRAY_QTY

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_ARRAY_QTY
Quantity of attributes that each message object has (don't modify)

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_TYPE_INFO

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_TYPE_INFO
Message type: informational

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_TYPE_ACTION

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_TYPE_ACTION
Message type: requires the destination object to perform an action

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_TYPE_INFO_INT

public static final int K_ZA_UI_ATTR_MESSAGE_TYPE_INFO_INT
Message type: informational

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_TYPE_ACTION_INT

public static final int K_ZA_UI_ATTR_MESSAGE_TYPE_ACTION_INT
Message type: requires the destination object to perform an action

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_MOD_DISCARD

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_MOD_DISCARD
Message modifier: discard this message upon processing

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_MOD_KEEP

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_MOD_KEEP
Message modifier: keep this message (don't delete from inbox) upon processing

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_MOD_DISCARD_INT

public static final int K_ZA_UI_ATTR_MESSAGE_MOD_DISCARD_INT
Message modifier: keep this message (don't delete from inbox) upon processing

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_MOD_KEEP_INT

public static final int K_ZA_UI_ATTR_MESSAGE_MOD_KEEP_INT
Message modifier: discard this message upon processing

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW
Message event: indicates when this message should be attended (onshow)

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONHIDE

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONHIDE
Message event: indicates when this message should be attended (onhide)

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONFOCUS

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONFOCUS
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_OFFFOCUS

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_OFFFOCUS
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_UP

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_UP
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_DOWN

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_DOWN
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_LEFT

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_LEFT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_RIGHT

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_RIGHT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_FIRE

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_FIRE
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONEACH_REPAINT

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONEACH_REPAINT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONAPP_EXIT

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONAPP_EXIT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_COMING_FROM_FORM

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_COMING_FROM_FORM
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ON_ASKING_FOR_DELETION

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ON_ASKING_FOR_DELETION
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_PROCESS_IMMEDIATELY

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_PROCESS_IMMEDIATELY
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ON_RESET_APP

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ON_RESET_APP
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ON_APP_START

public static final java.lang.String K_ZA_UI_ATTR_MESSAGE_EVENT_ON_APP_START
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONHIDE_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONHIDE_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONFOCUS_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONFOCUS_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_OFFFOCUS_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_OFFFOCUS_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_UP_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_UP_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_DOWN_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_DOWN_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_LEFT_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_LEFT_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_RIGHT_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_RIGHT_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_FIRE_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONKEY_FIRE_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONEACH_REPAINT_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONEACH_REPAINT_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONAPP_EXIT_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONAPP_EXIT_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_COMING_FROM_FORM_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ONSHOW_COMING_FROM_FORM_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ON_ASKING_FOR_DELETION_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ON_ASKING_FOR_DELETION_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_PROCESS_IMMEDIATELY_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_PROCESS_IMMEDIATELY_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ON_RESET_APP_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ON_RESET_APP_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGE_EVENT_ON_APP_START_INT

public static final int K_ZA_UI_ATTR_MESSAGE_EVENT_ON_APP_START_INT
Message event: indicates when this message should be attended

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_ITEM_TYPE_IDX

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_ITEM_TYPE_IDX
Index of attribute for message object

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_ITEM_UID_IDX

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_ITEM_UID_IDX
Index of attribute for message object

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_DESTINATION_UID_IDX

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_DESTINATION_UID_IDX
Index of attribute for message object

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_DESTINATION_TYPE_IDX

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_DESTINATION_TYPE_IDX
Index of attribute for message object

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_ORIGIN_UID_IDX

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_ORIGIN_UID_IDX
Index of attribute for message object

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_ORIGIN_TYPE_IDX

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_ORIGIN_TYPE_IDX
Index of attribute for message object

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_EVENT_IDX

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_EVENT_IDX
Index of attribute for message object

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_MESSAGE_IDX

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_MESSAGE_IDX
Index of attribute for message object

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_MSG_TYPE_IDX

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_MSG_TYPE_IDX
Index of attribute for message object

See Also:
Constant Field Values

K_ZA_UI_ATTR_MESSAGEINBOX_MSG_MODIFIERS_IDX

public static final int K_ZA_UI_ATTR_MESSAGEINBOX_MSG_MODIFIERS_IDX
Index of attribute for message object

See Also:
Constant Field Values
Constructor Detail

ObjectMessenger

public ObjectMessenger(TemporalView a_tmpViewObject)
creator method

Parameters:
a_tmpViewObject - holds which temporal_view object to use in order for the ObjectMessenger factory to build each message as needed
Method Detail

allocate

public void allocate(int a_iMaxMessagesPerMsgInbox)
allocates memory to hold an amount of messages during the application lifecycle

Parameters:
a_iMaxMessagesPerMsgInbox - the maximum amount of messages our inbox will hold

reset

public void reset()
removes all messages from the inbox and reinitializes all variables. Pretty much like having a brand new ObjectMessenger, but without the memory fragmentation you could get on some handsets if you let the garbage collector do it for itself.


addMessageListener

public void addMessageListener(int iAction,
                               ObjectMessenger_callbacks listener)
for each event/action, the possible destination objects will implement a MessageListener interface. An object will use this method in order to add itself to the listener list for a specific action

Parameters:
iAction - Action on which the specific object wants to hear about
listener - object that implements the MessageListener interface (such interfaces methods will be called by the ObjectMessenger class when required)

removeMessageListener

public void removeMessageListener(int iAction,
                                  ObjectMessenger_callbacks listener)
Removes a message listener from the given action

Parameters:
iAction - code on which the message is sent
listener - listener instance to remove

createMessageDefinition

public void createMessageDefinition(java.lang.String a_msginbox_dest_uid,
                                    java.lang.String a_msginbox_dest_type,
                                    java.lang.String a_msginbox_orig_uid,
                                    java.lang.String a_msginbox_orig_type,
                                    java.lang.String a_msginbox_event,
                                    java.lang.String a_msginbox_message,
                                    java.lang.String a_msginbox_msg_type,
                                    java.lang.String a_msginbox_msg_modifiers)
This allows for creating a message and putting it in the last available position in the Inbox

Parameters:
a_msginbox_dest_uid - The destination object UID
a_msginbox_dest_type - The destination object type
a_msginbox_orig_uid - The originating object UID
a_msginbox_orig_type - The originating object type
a_msginbox_event - the event on which this message should be read by the destination object
a_msginbox_message - the message (payload) itself. Something that has meaning for the destination object.
a_msginbox_msg_type - Message type. Informational / Action
a_msginbox_msg_modifiers -

addElementDefinition

public void addElementDefinition()
call this method always after the creation of a message. Otherwise it won't be set into the INbox!


addMessageToInbox

public void addMessageToInbox(int a_msginbox_dest_uid,
                              int a_msginbox_dest_type,
                              int a_msginbox_orig_uid,
                              int a_msginbox_orig_type,
                              int a_msginbox_event,
                              java.lang.String a_msginbox_message,
                              int a_msginbox_msg_type,
                              int a_msginbox_msg_modifiers)
Similar to the creation of a message, this is a shortcut that will directly insert a message at the top of the Inbox stack

Parameters:
a_msginbox_dest_uid -
a_msginbox_dest_type -
a_msginbox_orig_uid -
a_msginbox_orig_type -
a_msginbox_event -
a_msginbox_message -
a_msginbox_msg_type -
a_msginbox_msg_modifiers -
See Also:
createMessageDefinition

removeMessageFromInbox

public void removeMessageFromInbox(int a_msginbox_msg_uid)
removes a given message from the inbox, given its UID

Parameters:
a_msginbox_msg_uid - the message's UID to be deleted from the inbox

removeMessagesMarkedForDeletionFromInbox

public void removeMessagesMarkedForDeletionFromInbox()
all messages that are processed and do have the modifier MOD_DISCARD will be marked for deletion after they are processed. This method will clean the inbox from those messages already marked for deletion (which by the way are useless)


removeAllMessagesWithThisType

public void removeAllMessagesWithThisType(java.lang.String a_strMsgType)
removes all messages that match the criteria type = a_strMsgType

Parameters:
a_strMsgType - The type of message you want deleted

markMessageForDeletion

public void markMessageForDeletion(int a_msginbox_msg_index)
marks a message for deletion

Parameters:
a_msginbox_msg_index - the index of the message in the message inbox that needs be deleted

removeMessageFromInboxByIndex

public void removeMessageFromInboxByIndex(int a_msginbox_msg_index)
given a message index, remove it from the Inbox queue. Note that this will NOT mark the message for deletion later, but rather will wipe it out and leave an empty slot in place. You should call rearrangeMsgInbox method someitme after using this

Parameters:
a_msginbox_msg_index - index of the message to be removed

getMessageAttributeValueByIndex

public int getMessageAttributeValueByIndex(int a_msginbox_msg_Idx,
                                           int a_msginbox_msg_attridx)
returns the value of a given message attribute given the message index

Parameters:
a_msginbox_msg_Idx - the starting message index in the inbox
a_msginbox_msg_attridx - the message attribute index
Returns:
the value of the given attribute for the given message
See Also:
getMessageAttributeValueByMsgUID

getMessageAttributeValueByMsgUID

public int getMessageAttributeValueByMsgUID(int a_msginbox_msg_uid,
                                            int a_msginbox_msg_attridx)
returns the value of a given message attribute given the message UID. Note that calling getMessageAttributeValueByIndex is quite faster. If you have the message index, prefer getMessageAttributeValueByIndex over this method.

Parameters:
a_msginbox_msg_uid - the message UID in the inbox
a_msginbox_msg_attridx - the message attribute index
Returns:
the value of the given attribute for the given message
See Also:
getMessageAttributeValueByIndex

getMessageIndexFromInboxByMsgUID

public int getMessageIndexFromInboxByMsgUID(int a_msginbox_msg_uid)
gets the message index given its UID

Parameters:
a_msginbox_msg_uid - the message uid
Returns:
the message index in the inbox

getMessageIndexFromInboxByDestinationUID

public int getMessageIndexFromInboxByDestinationUID(int a_msg_destination_uid)
retrieves the first message index found, given the desintation object UID

Parameters:
a_msg_destination_uid - the desintation object UID
Returns:
the message index found

getMessageIndexFromInboxWhere

public int getMessageIndexFromInboxWhere(int a_msginbox_dest_uid,
                                         int a_msginbox_dest_type,
                                         int a_msginbox_orig_uid,
                                         int a_msginbox_orig_type,
                                         int a_msginbox_event,
                                         java.lang.String a_msginbox_message,
                                         int a_msginbox_msg_type,
                                         int a_msginbox_msg_modifiers,
                                         int a_iMsgStartingIndex,
                                         boolean a_bLookForSimilarIDs)
this is sort of a SQL WHERE clause to find messages matching certain criteria of equalness for each of the message attributes.

Parameters:
a_msginbox_dest_uid - the destination UID to find. Pass -1 to not include this attribute in the search.
a_msginbox_dest_type - the destination type to find. Pass -1 to not include this attribute in the search.
a_msginbox_orig_uid - the origin UID to find. Pass -1 to not include this attribute in the search.
a_msginbox_orig_type - the origin type to find. Pass -1 to not include this attribute in the search.
a_msginbox_event - the event to find. Pass -1 to not include this attribute in the search.
a_msginbox_message - the message to find. Shall match 100%. Pass -1 to not include this attribute in the search.
a_msginbox_msg_type - the message type to find. Pass -1 to not include this attribute in the search.
a_msginbox_msg_modifiers -
a_iMsgStartingIndex -
Returns:
the first message index found that matches the given criteria

rearrangeMessageInbox

public void rearrangeMessageInbox()
after manipulation and processing of messages, call this method in order to clean it and leave the inbox in an ordered fashion, so searches are faster next time the processing occurs.


processMessage

public void processMessage(int iMsgIndex)
given an index to an existing message in the Inbox, process it.

Parameters:
iMsgIndex - index of the message to be processed

processMessagesOnEvent

public void processMessagesOnEvent(int a_iEvent,
                                   int a_iItemUID,
                                   int a_iItemType,
                                   int a_iComingFromFormID)
processes all messages that match the specified event

Parameters:
a_iEvent - the event that should be in the messages to be processed
a_iItemUID - the object ID that triggered this process
a_iItemType - the object type of the object that triggered this process
a_iComingFromFormID - if applicable, the ID of the form that triggered this process

startMessageInboxDefinition

public void startMessageInboxDefinition()
always call this method before creating any series of messages


endMessageInboxDefinition

public void endMessageInboxDefinition()
always call this method after finishing the creation of a series of messages