com.vii.brillien.kernel.axiom.transport
Interface Mediator<C extends Communication,T>


public interface Mediator<C extends Communication,T>

Mediator type to collect all communication sending request invoked by Presences and to delegate to the communication realizing subsystem.


Method Summary
<M extends CommunicationListener<T>>
void
addCommunicationListener(M messageProcessor)
          Registers a CommunicationListener
<M extends MessageProcessor>
void
addMessageProcessorType(Class<M> messageProcessorType)
          Registers a MessageProcessor type
<M extends MessageProcessor>
void
addMessageProcessorType(Class<M> messageProcessorType, Object outerInstance)
          Registers a MessageProcessor inner class type with the outer class instance
 void connect()
          Sets up the connection with the underlaying transport layer
 void disconnect()
          Dismisses the connection with the underlaying transport layer
 Iterable<CommunicationListener<T>> getCommunicationListeners()
          Retrieves the list of registered CommunicationListeners
<M extends MessageProcessor>
Iterable<M>
getNewMessageProcessorInstances(C comm)
          Creates an instances of evety registered MessageProcessor type and initiates them with the give Communication
 String mediatorEntity()
          Retrieves the name of the current mediator's entity
 C prepareNewCommunication()
          Factory method to initiate a communication
 C prepareNewCommunication(C comm, String sender, String senderApiVersion, String flowID, String recipient, String recipientApiVersion, String subject, int type)
          Factory method to initiate a communication
 C prepareNewCommunication(C comm, String sender, String senderApiVersion, String flowID, String recipient, String recipientApiVersion, String subject, int type, Map<String,Object> parameters)
          Factory method to initiate a communication
 C prepareNewCommunication(Session session, C comm, String sender, String senderApiVersion, String flowID, String recipient, String recipientApiVersion, String subject, int type)
          Factory method to initiate a communication
 C prepareNewCommunication(Session session, C comm, String sender, String senderApiVersion, String flowID, String recipient, String recipientApiVersion, String subject, int type, Map<String,Object> parameters)
          Factory method to initiate a communication
 C prepareNewCommunication(Session session, String recipient, String recipientApiVersion, String subject, int type, Map<String,Object> parameters)
          Factory method to initiate a communication
 C prepareNewCommunication(Session session, String sender, String senderApiVersion, String flowID, String recipient, String recipientApiVersion, String subject, int type)
          Factory method to initiate a communication
 C prepareNewCommunication(Session session, String sender, String senderApiVersion, String flowID, String recipient, String recipientApiVersion, String subject, int type, Map<String,Object> parameters)
          Factory method to initiate a communication
 C prepareNewCommunication(String recipient, String recipientApiVersion, String subject, int type, Map<String,Object> parameters)
          Factory method to initiate a communication
 C prepareNewCommunication(String sender, String senderApiVersion, String flowID, String recipient, String recipientApiVersion, String subject, int type)
          Factory method to initiate a communication
 C prepareNewCommunication(String sender, String senderApiVersion, String flowID, String recipient, String recipientApiVersion, String subject, int type, Map<String,Object> parameters)
          Factory method to initiate a communication
 void receiveCommunication(C comm)
          Special entry point allowing to put insider messages into the Mediator
<M extends CommunicationListener<T>>
void
removeCommunicationListener(M messageProcessor)
          Deregisters a CommunicationListener
 void sendAGet(Session session, String to, String apiVersion, String message, String redirectMessage)
          Sends a get-like message to the given recipient.
 void sendAGet(Session session, String to, String apiVersion, String message, String redirectMessage, Map<String,Object> parameters)
          Sends a get-like message to the given recipient.
 C sendCommunication(C comm)
          Sends a message.
 C sendCommunication(HashMap<String,Object> properties, C comm)
          Sends a message.
 C sendCommunication(long timeout, C comm)
          Sends a packet.
 C sendCommunication(long timeout, HashMap<String,Object> properties, C comm)
          Sends a packet.
 void sendDelegatedGet(Session session, String to, String apiVersion, String message, String redirectEntityName, String redirectMessage)
          Sends a get-like message to the given recipient.
 void sendDelegatedGet(Session session, String to, String apiVersion, String message, String redirectEntityName, String redirectMessage, Map<String,Object> parameters)
          Sends a get-like message to the given recipient.
 C sendGet(Session session, long timeout, String to, String apiVersion, String message)
          Sends a get-like message to the given recipient.
 C sendGet(Session session, long timeout, String to, String apiVersion, String message, Map<String,Object> parameters)
          Sends a get-like message to the given recipient.
 C sendGet(Session session, String to, String apiVersion, String message)
          Sends a get-like message to the given recipient.
 C sendGet(Session session, String to, String apiVersion, String message, Map<String,Object> parameters)
          Sends a get-like message to the given recipient.
 void sendSet(Session session, String to, String apiVersion, String message)
          Sends a set-like message to the given recipient.
 void sendSet(Session session, String to, String apiVersion, String message, Map<String,Object> parameters)
          Sends a set-like message to the given recipient.
 void startListening()
          Initiates the internal listening process of the given Mediator to start accept incoming packets
 

