Skip to content

Commit

Permalink
Fixes the INVOKE and PROGRESS interation patterns tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CesarCoelho committed Oct 12, 2023
1 parent 56bd488 commit ba9bf51
Show file tree
Hide file tree
Showing 10 changed files with 173 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@ public interface MALInteractionListener {
/**
* Receives a SUBMIT ACK message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
*/
void submitAckReceived(MALMessageHeader header, Map qosProperties)
void submitAckReceived(MALMessageHeader header, Map qosProperties)
throws MALException;

/**
* Receives a SUBMIT ERROR message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -57,7 +59,8 @@ void submitErrorReceived(MALMessageHeader header, MALErrorBody body,
/**
* Receives a REQUEST RESPONSE message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -68,7 +71,8 @@ void requestResponseReceived(MALMessageHeader header, MALMessageBody body,
/**
* Receives a REQUEST ERROR message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -79,7 +83,8 @@ void requestErrorReceived(MALMessageHeader header, MALErrorBody body,
/**
* Receives a INVOKE ACK message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -90,7 +95,8 @@ void invokeAckReceived(MALMessageHeader header, MALMessageBody body,
/**
* Receives a INVOKE ACK ERROR message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -101,7 +107,8 @@ void invokeAckErrorReceived(MALMessageHeader header, MALErrorBody body,
/**
* Receives a INVOKE RESPONSE message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -112,7 +119,8 @@ void invokeResponseReceived(MALMessageHeader header, MALMessageBody body,
/**
* Receives a INVOKE RESPONSE ERROR message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -123,7 +131,8 @@ void invokeResponseErrorReceived(MALMessageHeader header, MALErrorBody body,
/**
* Receives a PROGRESS ACK message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -134,7 +143,8 @@ void progressAckReceived(MALMessageHeader header, MALMessageBody body,
/**
* Receives a PROGRESS ACK ERROR message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -145,7 +155,8 @@ void progressAckErrorReceived(MALMessageHeader header, MALErrorBody body,
/**
* Receives a PROGRESS UPDATE message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -156,7 +167,8 @@ void progressUpdateReceived(MALMessageHeader header, MALMessageBody body,
/**
* Receives a PROGRESS UPDATE ERROR message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -167,7 +179,8 @@ void progressUpdateErrorReceived(MALMessageHeader header, MALErrorBody body,
/**
* Receives a PROGRESS RESPONSE message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -178,7 +191,8 @@ void progressResponseReceived(MALMessageHeader header, MALMessageBody body,
/**
* Receives a PROGRESS RESPONSE ERROR message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -189,7 +203,8 @@ void progressResponseErrorReceived(MALMessageHeader header,
/**
* Receives a REGISTER ACK message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
*/
Expand All @@ -199,7 +214,8 @@ void registerAckReceived(MALMessageHeader header, Map qosProperties)
/**
* Receives a REGISTER ERROR message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -210,7 +226,8 @@ void registerErrorReceived(MALMessageHeader header, MALErrorBody body,
/**
* Receives a NOTIFY message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -221,7 +238,8 @@ void notifyReceived(MALMessageHeader header, MALNotifyBody body,
/**
* Receives a NOTIFY ERROR message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param body The body of the message.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
Expand All @@ -232,7 +250,8 @@ void notifyErrorReceived(MALMessageHeader header, MALErrorBody body,
/**
* Receives a DEREGISTER ACK message.
*
* @param header The header of the message.
* @param header The header of the message as exchanged between the provider
* and the consumer.
* @param qosProperties The QoS properties of the message, may be null.
* @throws MALException If an error occurs
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,6 @@ public Boolean getIsErrorMessage() {
return isErrorMessage;
}

/**
* Sets the field isError.
*
* @param isErrorMessage The new value to set.
*/
public void setIsErrorMessage(final Boolean isErrorMessage) {
this.isErrorMessage = isErrorMessage;
}

/**
* Returns the field supplements.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public class MALConsumerImpl implements MALConsumer, MALCloseable {
private MALTransmitErrorListener transmissionListener;

MALConsumerImpl(final MALContextImpl impl,
final MALConsumerManagerImpl parent,
final String localName,
final URI uriTo,
final URI brokerUri,
Expand Down Expand Up @@ -87,7 +86,6 @@ public class MALConsumerImpl implements MALConsumer, MALCloseable {
}

MALConsumerImpl(final MALContextImpl impl,
final MALConsumerManagerImpl parent,
final MALEndpoint endPoint,
final URI uriTo,
final URI brokerUri,
Expand Down Expand Up @@ -135,13 +133,15 @@ public Blob setAuthenticationId(Blob newAuthenticationId) {
@Override
public MALMessage send(final MALSendOperation op, final Object... requestBody)
throws java.lang.IllegalArgumentException, MALInteractionException, MALException {
return sender.onewayInteraction(messageTarget, null, op, MALSendOperation.SEND_STAGE, requestBody);
return sender.onewayInteraction(messageTarget, null, op,
MALSendOperation.SEND_STAGE, requestBody);
}

@Override
public MALMessage send(final MALSendOperation op, final MALEncodedBody body)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.onewayInteraction(messageTarget, null, op, MALSendOperation.SEND_STAGE, body);
return sender.onewayInteraction(messageTarget, null, op,
MALSendOperation.SEND_STAGE, body);
}

@Override
Expand Down Expand Up @@ -189,31 +189,35 @@ public MALMessageBody invoke(final MALInvokeOperation op,
final MALInteractionListener listener,
final Object... requestBody)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.synchronousInteraction(messageTarget, op, MALInvokeOperation.INVOKE_STAGE, listener, requestBody);
return sender.synchronousInteraction(messageTarget, op,
MALInvokeOperation.INVOKE_STAGE, listener, requestBody);
}

@Override
public MALMessageBody invoke(final MALInvokeOperation op,
final MALInteractionListener listener,
final MALEncodedBody body)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.synchronousInteraction(messageTarget, op, MALInvokeOperation.INVOKE_STAGE, listener, body);
return sender.synchronousInteraction(messageTarget, op,
MALInvokeOperation.INVOKE_STAGE, listener, body);
}

@Override
public MALMessageBody progress(final MALProgressOperation op,
final MALInteractionListener listener,
final Object... requestBody)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.synchronousInteraction(messageTarget, op, MALProgressOperation.PROGRESS_STAGE, listener, requestBody);
return sender.synchronousInteraction(messageTarget, op,
MALProgressOperation.PROGRESS_STAGE, listener, requestBody);
}

@Override
public MALMessageBody progress(final MALProgressOperation op,
final MALInteractionListener listener,
final MALEncodedBody body)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.synchronousInteraction(messageTarget, op, MALProgressOperation.PROGRESS_STAGE, listener, body);
return sender.synchronousInteraction(messageTarget, op,
MALProgressOperation.PROGRESS_STAGE, listener, body);
}

@Override
Expand All @@ -236,63 +240,71 @@ public MALMessage asyncSubmit(final MALSubmitOperation op,
final MALInteractionListener listener,
final Object... requestBody)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.asynchronousInteraction(messageTarget, op, MALSubmitOperation.SUBMIT_STAGE, listener, requestBody);
return sender.asynchronousInteraction(messageTarget, op,
MALSubmitOperation.SUBMIT_STAGE, listener, requestBody);
}

@Override
public MALMessage asyncSubmit(final MALSubmitOperation op,
final MALInteractionListener listener,
final MALEncodedBody body)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.asynchronousInteraction(messageTarget, op, MALSubmitOperation.SUBMIT_STAGE, listener, body);
return sender.asynchronousInteraction(messageTarget, op,
MALSubmitOperation.SUBMIT_STAGE, listener, body);
}

@Override
public MALMessage asyncRequest(final MALRequestOperation op,
final MALInteractionListener listener,
final Object... requestBody)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.asynchronousInteraction(messageTarget, op, MALRequestOperation.REQUEST_STAGE, listener, requestBody);
return sender.asynchronousInteraction(messageTarget, op,
MALRequestOperation.REQUEST_STAGE, listener, requestBody);
}

@Override
public MALMessage asyncRequest(final MALRequestOperation op,
final MALInteractionListener listener,
final MALEncodedBody body)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.asynchronousInteraction(messageTarget, op, MALRequestOperation.REQUEST_STAGE, listener, body);
return sender.asynchronousInteraction(messageTarget, op,
MALRequestOperation.REQUEST_STAGE, listener, body);
}

@Override
public MALMessage asyncInvoke(final MALInvokeOperation op,
final MALInteractionListener listener,
final Object... requestBody)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.asynchronousInteraction(messageTarget, op, MALInvokeOperation.INVOKE_STAGE, listener, requestBody);
return sender.asynchronousInteraction(messageTarget, op,
MALInvokeOperation.INVOKE_STAGE, listener, requestBody);
}

@Override
public MALMessage asyncInvoke(final MALInvokeOperation op,
final MALInteractionListener listener,
final MALEncodedBody body)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.asynchronousInteraction(messageTarget, op, MALInvokeOperation.INVOKE_STAGE, listener, body);
return sender.asynchronousInteraction(messageTarget, op,
MALInvokeOperation.INVOKE_STAGE, listener, body);
}

@Override
public MALMessage asyncProgress(final MALProgressOperation op,
final MALInteractionListener listener,
final Object... requestBody)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.asynchronousInteraction(messageTarget, op, MALProgressOperation.PROGRESS_STAGE, listener, requestBody);
return sender.asynchronousInteraction(messageTarget, op,
MALProgressOperation.PROGRESS_STAGE, listener, requestBody);
}

@Override
public MALMessage asyncProgress(final MALProgressOperation op,
final MALInteractionListener listener,
final MALEncodedBody body)
throws IllegalArgumentException, MALInteractionException, MALException {
return sender.asynchronousInteraction(messageTarget, op, MALProgressOperation.PROGRESS_STAGE, listener, body);
return sender.asynchronousInteraction(messageTarget, op,
MALProgressOperation.PROGRESS_STAGE, listener, body);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public MALConsumer createConsumer(final String localName,
final UInteger priority,
final NamedValueList supplements) throws MALException {
return new MALConsumerImpl(impl,
this,
localName,
uriTo,
brokerUri,
Expand Down Expand Up @@ -93,7 +92,6 @@ public MALConsumer createConsumer(final MALEndpoint endPoint,
final NamedValueList supplements)
throws IllegalArgumentException, MALException {
return new MALConsumerImpl(impl,
this,
endPoint,
uriTo,
brokerUri,
Expand Down
Loading

0 comments on commit ba9bf51

Please sign in to comment.