Package com.helger.phase4.model.message
Class MessageHelperMethods
java.lang.Object
com.helger.phase4.model.message.MessageHelperMethods
This class contains every method, static variables which are used by more than one message
creating classes in this package.
- Author:
- bayerlma, Philip Helger
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull Ebms3CollaborationInfocreateEbms3CollaborationInfo(@Nullable String sAgreementRefPMode, @Nullable String sAgreementRefValue, @Nullable String sAgreementTypeValue, @Nullable String sServiceType, @NonNull @Nonempty String sServiceValue, @NonNull @Nonempty String sAction, @NonNull String sConversationID) static @NonNull Ebms3DescriptioncreateEbms3Description(@NonNull Locale aLocale, @NonNull String sText) static @NonNull Ebms3MessageInfoCreate a new message info with a UUID as message ID.static @NonNull Ebms3MessageInfocreateEbms3MessageInfo(@NonNull @Nonempty String sMessageID, @Nullable String sRefToMessageID) Create a new message info.static @NonNull Ebms3MessageInfocreateEbms3MessageInfo(@NonNull @Nonempty String sMessageID, @Nullable String sRefToMessageID, @NonNull OffsetDateTime aDateTime) Create a new message info.static @NonNull Ebms3MessageInfocreateEbms3MessageInfo(@Nullable String sRefToMessageID) Create a new message info with a UUID as message ID and a reference to the previous message.static @Nullable Ebms3MessagePropertiescreateEbms3MessageProperties(@Nullable Ebms3Property... aEbms3Properties) static @Nullable Ebms3MessagePropertiescreateEbms3MessageProperties(@Nullable List<Ebms3Property> aEbms3Properties) static @Nullable Ebms3PartInfocreateEbms3PartInfo(@Nullable IAS4Attachment aAttachment) static @NonNull Ebms3PartyIdcreateEbms3PartyId(@NonNull @Nonempty String sValue) static @NonNull Ebms3PartyIdcreateEbms3PartyId(@Nullable String sType, @NonNull @Nonempty String sValue) static @NonNull Ebms3PartyInfocreateEbms3PartyInfo(@NonNull @Nonempty String sFromRole, @NonNull @Nonempty String sFromPartyID, @NonNull @Nonempty String sToRole, @NonNull @Nonempty String sToPartyID) static @NonNull Ebms3PartyInfocreateEbms3PartyInfo(@NonNull @Nonempty String sFromRole, @Nullable String sFromPartyIDType, @NonNull @Nonempty String sFromPartyID, @NonNull @Nonempty String sToRole, @Nullable String sToPartyIDType, @NonNull @Nonempty String sToPartyID) static @Nullable Ebms3PayloadInfocreateEbms3PayloadInfo(boolean bHasSoapPayload, @Nullable com.helger.collection.commons.ICommonsList<? extends IAS4Attachment> aAttachments) Add payload info if attachments are present.static @NonNull Ebms3PropertycreateEbms3Property(@NonNull @Nonempty String sName, @NonNull String sValue) static @NonNull Ebms3PropertycreateEbms3Property(@NonNull @Nonempty String sName, @Nullable String sType, @NonNull String sValue) static @NonNull Ebms3PartyInfocreateEbms3ReversePartyInfo(@NonNull Ebms3PartyInfo aOrigPartyInfo) static @NonNull @Nonempty Stringstatic @NonNull @Nonempty Stringstatic @NonNull @Nonempty StringCreate a new random AS4 Message ID.static @NonNull @Nonempty Stringstatic @NonNull @Nonempty Stringstatic @NonNull com.helger.collection.commons.ICommonsList<Node> getAllDSigReferenceNodes(@Nullable Node aSoapDocument) Extract all "ds:Reference" nodes from the passed SOAP document.static @NonNull com.helger.collection.commons.ICommonsList<com.helger.xsds.xmldsig.ReferenceType> getAllDSigReferences(@Nullable Node aSoapDocument) This is the typed version ofgetAllDSigReferenceNodes(Node)static @Nullable Stringstatic voidsetCustomMessageIDSuffix(@Nullable String sSuffix) Set a custom message ID suffix to be used increateRandomMessageID().
-
Field Details
-
PART_PROPERTY_MIME_TYPE
- See Also:
-
PART_PROPERTY_CHARACTER_SET
- See Also:
-
PART_PROPERTY_COMPRESSION_TYPE
- See Also:
-
PREFIX_CID
-
MESSAGE_ID_SUFFIX_REGEX
The regular expression that any custom message ID suffix must follow.- See Also:
-
-
Method Details
-
createRandomConversationID
-
getCustomMessageIDSuffix
- Returns:
- The custom message ID suffix to be used. May be
null. - Since:
- 1.1.1
-
setCustomMessageIDSuffix
Set a custom message ID suffix to be used increateRandomMessageID(). If a string is provided, any eventually present leading dot is cut. This- Parameters:
sSuffix- The suffix to be used. May benull. If present it must match theMESSAGE_ID_SUFFIX_REGEXregular expression.- Since:
- 1.1.1
-
createRandomMessageID
Create a new random AS4 Message ID. Every call results in a new unique message ID. The layout of a created message ID is like this:UUID@phase4[.customSuffix]whereUUIDis a random UID, "@phase4" is a constant, non-changeable value andcustomSuffixis the optional suffix to be set viasetCustomMessageIDSuffix(String).- Returns:
- A new random AS4 Message ID. Neither
nullnor empty.
-
createRandomContentID
- Returns:
- A random Content-ID that adheres to RFC 822. Neither
nullnor empty.
-
createRandomMessagingID
-
createRandomWSUID
-
createEbms3MessageInfo
Create a new message info with a UUID as message ID.- Returns:
- Never
null.
-
createEbms3MessageInfo
Create a new message info with a UUID as message ID and a reference to the previous message.- Parameters:
sRefToMessageID- The message ID of the referenced message. May benull.- Returns:
- Never
null.
-
createEbms3MessageInfo
public static @NonNull Ebms3MessageInfo createEbms3MessageInfo(@Nonempty @NonNull @Nonempty String sMessageID, @Nullable String sRefToMessageID) Create a new message info.- Parameters:
sMessageID- The message ID. May neither benullnor empty.sRefToMessageID- to set the reference to the previous message needed for two way exchanges- Returns:
- Never
null.
-
createEbms3MessageInfo
public static @NonNull Ebms3MessageInfo createEbms3MessageInfo(@Nonempty @NonNull @Nonempty String sMessageID, @Nullable String sRefToMessageID, @NonNull OffsetDateTime aDateTime) Create a new message info.- Parameters:
sMessageID- The message ID. May neither benullnor empty.sRefToMessageID- to set the reference to the previous message needed for two way exchangesaDateTime- Date and time. May not benull.- Returns:
- Never
null. - Since:
- 0.12.0
-
createEbms3Description
@ReturnsMutableCopy public static @NonNull Ebms3Description createEbms3Description(@NonNull Locale aLocale, @NonNull String sText) -
createEbms3Property
public static @NonNull Ebms3Property createEbms3Property(@Nonempty @NonNull @Nonempty String sName, @NonNull String sValue) -
createEbms3Property
public static @NonNull Ebms3Property createEbms3Property(@Nonempty @NonNull @Nonempty String sName, @Nullable String sType, @NonNull String sValue) -
createEbms3PartyId
-
createEbms3PartyId
public static @NonNull Ebms3PartyId createEbms3PartyId(@Nullable String sType, @Nonempty @NonNull @Nonempty String sValue) -
createEbms3ReversePartyInfo
public static @NonNull Ebms3PartyInfo createEbms3ReversePartyInfo(@NonNull Ebms3PartyInfo aOrigPartyInfo) -
createEbms3PartyInfo
public static @NonNull Ebms3PartyInfo createEbms3PartyInfo(@Nonempty @NonNull @Nonempty String sFromRole, @Nonempty @NonNull @Nonempty String sFromPartyID, @Nonempty @NonNull @Nonempty String sToRole, @Nonempty @NonNull @Nonempty String sToPartyID) -
createEbms3PartyInfo
public static @NonNull Ebms3PartyInfo createEbms3PartyInfo(@Nonempty @NonNull @Nonempty String sFromRole, @Nullable String sFromPartyIDType, @Nonempty @NonNull @Nonempty String sFromPartyID, @Nonempty @NonNull @Nonempty String sToRole, @Nullable String sToPartyIDType, @Nonempty @NonNull @Nonempty String sToPartyID) -
createEbms3MessageProperties
public static @Nullable Ebms3MessageProperties createEbms3MessageProperties(@Nullable Ebms3Property... aEbms3Properties) -
createEbms3MessageProperties
public static @Nullable Ebms3MessageProperties createEbms3MessageProperties(@Nullable List<Ebms3Property> aEbms3Properties) -
createEbms3CollaborationInfo
public static @NonNull Ebms3CollaborationInfo createEbms3CollaborationInfo(@Nullable String sAgreementRefPMode, @Nullable String sAgreementRefValue, @Nullable String sAgreementTypeValue, @Nullable String sServiceType, @Nonempty @NonNull @Nonempty String sServiceValue, @Nonempty @NonNull @Nonempty String sAction, @NonNull String sConversationID) -
createEbms3PartInfo
-
createEbms3PayloadInfo
public static @Nullable Ebms3PayloadInfo createEbms3PayloadInfo(boolean bHasSoapPayload, @Nullable com.helger.collection.commons.ICommonsList<? extends IAS4Attachment> aAttachments) Add payload info if attachments are present.- Parameters:
bHasSoapPayload-trueif SOAP payload is present. This must befalsewhen using MIME message layout!aAttachments- Used attachments- Returns:
nullif no attachments are present.
-
getAllDSigReferenceNodes
@ReturnsMutableCopy public static @NonNull com.helger.collection.commons.ICommonsList<Node> getAllDSigReferenceNodes(@Nullable Node aSoapDocument) Extract all "ds:Reference" nodes from the passed SOAP document. This method search ins "{soapDocument}/Envelop/Header/Security/Signature/SignedInfo".
Note: usenew DSigReferenceMarshaller ().read (aRef)to read the content.- Parameters:
aSoapDocument- The SOAP document to search in. May benull.- Returns:
- A non-
nullbut maybe empty list of Reference nodes. - See Also:
-
getAllDSigReferences
@ReturnsMutableCopy public static @NonNull com.helger.collection.commons.ICommonsList<com.helger.xsds.xmldsig.ReferenceType> getAllDSigReferences(@Nullable Node aSoapDocument) This is the typed version ofgetAllDSigReferenceNodes(Node)- Parameters:
aSoapDocument- The SOAP document to search in. May benull.- Returns:
- A non-
nullbut maybe empty list ofReferenceTypeobject.
-