Method Detail

connect

void connect()
             throws BrillienException
Sets up the connection with the underlaying transport layer

Throws:
BrillienException

disconnect

void disconnect()
                throws BrillienException
Dismisses the connection with the underlaying transport layer

Throws:
BrillienException

startListening

void startListening()
                    throws BrillienException
Initiates the internal listening process of the given Mediator to start accept incoming packets

Throws:
BrillienException

addMessageProcessorType

<M extends MessageProcessor> void addMessageProcessorType(Class<M> messageProcessorType)
Registers a MessageProcessor type


addMessageProcessorType

<M extends MessageProcessor> void addMessageProcessorType(Class<M> messageProcessorType,
                                                          Object outerInstance)
Registers a MessageProcessor inner class type with the outer class instance


getNewMessageProcessorInstances

<M extends MessageProcessor> Iterable<M> getNewMessageProcessorInstances(C comm)
                                                                     throws BrillienException
Creates an instances of evety registered MessageProcessor type and initiates them with the give Communication

Throws:
BrillienException

addCommunicationListener

<M extends CommunicationListener<T>> void addCommunicationListener(M messageProcessor)
Registers a CommunicationListener


removeCommunicationListener

<M extends CommunicationListener<T>> void removeCommunicationListener(M messageProcessor)
Deregisters a CommunicationListener


getCommunicationListeners

Iterable<CommunicationListener<T>> getCommunicationListeners()
Retrieves the list of registered CommunicationListeners


prepareNewCommunication

C prepareNewCommunication()
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

prepareNewCommunication

C prepareNewCommunication(String recipient,
                          String recipientApiVersion,
                          String subject,
                          int type,
                          Map<String,Object> parameters)
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

prepareNewCommunication

C prepareNewCommunication(Session session,
                          String recipient,
                          String recipientApiVersion,
                          String subject,
                          int type,
                          Map<String,Object> parameters)
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

prepareNewCommunication

C prepareNewCommunication(String sender,
                          String senderApiVersion,
                          String flowID,
                          String recipient,
                          String recipientApiVersion,
                          String subject,
                          int type)
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

prepareNewCommunication

C prepareNewCommunication(C comm,
                          String sender,
                          String senderApiVersion,
                          String flowID,
                          String recipient,
                          String recipientApiVersion,
                          String subject,
                          int type)
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

prepareNewCommunication

C prepareNewCommunication(Session session,
                          String sender,
                          String senderApiVersion,
                          String flowID,
                          String recipient,
                          String recipientApiVersion,
                          String subject,
                          int type)
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

prepareNewCommunication

C prepareNewCommunication(Session session,
                          C comm,
                          String sender,
                          String senderApiVersion,
                          String flowID,
                          String recipient,
                          String recipientApiVersion,
                          String subject,
                          int type)
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

prepareNewCommunication

C prepareNewCommunication(String sender,
                          String senderApiVersion,
                          String flowID,
                          String recipient,
                          String recipientApiVersion,
                          String subject,
                          int type,
                          Map<String,Object> parameters)
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

prepareNewCommunication

C prepareNewCommunication(C comm,
                          String sender,
                          String senderApiVersion,
                          String flowID,
                          String recipient,
                          String recipientApiVersion,
                          String subject,
                          int type,
                          Map<String,Object> parameters)
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

prepareNewCommunication

C prepareNewCommunication(Session session,
                          String sender,
                          String senderApiVersion,
                          String flowID,
                          String recipient,
                          String recipientApiVersion,
                          String subject,
                          int type,
                          Map<String,Object> parameters)
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

prepareNewCommunication

C prepareNewCommunication(Session session,
                          C comm,
                          String sender,
                          String senderApiVersion,
                          String flowID,
                          String recipient,
                          String recipientApiVersion,
                          String subject,
                          int type,
                          Map<String,Object> parameters)
                                                throws BrillienException
Factory method to initiate a communication

Throws:
BrillienException

mediatorEntity

String mediatorEntity()
Retrieves the name of the current mediator's entity


sendCommunication

C sendCommunication(C comm)
                                          throws BrillienException
Sends a message.

