message
Interface MessageCentre

All Known Implementing Classes:
MessageCentreImpl

public interface MessageCentre

Storage and retrieval of portlet message mappings, and the messages.

See Also:
MessageCentreImpl

Method Summary
 void addInputMapping(MessageBoxKey key, MessageBoxKey source)
           
 void addInputMapping(java.lang.String portletID, java.lang.String name, MessageBoxKey source)
          Set a portlet message key => message box mapping.
 void addOutputMapping(MessageBoxKey key, MessageBoxKey target)
           
 void addOutputMapping(java.lang.String portletID, java.lang.String name, MessageBoxKey target)
          Add a portlet message key => message box mapping.
 void clearAllOutputMappings(MessageBoxKey key)
          Remove any existing output mappings for this key.
 void clearInputMapping(MessageBoxKey key)
          Remove a message key => message box mapping.
 void deleteInput(MessageBoxKey key)
          Remove all trace of the specified input message box.
 void deleteOutput(MessageBoxKey key)
          Remove all trace of the specified output message box.
 MessageBoxKey findInputSource(MessageBoxKey key)
           
 MessageBoxKey findInputSource(java.lang.String portletID, java.lang.String name)
          Get the key of the source message box for this portletID+name combination.
 java.util.Set findOutputTargets(MessageBoxKey key)
           
 java.util.Set findOutputTargets(java.lang.String portletID, java.lang.String name)
          This will always return a Set which contains at least a key for a message box corresponding to the provided portletID+name (it always outputs to itself as well as any other registered mappings)
 java.lang.Object get(MessageBoxKey boxKey)
          Get message from this message box.
 java.lang.Object get(java.lang.String portletID, java.lang.String name)
          Get message for this portletID+name combination.
 java.util.Set getAllInputKeys()
           
 java.util.Set getAllOutputKeys()
           
 java.util.Map getBoxes()
           
 java.util.Set getInputKeys(java.lang.String portletID)
           
 java.util.Set getOutputKeys(java.lang.String portletID)
           
 java.util.Set getPublicBoxKeys()
           
 boolean isValid()
           
 void send(java.util.Set targetKeys, java.lang.Object message)
          Send message to these message boxes.
 void send(java.lang.String portletID, java.lang.String name, java.lang.Object message)
          Send message to this portletID+name combination.
 void setStore(MessageStore store)
           
 

Method Detail

setStore

public void setStore(MessageStore store)

addInputMapping

public void addInputMapping(java.lang.String portletID,
                            java.lang.String name,
                            MessageBoxKey source)
Set a portlet message key => message box mapping. This will overwrite any existing input mapping.

Parameters:
portletID - ID of the portlet which is receiving the input
name - (local) name of the portlet input, referred to in the portlet's code
source - the message box from which the portlet's input will read.

addInputMapping

public void addInputMapping(MessageBoxKey key,
                            MessageBoxKey source)

clearInputMapping

public void clearInputMapping(MessageBoxKey key)
Remove a message key => message box mapping. As there can only be 1 mapping for each input, this will result in the default mapping: looking for a local portlet message of the same name.


deleteInput

public void deleteInput(MessageBoxKey key)
Remove all trace of the specified input message box. There will no longer be even a default mapping.


addOutputMapping

public void addOutputMapping(java.lang.String portletID,
                             java.lang.String name,
                             MessageBoxKey target)
Add a portlet message key => message box mapping. This will be in addition to any existing output mappings; the message will be copied to all mapped output targets.

Parameters:
portletID - ID of the portlet which is sending the output
name - (local) name of the portlet output, referred to in the portlet's code
target - the message box to which the portlet's output will copy its message.

addOutputMapping

public void addOutputMapping(MessageBoxKey key,
                             MessageBoxKey target)

clearAllOutputMappings

public void clearAllOutputMappings(MessageBoxKey key)
Remove any existing output mappings for this key. The result will be that the output still exists, but does not publish to anywhere.


deleteOutput

public void deleteOutput(MessageBoxKey key)
Remove all trace of the specified output message box. There will no longer be even a default mapping, so it will no longer be possible to publish messages to it.


findOutputTargets

public java.util.Set findOutputTargets(java.lang.String portletID,
                                       java.lang.String name)
This will always return a Set which contains at least a key for a message box corresponding to the provided portletID+name (it always outputs to itself as well as any other registered mappings)

Returns:
Set of MessageBoxKey's: the output keys registered for this portletID+name

findOutputTargets

public java.util.Set findOutputTargets(MessageBoxKey key)

findInputSource

public MessageBoxKey findInputSource(java.lang.String portletID,
                                     java.lang.String name)
Get the key of the source message box for this portletID+name combination. If no mapping is found, returns a MessageBoxKey for this portletID+name.


findInputSource

public MessageBoxKey findInputSource(MessageBoxKey key)

get

public java.lang.Object get(java.lang.String portletID,
                            java.lang.String name)
Get message for this portletID+name combination. If there is no mapping to a message box defined for the specified portletID+name, it tries to find a local message box of the same name. If there is no message, returns null.


get

public java.lang.Object get(MessageBoxKey boxKey)
Get message from this message box. If there is no message, returns null.


send

public void send(java.lang.String portletID,
                 java.lang.String name,
                 java.lang.Object message)
Send message to this portletID+name combination. It will be delivered to a local message box with this name. It will also be delivered to all message boxes for which mappings have been registered for this portletID+name using addMapping. It will replace any message already in the boxes.


send

public void send(java.util.Set targetKeys,
                 java.lang.Object message)
Send message to these message boxes. It will replace any message already in the boxes, or remove the box if 'message' is null.

Parameters:
targetKeys - Set of MessageBoxKeys to which the message should be sent

getInputKeys

public java.util.Set getInputKeys(java.lang.String portletID)

getOutputKeys

public java.util.Set getOutputKeys(java.lang.String portletID)

getPublicBoxKeys

public java.util.Set getPublicBoxKeys()

getBoxes

public java.util.Map getBoxes()

getAllInputKeys

public java.util.Set getAllInputKeys()

getAllOutputKeys

public java.util.Set getAllOutputKeys()

isValid

public boolean isValid()