Package com.helger.as2lib.client
Class AS2ClientResponse
- java.lang.Object
-
- com.helger.as2lib.client.AS2ClientResponse
-
public class AS2ClientResponse extends Object
This class contains the basic content that was received from an AS2 server as a response.- Author:
- oleo Date: May 12, 2010 Time: 5:53:45 PM, Philip Helger
-
-
Constructor Summary
Constructors Constructor Description AS2ClientResponse()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAsString()
Throwable
getException()
Duration
getExecutionDuration()
IMessageMDN
getMDN()
String
getMDNDisposition()
String
getMDNMessageID()
String
getMDNText()
X509Certificate
getMDNVerificationCertificate()
String
getOriginalMessageID()
boolean
hasException()
boolean
hasExecutionDuration()
boolean
hasMDN()
void
setException(Throwable aThrowable)
Set an exception that occurred.void
setExecutionDuration(Duration aExecutionDuration)
Set the execution duration of the client request.void
setMDN(IMessageMDN aMDN)
Set the retrieved MDN.void
setMDNVerificationCertificate(X509Certificate aMDNVerificationCertificate)
Set the X509 certificate that was used to verify the MDN.void
setOriginalMessageID(String sOriginalMessageID)
Set the message ID of the message that was sent out.String
toString()
-
-
-
Method Detail
-
setOriginalMessageID
public void setOriginalMessageID(@Nonnull String sOriginalMessageID)
Set the message ID of the message that was sent out. Any existing value will be overwritten.- Parameters:
sOriginalMessageID
- The original AS2 message ID. May not benull
.- See Also:
IBaseMessage.getMessageID()
-
getOriginalMessageID
@Nullable public String getOriginalMessageID()
- Returns:
- The message ID of the original AS2 message. May be
null
if not set (but nevernull
when using in conjunction withAS2Client
).
-
setException
public void setException(@Nonnull Throwable aThrowable)
Set an exception that occurred. Any existing value will be overwritten.- Parameters:
aThrowable
- The raised exception. May not benull
.
-
hasException
public boolean hasException()
- Returns:
true
if an exception is present,false
otherwise.
-
getException
@Nullable public Throwable getException()
- Returns:
- The stored exception. May be
null
if none is present. This usually means that an MDN is present. - See Also:
hasException()
,getMDN()
-
setMDN
public void setMDN(@Nonnull IMessageMDN aMDN)
Set the retrieved MDN. Any existing value will be overwritten.- Parameters:
aMDN
- The MDN retrieved. May not benull
.
-
hasMDN
public boolean hasMDN()
- Returns:
true
if an MDN is present,false
otherwise.
-
getMDN
@Nullable public IMessageMDN getMDN()
- Returns:
- The stored MDN. May be
null
if none is present. Usually this means that an exception is present. - See Also:
hasMDN()
,getException()
-
getMDNMessageID
@Nullable public String getMDNMessageID()
- Returns:
- The message ID of the MDN if present, or
null
if no MDN is present. - See Also:
hasMDN()
-
getMDNText
@Nullable public String getMDNText()
- Returns:
- The text of the MDN if present, or
null
if no MDN is present. - See Also:
hasMDN()
-
getMDNDisposition
@Nullable public String getMDNDisposition()
- Returns:
- The disposition of the MDN if present, or
null
if no MDN is present. - See Also:
hasMDN()
-
getMDNVerificationCertificate
@Nullable public X509Certificate getMDNVerificationCertificate()
- Returns:
- The MDN X509 certificate that was retrieved. May be
null
if the MDN was not signed. - Since:
- 4.4.1
-
setMDNVerificationCertificate
public void setMDNVerificationCertificate(@Nullable X509Certificate aMDNVerificationCertificate)
Set the X509 certificate that was used to verify the MDN.- Parameters:
aMDNVerificationCertificate
- The certificate to be used. May benull
.
-
setExecutionDuration
public void setExecutionDuration(@Nonnull Duration aExecutionDuration)
Set the execution duration of the client request. Any existing value will be overwritten.- Parameters:
aExecutionDuration
- The duration to be set. May not benull
.
-
hasExecutionDuration
public boolean hasExecutionDuration()
- Returns:
true
if an execution duration is present,false
otherwise.
-
getExecutionDuration
@Nullable public Duration getExecutionDuration()
- Returns:
- The execution duration or
null
if not present. When usingAS2Client
the execution time is always set.
-
getAsString
@Nonnull public String getAsString()
- Returns:
- The whole client response in a single string for debugging purposes.
-
-