Throws:
BrillienException

sendCommunication

C sendCommunication(HashMap<String,Object> properties,
                    C comm)
                                          throws BrillienException
Sends a message.

Throws:
BrillienException

sendCommunication

C sendCommunication(long timeout,
                    C comm)
                                          throws BrillienException
Sends a packet. Waiting for response for the given amount of time

Throws:
BrillienException

sendCommunication

C sendCommunication(long timeout,
                    HashMap<String,Object> properties,
                    C comm)
                                          throws BrillienException
Sends a packet. Waiting for response for the given amount of time

Throws:
BrillienException

receiveCommunication

void receiveCommunication(C comm)
                          throws BrillienException
Special entry point allowing to put insider messages into the Mediator

Throws:
BrillienException

sendGet

C sendGet(Session session,
          String to,
          String apiVersion,
          String message)
                                throws BrillienException
Sends a get-like message to the given recipient. The method will not return until the response is arrived or a timeout event occured. The parameters will be converted to Json format. In case of unsuccessful conversion, an exception will be thrown.

Throws:
BrillienException

sendGet

C sendGet(Session session,
          long timeout,
          String to,
          String apiVersion,
          String message)
                                throws BrillienException
Sends a get-like message to the given recipient. The method will not return until the response is arrived or a timeout event occured. The parameters will be converted to Json format. In case of unsuccessful conversion, an exception will be thrown.

Throws:
BrillienException

sendAGet

void sendAGet(Session session,
              String to,
              String apiVersion,
              String message,
              String redirectMessage)
              throws BrillienException
Sends a get-like message to the given recipient. The method will return immediately after having sent the message. The response will sent to this Aspirer through the given redirectMessage. The parameters will be converted to Json format. In case of unsuccessful conversion, an exception will be thrown.

Throws:
BrillienException

sendDelegatedGet

void sendDelegatedGet(Session session,
                      String to,
                      String apiVersion,
                      String message,
                      String redirectEntityName,
                      String redirectMessage)
                      throws BrillienException
Sends a get-like message to the given recipient. The method will return immediately after having sent the message. The response will sent to this Aspirer through the given redirectMessage. The parameters will be converted to Json format. In case of unsuccessful conversion, an exception will be thrown.

Throws:
BrillienException

sendSet

void sendSet(Session session,
             String to,
             String apiVersion,
             String message)
             throws BrillienException
Sends a set-like message to the given recipient. The method will return immediately after having sent the message, no response is expected. The parameters will be converted to Json format. In case of unsuccessful conversion, an exception will be thrown.

Throws:
BrillienException

sendGet

C sendGet(Session session,
          String to,
          String apiVersion,
          String message,
          Map<String,Object> parameters)
                                throws BrillienException
Sends a get-like message to the given recipient. The method will not return until the response is arrived or a timeout event occured. The parameters will be converted to Json format. In case of unsuccessful conversion, an exception will be thrown.

Throws:
BrillienException

sendGet

C sendGet(Session session,
          long timeout,
          String to,
          String apiVersion,
          String message,
          Map<String,Object> parameters)
                                throws BrillienException
Sends a get-like message to the given recipient. The method will not return until the response is arrived or a timeout event occured. The parameters will be converted to Json format. In case of unsuccessful conversion, an exception will be thrown.

Throws:
BrillienException

sendAGet

void sendAGet(Session session,
              String to,
              String apiVersion,
              String message,
              String redirectMessage,
              Map<String,Object> parameters)
              throws BrillienException
Sends a get-like message to the given recipient. The method will return immediately after having sent the message. The response will sent to this Aspirer through the given redirectMessage. The parameters will be converted to Json format. In case of unsuccessful conversion, an exception will be thrown.

Throws:
BrillienException

sendDelegatedGet

void sendDelegatedGet(Session session,
                      String to,
                      String apiVersion,
                      String message,
                      String redirectEntityName,
                      String redirectMessage,
                      Map<String,Object> parameters)
                      throws BrillienException
Sends a get-like message to the given recipient. The method will return immediately after having sent the message. The response will sent to this Aspirer through the given redirectMessage. The parameters will be converted to Json format. In case of unsuccessful conversion, an exception will be thrown.

Throws:
BrillienException

sendSet

void sendSet(Session session,
             String to,
             String apiVersion,
             String message,
             Map<String,Object> parameters)
             throws BrillienException
Sends a set-like message to the given recipient. The method will return immediately after having sent the message, no response is expected. The parameters will be converted to Json format. In case of unsuccessful conversion, an exception will be thrown.

Throws:
BrillienException


Copyright © 2012. All Rights Reserved.