Package com.helger.phase4.incoming
Class AS4IncomingMessageState
- All Implemented Interfaces:
com.helger.commons.collection.attr.IAttributeContainer<String,,Object> com.helger.commons.collection.attr.IAttributeContainerAny<String>,com.helger.commons.collection.impl.ICommonsMap<String,,Object> com.helger.commons.collection.impl.ICommonsOrderedMap<String,,Object> com.helger.commons.lang.ICloneable<com.helger.commons.collection.impl.ICommonsMap<String,,Object>> com.helger.commons.traits.IGetterByKeyTrait<String>,IAS4IncomingMessageState,Serializable,Cloneable,Map<String,,Object> SequencedMap<String,Object>
@NotThreadSafe
public final class AS4IncomingMessageState
extends com.helger.commons.collection.attr.AttributeContainerAny<String>
implements IAS4IncomingMessageState
This class keeps track of the status of an incoming message. It is basically
a String to any map.
Keys starting with
Instances of this object are only modified in the SOAP header handlers.
Old name before v3:
Keys starting with
phase4. are reserved for internal use.Instances of this object are only modified in the SOAP header handlers.
Old name before v3:
AS4MessageState- Author:
- Philip Helger
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> Nested classes/interfaces inherited from interface com.helger.commons.collection.attr.IAttributeContainer
com.helger.commons.collection.attr.IAttributeContainer.IAfterSetValueCallback<KEYTYPE,VALUETYPE>, com.helger.commons.collection.attr.IAttributeContainer.IBeforeSetValueCallback<KEYTYPE, VALUETYPE> -
Constructor Summary
ConstructorsConstructorDescriptionAS4IncomingMessageState(ESoapVersion eSoapVersion, AS4ResourceHelper aResHelper, Locale aLocale) -
Method Summary
Modifier and TypeMethodDescriptionbooleancom.helger.commons.collection.impl.ICommonsMap<String, EAS4CompressionMode> com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> intcom.helger.commons.datetime.XMLOffsetDateTimegetMPC()com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> getPMode()intDeprecated, for removal: This API element is subject to removal in a future version.inthashCode()booleanbooleanbooleanbooleanbooleanvoidsetAS4Profile(IAS4Profile aProfile) Set the AS4 profile of the message.voidsetCompressedAttachmentIDs(com.helger.commons.collection.impl.ICommonsMap<String, EAS4CompressionMode> aIDs) voidsetCryptoFactoryCrypt(IAS4CryptoFactory aCryptoFactoryCrypt) voidsetCryptoFactorySign(IAS4CryptoFactory aCryptoFactorySign) voidsetDecryptedAttachments(com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aAttachments) voidsetDecryptedSoapDocument(Document aDocument) voidvoidsetEffectivePModeLeg(int nLegNumber, PModeLeg aEffectiveLeg) voidsetInitiatorID(String sInitiatorID) voidsetMessageID(String sMessageID) Set the AS4 message ID of the current message.voidsetMessageTimestamp(com.helger.commons.datetime.XMLOffsetDateTime aMessageTimestamp) Set the AS4 message timestamp of the current message.voidsetMessaging(Ebms3Messaging aMessaging) voidvoidsetOriginalAttachments(com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aAttachments) voidsetOriginalSoapDocument(Document aDocument) voidsetPingMessage(boolean bIsPingMessage) voidSet the PMode to be used.voidsetRefToMessageID(String sRefMessageID) Set the AS4 "reference to message ID" from the current message.voidsetResponderID(String sResponderID) voidvoidsetSoapBodyPayloadNode(Node aPayloadNode) voidsetSoapBodyPayloadPresent(boolean bHasSoapBodyPayload) voidsetSoapHeaderElementProcessingSuccessful(boolean bSuccess) voidsetSoapWSS4JException(Exception aException) voidsetSoapWSS4JSecurityActions(int nSecurityActions) voidDeprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class com.helger.commons.collection.attr.AttributeContainerAny
getCloneMethods inherited from class com.helger.commons.collection.attr.AttributeContainer
afterSetValueCallbacks, beforeSetValueCallbacks, toStringMethods inherited from class com.helger.commons.collection.impl.CommonsLinkedHashMap
createInstanceMethods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.phase4.incoming.IAS4IncomingMessageState
containsCompressedAttachmentID, getAttachmentCompressionMode, getEbmsError, getEbmsPullRequest, getEbmsReceipt, getEbmsSignalMessage, getEbmsUserMessage, getEffectiveDecryptedSoapDocument, getProfileID, hasCompressedAttachmentIDs, hasDecryptedAttachments, hasDecryptedSoapDocument, hasDecryptingCertificate, hasInitiatorID, hasMPC, hasOriginalAttachments, hasOriginalSoapDocument, hasResponderID, hasSigningCertificate, hasSoapWSS4JException, hasUsedCertificateMethods inherited from interface com.helger.commons.collection.attr.IAttributeContainer
afterSetValueCallbacks, beforeSetValueCallbacks, getAsBoolean, getAsDouble, getAsFloat, getAsInt, getAsLong, getValue, putAllIn, putInMethods inherited from interface com.helger.commons.collection.attr.IAttributeContainerAny
getAndSetFlag, putIn, putIn, putIn, putIn, putIn, putInMethods inherited from interface com.helger.commons.collection.impl.ICommonsMap
addAll, containsAnyEntry, containsAnyKey, containsAnyValue, copyOfValues, copyOfValues, copyOfValuesMapped, copyOfValuesMapped, findFirstEntry, findFirstKey, findFirstValue, forEach, forEachKey, forEachKey, forEachValue, forEachValue, getAsUnmodifiable, getFirstEntry, getFirstEntry, getFirstKey, getFirstKey, getFirstValue, getFirstValue, getSortedByKey, getSortedByValue, getSwappedKeyValues, isNotEmpty, put, putAll, putAll, putAllMapped, putAllMapped, putAllMapped, putIf, putIfNotNull, removeAll, removeIf, removeIfKey, removeIfValue, removeObject, setAllMethods inherited from interface com.helger.commons.collection.impl.ICommonsOrderedMap
copyOfEntrySet, copyOfKeySet, copyOfKeySet, getLastKey, getLastKey, getLastValue, getLastValueMethods inherited from interface com.helger.commons.traits.IGetterByKeyTrait
containsNonNullValue, containsNullValue, getAsBigDecimal, getAsBigDecimal, getAsBigInteger, getAsBigInteger, getAsBoolean, getAsBooleanObj, getAsByte, getAsByte, getAsByteArray, getAsByteObj, getAsChar, getAsChar, getAsCharArray, getAsCharArray, getAsCharObj, getAsDouble, getAsDoubleObj, getAsFloat, getAsFloatObj, getAsInt, getAsIntObj, getAsLocalDate, getAsLocalDate, getAsLocalDate, getAsLocalDateTime, getAsLocalDateTime, getAsLocalDateTime, getAsLocalTime, getAsLocalTime, getAsLocalTime, getAsLong, getAsLongObj, getAsShort, getAsShort, getAsShortObj, getAsSqlBlob, getAsSqlClob, getAsSqlDate, getAsSqlNClob, getAsSqlRowId, getAsSqlTime, getAsSqlTimestamp, getAsString, getAsString, getAsStringList, getAsStringList, getAsStringSet, getAsStringSet, getCastedValue, getCastedValue, getCastedValue, getCastedValue, getConvertedValue, getConvertedValue, getSafeCastedValue, getSafeCastedValue, getValueClass, hasStringValue, hasStringValue, onSafeCastErrorMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Constructor Details
-
AS4IncomingMessageState
public AS4IncomingMessageState(@Nonnull ESoapVersion eSoapVersion, @Nonnull @WillNotClose AS4ResourceHelper aResHelper, @Nonnull Locale aLocale)
-
-
Method Details
-
getReceiptDT
- Specified by:
getReceiptDTin interfaceIAS4IncomingMessageState- Returns:
- Date and time when the receipt started. This must be set in the
implementation and never
null.
-
getSoapVersion
- Specified by:
getSoapVersionin interfaceIAS4IncomingMessageState- Returns:
- The SOAP version of the current request as specified in the
constructor. Never
null.
-
getResourceHelper
- Specified by:
getResourceHelperin interfaceIAS4IncomingMessageState- Returns:
- The resource manager as specified in the constructor. Never
null.
-
getLocale
- Specified by:
getLocalein interfaceIAS4IncomingMessageState- Returns:
- The request locale to use. Never
null.
-
getMessaging
- Specified by:
getMessagingin interfaceIAS4IncomingMessageState- Returns:
- The parent of the user message/signal message for further evaluation.
-
setMessaging
-
getPMode
- Specified by:
getPModein interfaceIAS4IncomingMessageState- Returns:
- the PMode that is used with the current message. May be
nullif none was found.
-
setPMode
Set the PMode to be used. Called only from Ebms3 header processor- Parameters:
aPMode- PMode Config. May benull.
-
getOriginalSoapDocument
- Specified by:
getOriginalSoapDocumentin interfaceIAS4IncomingMessageState- Returns:
- get the original SOAP document, only the entire document no attachment. This might by encrypted.
- See Also:
-
setOriginalSoapDocument
-
getOriginalAttachments
@Nullable public com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> getOriginalAttachments()- Specified by:
getOriginalAttachmentsin interfaceIAS4IncomingMessageState- Returns:
- has saved the original attachment, can be encrypted or not depends if encryption is used or not.
- See Also:
-
setOriginalAttachments
public void setOriginalAttachments(@Nullable com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aAttachments) -
getDecryptedSoapDocument
- Specified by:
getDecryptedSoapDocumentin interfaceIAS4IncomingMessageState- Returns:
- get the decrypted SOAP document, only the entire document no attachment
- See Also:
-
setDecryptedSoapDocument
-
getDecryptedAttachments
@Nullable public com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> getDecryptedAttachments()- Specified by:
getDecryptedAttachmentsin interfaceIAS4IncomingMessageState- Returns:
- Getting decrypted attachment, if there were encrypted attachments
to begin with. May be
null. - See Also:
-
setDecryptedAttachments
public void setDecryptedAttachments(@Nullable com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aAttachments) -
getCompressedAttachmentIDs
@Nullable public com.helger.commons.collection.impl.ICommonsMap<String,EAS4CompressionMode> getCompressedAttachmentIDs()- Specified by:
getCompressedAttachmentIDsin interfaceIAS4IncomingMessageState- Returns:
- IDs from all compressed attachments and/or payload. May be
null.
-
setCompressedAttachmentIDs
public void setCompressedAttachmentIDs(@Nullable com.helger.commons.collection.impl.ICommonsMap<String, EAS4CompressionMode> aIDs) -
getMPC
- Specified by:
getMPCin interfaceIAS4IncomingMessageState- Returns:
- the MPC that is used in the current message exchange. May be
null.
-
setMPC
-
isSoapBodyPayloadPresent
public boolean isSoapBodyPayloadPresent()- Specified by:
isSoapBodyPayloadPresentin interfaceIAS4IncomingMessageState- Returns:
trueif a payload in the soap body is present, elsefalse- See Also:
-
setSoapBodyPayloadPresent
public void setSoapBodyPayloadPresent(boolean bHasSoapBodyPayload) -
getInitiatorID
- Specified by:
getInitiatorIDin interfaceIAS4IncomingMessageState- Returns:
- initiator set in the usermessage if the incoming message is a
UserMessage. This is the content of the FromParty/PartyId element
and in Peppol reflects the C2. May be
null.
-
setInitiatorID
-
getResponderID
- Specified by:
getResponderIDin interfaceIAS4IncomingMessageState- Returns:
- responder set in the usermessage if the incoming message is a
UserMessage. This is the content of the ToParty/PartyId element and
in Peppol reflects the C3. May be
null.
-
setResponderID
-
getUsedCertificate
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getUsedCertificatein interfaceIAS4IncomingMessageState- Returns:
- The first provided certificate in the incoming message. Usually the
certificate that was used for signing. May be
null. - See Also:
-
setUsedCertificate
@Deprecated(forRemoval=true, since="3.0.5") public void setUsedCertificate(@Nullable X509Certificate aCert) Deprecated, for removal: This API element is subject to removal in a future version. -
getSigningCertificate
- Specified by:
getSigningCertificatein interfaceIAS4IncomingMessageState- Returns:
- The signing certificate in the incoming message. May be
null. - See Also:
-
setSigningCertificate
-
getDecryptingCertificate
- Specified by:
getDecryptingCertificatein interfaceIAS4IncomingMessageState- Returns:
- The decrypting certificate in the incoming message. May be
null. - See Also:
-
setDecryptingCertificate
-
getEffectivePModeLeg
- Specified by:
getEffectivePModeLegin interfaceIAS4IncomingMessageState- Returns:
- The effective leg to use. May be leg 1 or leg 2 of the PMode. If no PMode was found, no PModeLeg is present.
- See Also:
-
getEffectivePModeLegNumber
- Specified by:
getEffectivePModeLegNumberin interfaceIAS4IncomingMessageState- Returns:
- 1 or 2, depending on the used leg. Any other value indicates "undefined". If no PMode was found, no PModeLeg is present.
- See Also:
-
setEffectivePModeLeg
-
getSoapWSS4JSecurityActions
public int getSoapWSS4JSecurityActions()- Specified by:
getSoapWSS4JSecurityActionsin interfaceIAS4IncomingMessageState- Returns:
- A bit set of the WSS4J security action tags found. 0 for nothing. See class org.apache.wss4j.dom.WSContants line 326ff for the constants.
-
setSoapWSS4JSecurityActions
public void setSoapWSS4JSecurityActions(int nSecurityActions) -
isSoapSignatureChecked
public boolean isSoapSignatureChecked()- Specified by:
isSoapSignatureCheckedin interfaceIAS4IncomingMessageState- Returns:
trueif the incoming message was signed and the signature was verified,falseotherwise.
-
isSoapDecrypted
public boolean isSoapDecrypted()- Specified by:
isSoapDecryptedin interfaceIAS4IncomingMessageState- Returns:
trueif the incoming message was decrypted,falseotherwise.
-
getSoapWSS4JException
- Specified by:
getSoapWSS4JExceptionin interfaceIAS4IncomingMessageState- Returns:
- An Exception that occurred during processing the incoming SOAP
WS-Security handler. If this is a
org.apache.wss4j.common.ext.WSSecurityExceptionexception something happened on the security level.
-
setSoapWSS4JException
-
getAS4Profile
- Specified by:
getAS4Profilein interfaceIAS4IncomingMessageState- Returns:
- The phase4 profile to be used. May be
nullin case it could not be determined.
-
setAS4Profile
Set the AS4 profile of the message.- Parameters:
aProfile- The internal AS4 profile. May benull.
-
getMessageID
- Specified by:
getMessageIDin interfaceIAS4IncomingMessageState- Returns:
- The AS4 message ID. Source is the
MessageInfoelement. May benull.
-
setMessageID
Set the AS4 message ID of the current message.- Parameters:
sMessageID- The ID to be set. May benull.
-
getRefToMessageID
- Specified by:
getRefToMessageIDin interfaceIAS4IncomingMessageState- Returns:
- The AS4 "reference to message ID". This value is optional in the
headers. Source is the
MessageInfoelement. May benull.
-
setRefToMessageID
Set the AS4 "reference to message ID" from the current message.- Parameters:
sRefMessageID- The ID to be set. May benull.- Since:
- 1.2.0
-
getMessageTimestamp
- Specified by:
getMessageTimestampin interfaceIAS4IncomingMessageState- Returns:
- The AS4 provided message timestamp. This value is mandatory in the
source
MessageInfoelement. May benull.
-
setMessageTimestamp
public void setMessageTimestamp(@Nullable com.helger.commons.datetime.XMLOffsetDateTime aMessageTimestamp) Set the AS4 message timestamp of the current message.- Parameters:
aMessageTimestamp- The timestamp to be set. May benull.- Since:
- 1.2.0
-
isPingMessage
public boolean isPingMessage()- Specified by:
isPingMessagein interfaceIAS4IncomingMessageState- Returns:
trueif the incoming message is an AS4 ping message,falseotherwise.
-
setPingMessage
public void setPingMessage(boolean bIsPingMessage) -
getSoapBodyPayloadNode
- Specified by:
getSoapBodyPayloadNodein interfaceIAS4IncomingMessageState- Returns:
- The child of the SOAP Body node or
null. That is always decrypted.
-
setSoapBodyPayloadNode
-
isSoapHeaderElementProcessingSuccessful
public boolean isSoapHeaderElementProcessingSuccessful()- Specified by:
isSoapHeaderElementProcessingSuccessfulin interfaceIAS4IncomingMessageState- Returns:
trueif SOAP header element processing was successful,falseif not. If not, than many other values are also not set and at least one error is in the error list.
-
setSoapHeaderElementProcessingSuccessful
public void setSoapHeaderElementProcessingSuccessful(boolean bSuccess) -
getCryptoFactorySign
- Specified by:
getCryptoFactorySignin interfaceIAS4IncomingMessageState- Returns:
- The crypto factory that was used to verify an eventually contained
signature. May be
null. If this is non-nullit is NO indicator, whether a message was signed or not. - See Also:
-
setCryptoFactorySign
-
getCryptoFactoryCrypt
- Specified by:
getCryptoFactoryCryptin interfaceIAS4IncomingMessageState- Returns:
- The crypto factory that was used to decrypt an eventually encrypted
message. May be
null. If this is non-nullit is NO indicator, whether a message was encrypted or not. - See Also:
-
setCryptoFactoryCrypt
-
equals
-
hashCode
public int hashCode()
-