Package com.helger.phase4.servlet.spi
Class AS4MessageProcessorResult
java.lang.Object
com.helger.phase4.servlet.spi.AS4MessageProcessorResult
- All Implemented Interfaces:
com.helger.commons.state.ISuccessIndicator
- Direct Known Subclasses:
AS4SignalMessageProcessorResult
@Immutable
public class AS4MessageProcessorResult
extends Object
implements com.helger.commons.state.ISuccessIndicator
This class represents the result of a message processor SPI
implementation.
Note: cannot be serializable because WSS4JAttachment is not serializable
Note: cannot be serializable because WSS4JAttachment is not serializable
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAS4MessageProcessorResult(com.helger.commons.state.ESuccess eSuccess, String sErrorMsg, com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aAttachments, String sAsyncResponseURL) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllAttachmentsTo(Collection<? super WSS4JAttachment> aTarget) Add all attachments contained in this object onto the provided target collection.static AS4MessageProcessorResultCreate a negative response.static AS4MessageProcessorResultcreateFailure(String sErrorMsg) Deprecated, for removal: This API element is subject to removal in a future version.static AS4MessageProcessorResultstatic AS4MessageProcessorResultcreateSuccessExt(com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aAttachments, String sAsyncResponseURL) Create a success message with optional attachments.com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment>Deprecated, for removal: This API element is subject to removal in a future version.booleanbooleanbooleanDeprecated, for removal: This API element is subject to removal in a future version.booleantoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.state.ISuccessIndicator
and, isFailure, or
-
Constructor Details
-
AS4MessageProcessorResult
protected AS4MessageProcessorResult(@Nonnull com.helger.commons.state.ESuccess eSuccess, @Nullable String sErrorMsg, @Nullable com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aAttachments, @Nullable String sAsyncResponseURL) - Parameters:
eSuccess- Success or failure. May not benull.sErrorMsg- The error message to use. May benull.aAttachments- The response attachments. May benull.sAsyncResponseURL- The asynchronous response URLs. May benull.
-
-
Method Details
-
isSuccess
public boolean isSuccess()- Specified by:
isSuccessin interfacecom.helger.commons.state.ISuccessIndicator
-
getErrorMessage
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- The error message. May be
null, even in case of failure.
-
hasErrorMessage
Deprecated, for removal: This API element is subject to removal in a future version. -
getAllAttachments
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> getAllAttachments() -
hasAttachments
public boolean hasAttachments() -
addAllAttachmentsTo
Add all attachments contained in this object onto the provided target collection.- Parameters:
aTarget- The target collection. May not benull.
-
getAsyncResponseURL
- Returns:
- The asynchronous response URL. May be
null.
-
hasAsyncResponseURL
public boolean hasAsyncResponseURL()- Returns:
trueif an asynchronous response URL is present,falseotherwise.
-
toString
-
createSuccess
- Returns:
- A new success object. No attachments, no nothing.
-
createSuccessExt
@Nonnull public static AS4MessageProcessorResult createSuccessExt(@Nullable com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aAttachments, @Nullable String sAsyncResponseURL) Create a success message with optional attachments. Usually you don't need this. Just callcreateSuccess()and you are fine.- Parameters:
aAttachments- Optional list of RESPONSE (!) attachments. Don't put the incoming attachments here.sAsyncResponseURL- The optional asynchronous response URL.- Returns:
- Never
null. - Since:
- 0.9.7
- See Also:
-
createFailure
@Nonnull @Deprecated(forRemoval=true, since="2.3.0") public static AS4MessageProcessorResult createFailure(@Nullable String sErrorMsg) Deprecated, for removal: This API element is subject to removal in a future version.Create a negative response with the provided error message. This method is deprecated, because the error message is never used.- Parameters:
sErrorMsg- The error message to send back. May benullor empty since v1.3.1.- Returns:
- Never
null.
-
createFailure
Create a negative response.- Returns:
- Never
null. - Since:
- 2.3.0
-