private static MALMessage createMessage(final MessageDetails details, final MALOperation op, final Long transactionId, final UOctet interactionStage, final Object... body) throws MALException { URI to = details.brokerUri; if (op.getInteractionType() != InteractionType.PUBSUB) { to = details.uriTo; } return details.endpoint.createMessage(details.authenticationId, to, new Time(new Date().getTime()), details.qosLevel, details.priority, details.domain, details.networkZone, details.sessionType, details.sessionName, transactionId, Boolean.FALSE, op, interactionStage, details.qosProps, body); }
private static MALMessage createMessage(final MessageDetails details, final MALOperation op, final Long transactionId, final UOctet interactionStage, final MALEncodedBody body) throws MALException { URI to = details.brokerUri; if (op.getInteractionType() != InteractionType.PUBSUB) { to = details.uriTo; } return details.endpoint.createMessage(details.authenticationId, to, new Time(new Date().getTime()), details.qosLevel, details.priority, details.domain, details.networkZone, details.sessionType, details.sessionName, transactionId, Boolean.FALSE, op, interactionStage, details.qosProps, body); } }
icmap.continueTransaction(op.getInteractionType().getOrdinal(), lastInteractionStage, transactionId, listener);
/** * Performs a two way interaction, sends the message. * * @param details Message details structure. * @param op The operation. * @param initialStage The initial interaction stage. * @param listener Interaction listener to use for the reception of other stages. * @param msgBody The already encoded message body. * @return The sent MAL message. * @throws MALInteractionException if there is a problem during the interaction. * @throws MALException on Error. */ public MALMessage asynchronousInteraction(final MessageDetails details, final MALOperation op, final UOctet initialStage, final MALInteractionListener listener, final MALEncodedBody msgBody) throws MALInteractionException, MALException { final Long transId = icmap.createTransaction(op.getInteractionType().getOrdinal(), false, listener); return initiateAsynchronousInteraction(details, createMessage(details, op, transId, initialStage, msgBody)); }
/** * Performs a oneway interaction, sends the message and then returns. * * @param details Message details structure. * @param transId The transaction identifier to use. * @param op The operation. * @param stage The interaction stage to use. * @param msgBody The already encoded message body. * @return The sent MAL message. * @throws MALInteractionException if there is a problem during the interaction. * @throws MALException on Error. */ public MALMessage onewayInteraction(final MessageDetails details, Long transId, final MALOperation op, final UOctet stage, final MALEncodedBody msgBody) throws MALInteractionException, MALException { if (null == transId) { transId = icmap.createTransaction(op.getInteractionType().getOrdinal(), true, null); } return initiateOnewayInteraction(details, createMessage(details, op, transId, stage, msgBody)); }
/** * Performs a two way interaction, sends the message. * * @param details Message details structure. * @param op The operation. * @param initialStage The initial interaction stage. * @param listener Interaction listener to use for the reception of other stages. * @param msgBody The message body. * @return The sent MAL message. * @throws MALInteractionException if there is a problem during the interaction. * @throws MALException on Error. */ public MALMessage asynchronousInteraction(final MessageDetails details, final MALOperation op, final UOctet initialStage, final MALInteractionListener listener, final Object... msgBody) throws MALInteractionException, MALException { final Long transId = icmap.createTransaction(op.getInteractionType().getOrdinal(), false, listener); return initiateAsynchronousInteraction(details, createMessage(details, op, transId, initialStage, msgBody)); }
/** * Performs a two way interaction, sends the message and then waits for the specified stage before returning. * * @param details Message details structure. * @param op The operation. * @param syncStage The interaction stage to wait for before returning. * @param listener Interaction listener to use for the reception of other stages. * @param msgBody The message body. * @return The returned message body. * @throws MALInteractionException if there is a problem during the interaction. * @throws MALException on Error. */ public MALMessageBody synchronousInteraction(final MessageDetails details, final MALOperation op, final UOctet syncStage, final MALInteractionListener listener, final Object... msgBody) throws MALInteractionException, MALException { final Long transId = icmap.createTransaction(op.getInteractionType().getOrdinal(), true, listener); return initiateSynchronousInteraction(transId, details, createMessage(details, op, transId, syncStage, msgBody)); }
/** * Performs a oneway interaction, sends the message and then returns. * * @param details Message details structure. * @param transId The transaction identifier to use. * @param op The operation. * @param stage The interaction stage to use. * @param msgBody The message body. * @return The sent MAL message. * @throws MALInteractionException if there is a problem during the interaction. * @throws MALException on Error. */ public MALMessage onewayInteraction(final MessageDetails details, Long transId, final MALOperation op, final UOctet stage, final Object... msgBody) throws MALInteractionException, MALException { if (null == transId) { transId = icmap.createTransaction(op.getInteractionType().getOrdinal(), true, null); } return initiateOnewayInteraction(details, createMessage(details, op, transId, stage, msgBody)); }
/** * Performs a two way interaction, sends the message and then waits for the specified stage before returning. * * @param details Message details structure. * @param op The operation. * @param syncStage The interaction stage to wait for before returning. * @param listener Interaction listener to use for the reception of other stages. * @param msgBody The already encoded message body. * @return The returned message body. * @throws MALInteractionException if there is a problem during the interaction. * @throws MALException on Error. */ public MALMessageBody synchronousInteraction(final MessageDetails details, final MALOperation op, final UOctet syncStage, final MALInteractionListener listener, final MALEncodedBody msgBody) throws MALInteractionException, MALException { final Long transId = icmap.createTransaction(op.getInteractionType().getOrdinal(), true, listener); return initiateSynchronousInteraction(transId, details, createMessage(details, op, transId, syncStage, msgBody)); }
@Override public MALMessage createMessage(final Blob authenticationId, final URI uriTo, final Time timestamp, final QoSLevel qosLevel, final UInteger priority, final IdentifierList domain, final Identifier networkZone, final SessionType session, final Identifier sessionName, final Long transactionId, final Boolean isErrorMessage, final MALOperation op, final UOctet interactionStage, final Map qosProperties, final Object... body) throws MALException { GENMessageHeader hdr = createMessageHeader(getURI(), authenticationId, uriTo, timestamp, qosLevel, priority, domain, networkZone, session, sessionName, op.getInteractionType(), interactionStage, transactionId, op.getService().getArea().getNumber(), op.getService().getNumber(), op.getNumber(), op.getService().getArea().getVersion(), isErrorMessage, qosProperties); try { return new TCPIPMessage(false, hdr, qosProperties, op, transport.getStreamFactory(), body); } catch (MALInteractionException e) { throw new MALException("Error creating message", e); } }
session, sessionName, op.getInteractionType(), interactionStage, transactionId, session, sessionName, op.getInteractionType(), interactionStage, transactionId,