-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed class to EAS4UserMessageSendResult
- Loading branch information
Showing
70 changed files
with
233 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
phase4-lib/src/main/java/com/helger/phase4/sender/EAS4UserMessageSendResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package com.helger.phase4.sender; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
|
||
import com.helger.commons.annotation.Nonempty; | ||
import com.helger.commons.id.IHasID; | ||
import com.helger.commons.lang.EnumHelper; | ||
import com.helger.commons.state.ISuccessIndicator; | ||
|
||
/** | ||
* Specific enumeration with the result error codes of the | ||
* {@link AbstractAS4UserMessageBuilder#sendMessageAndCheckForReceipt()} | ||
* method.<br /> | ||
* Old name before v3: <code>ESimpleUserMessageSendResult</code> | ||
* | ||
* @author Philip Helger | ||
*/ | ||
public enum EAS4UserMessageSendResult implements IHasID <String>, ISuccessIndicator | ||
{ | ||
/** | ||
* Programming error, because not all mandatory fields are filled. | ||
*/ | ||
INVALID_PARAMETERS ("invalid-parameters"), | ||
/** | ||
* Something failed on the network or HTTP(S) level | ||
*/ | ||
TRANSPORT_ERROR ("transport-error"), | ||
/** | ||
* Some answer was received, but it was no valid AS4 Signal Message | ||
*/ | ||
NO_SIGNAL_MESSAGE_RECEIVED ("no-signal-msg-received"), | ||
/** | ||
* An AS4 Error Message was received | ||
*/ | ||
AS4_ERROR_MESSAGE_RECEIVED ("as4-error-msg-received"), | ||
/** | ||
* An AS4 Signal Message was received, but it was neither a Receipt nor an | ||
* Error Message but something else. | ||
*/ | ||
INVALID_SIGNAL_MESSAGE_RECEIVED ("invalid-signal-message-received"), | ||
/** | ||
* Everything worked according to plan. The message was successfully | ||
* delivered. | ||
*/ | ||
SUCCESS ("success"); | ||
|
||
private final String m_sID; | ||
|
||
EAS4UserMessageSendResult (@Nonnull @Nonempty final String sID) | ||
{ | ||
m_sID = sID; | ||
} | ||
|
||
/** | ||
* @return The ID of the of the error message. | ||
* @since 1.0.0-rc1 | ||
*/ | ||
@Nonnull | ||
@Nonempty | ||
public String getID () | ||
{ | ||
return m_sID; | ||
} | ||
|
||
public boolean isSuccess () | ||
{ | ||
return this == SUCCESS; | ||
} | ||
|
||
/** | ||
* @return A recommendation whether a retry might be feasible in case the | ||
* internal retries were disabled. | ||
* @since 1.0.0-rc1 | ||
*/ | ||
public boolean isRetryFeasible () | ||
{ | ||
return this == TRANSPORT_ERROR || this == NO_SIGNAL_MESSAGE_RECEIVED || this == INVALID_SIGNAL_MESSAGE_RECEIVED; | ||
} | ||
|
||
@Nullable | ||
public static EAS4UserMessageSendResult getFromIDOrNull (@Nullable final String sID) | ||
{ | ||
return EnumHelper.getFromIDOrNull (EAS4UserMessageSendResult.class, sID); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.