Package com.isode.x400.highlevel
Class ReceiveMsg
java.lang.Object
com.isode.x400api.MSMessage
com.isode.x400.highlevel.ReceiveMsg
Message read from a P7 Message Store or the MTA via P3
-
Constructor Summary
ConstructorsConstructorDescriptionReceiveMsg
(P3BindSession p3_session_obj) Constructs a new instance of this class given a P3BindSession objectReceiveMsg
(P3BindSession p3_session_obj, int type, byte[] content) Constructs a new instance of this class given a byte[] contentReceiveMsg
(P7BindSession session_obj, int seqn) Constructs a new instance of this class given a P7BindSession and a sequence number. -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(boolean retainInStore) Delete message objectprotected void
finalize()
This routine will be called by the Garbage Collector at some pointint
finishWithMessage
(int errnum, int diag) After getting a message from the P3 channel, this method needs to be called to let the P3 channel know that the message was received and processed safely (i.e.generateIPN
(P3BindSession p3bind_session, int reason, int ackMode) Generates an IPN message so that it can be submitted later ongenerateP22IPN
(P3BindSession p3bind_session, int reason, int ackMode) Generates an IPN message so that it can be submitted later on.Returns the message blind copy recipients (Bcc:), as an array list of Recipient objectsgetBodypart
(int bp_num) Returns the specified bodypart of the messageReturns the message copy recipients (Cc:), as an array list of Recipient objectsint
Obtain copy precedence value from message, if any.Returns the Distribution List Expansion History element of the message, if it exists, otherwise ""Returns the message envelope recipients, as an array list of Recipient objectsgetFrom()
Returns the sender's String encoded O/R addressint
Returns the importance of the messageReturns the IPN Intended Recipient, if one is set.Returns a string representation of the Internal Trace Informationint
getIntParam
(int param) Get the specified integer message parameterReturns the message IPM Header recipients, as an array list of Recipient objectsReturns a English text representation of the content of the IPNcom.isode.rbac.swig.JRSecurityLabel
Read the X.411 security label from the messageReturns the message delivery time as a UTC stringReturns the message delivery time as a DateReturns the message identifierReturns the message IPM identifierReturns the message submission time as a UTC stringReturns the message submission time as a DateReturns the type of the message as a X400_Message_Typeint
Returns the message precedence, taken from one of the recipients.int
Returns the number of bodyparts of the messageReturns the sender's free form name, if availableReturns the sender's O/R addressint
Obtain primary precedence value from message, if any.getPrintableStringParam
(int param) Get a message parameter that has a Printable String format.getRecipients
(int type) Returns the message recipients, as an array list of Recipient objects This method is for internal use only.Returns a string representation of the Redirection History elementReturns a English text representation of the content of the reportbyte[]
Read the X.411 security label from the messagegetStringParam
(int param) Get the specified string message parameterReturns the subject of the messageReturns the text content of the message as IA5 (if available)Returns the message primary recipients (To:), as an array list of Recipient objectsReturns a string representation of the Trace InformationReturns the type of the message as a string (message, report, probe or unknown)Get the message X.400 priorityboolean
Checks whether the message is an IPN (Inter Personal Notification), and that all the reported recipients are read receipts (i.e.boolean
isIPN()
Checks whether the message is an IPN (Inter Personal Notification)boolean
Returns true if the message's external content type is P772 (1.3.26.0.4406.0.4.1)Methods inherited from class com.isode.x400api.MSMessage
GetAttLen, GetAttType, GetIntValue, GetNumRecips, GetType
-
Constructor Details
-
ReceiveMsg
Constructs a new instance of this class given a P7BindSession and a sequence number. It connects to the P7 Message Store server specified in session_object and requests the message identified by seqn.- Parameters:
session_obj
- : the session object to use for this messageseqn
- : Sequence number in the mailbox of the message to receive- Throws:
X400APIException
-
ReceiveMsg
Constructs a new instance of this class given a P3BindSession object- Parameters:
p3_session_obj
- : the session object to use for this message- Throws:
X400APIException
-
ReceiveMsg
Constructs a new instance of this class given a byte[] content- Parameters:
p3_session_obj
-type
-content
-- Throws:
X400APIException
-
-
Method Details
-
delete
Delete message object- Parameters:
retainInStore
- boolean : Retain in P7 Message Store (i.e. no P7 Delete) if true- Throws:
X400APIException
-
finalize
This routine will be called by the Garbage Collector at some point -
getStringParam
Get the specified string message parameter- Parameters:
param
- int: One of the X400_att constants- Returns:
- Returns the String value of the parameter, or "" if the parameter was not present in the message (i.e. it returned X400_E_NO_VALUE or X400_E_BADPARAM). Otherwise it throws an X400APIException
- Throws:
X400APIException
-
getIntParam
Get the specified integer message parameter- Parameters:
param
- int: One of the X400_att constants- Returns:
- Returns the integer value of the parameter, or -1 if the parameter was not present in the message (i.e. it returned X400_E_NO_VALUE or X400_E_BADPARAM). Otherwise it throws an X400APIException
- Throws:
X400APIException
-
isIPN
public boolean isIPN()Checks whether the message is an IPN (Inter Personal Notification) -
isAllPositiveIPN
public boolean isAllPositiveIPN()Checks whether the message is an IPN (Inter Personal Notification), and that all the reported recipients are read receipts (i.e. the message was read by all recipients). -
getSubject
Returns the subject of the message- Throws:
X400APIException
-
getTypeAsString
Returns the type of the message as a string (message, report, probe or unknown) -
getMessageType
Returns the type of the message as a X400_Message_Type -
getX400Priority
Get the message X.400 priority- Throws:
X400APIException
-
getMilitaryPriority
- Returns:
- the military priority of this message.
This method will return null if any of these conditions apply:
- the message doesn't have the external content type set to P772 (1.3.26.0.4406.0.4.1)
- the message is an IPN
- the message is a Delivery ReportNote that old implementations of this method used to return non-null values in the above cases.
- Throws:
X400APIException
-
getPrimaryPrecedence
Obtain primary precedence value from message, if any.- Returns:
- Primary Precedence value or -1 if not present
- Throws:
X400APIException
- if an internal error has occurred - this is almost certainly something fatal.- Since:
- 15.1
-
getCopyPrecedence
Obtain copy precedence value from message, if any.- Returns:
- Copy Precedence value or -1 if not present
- Throws:
X400APIException
- if an internal error has occurred - this is almost certainly something fatal.- Since:
- 15.1
-
getFrom
Returns the sender's String encoded O/R address- Throws:
X400APIException
-
getOriginatorFreeFormName
Returns the sender's free form name, if available- Throws:
X400APIException
-
getOriginatorORAddress
Returns the sender's O/R address- Throws:
X400APIException
-
getMessageIdentifier
Returns the message identifier- Throws:
X400APIException
-
getMessageIPMIdentifier
Returns the message IPM identifier- Throws:
X400APIException
-
getMessageSubmissionTime
Returns the message submission time as a UTC string- Throws:
X400APIException
-
getMessageSubmissionTimeAsDate
Returns the message submission time as a Date- Throws:
X400APIException
-
getMessageDeliveryTime
Returns the message delivery time as a UTC string- Throws:
X400APIException
-
getMessageDeliveryTimeAsDate
Returns the message delivery time as a Date- Throws:
X400APIException
-
getTextContent
Returns the text content of the message as IA5 (if available)- Throws:
X400APIException
-
getReportContentAsText
Returns a English text representation of the content of the report- Throws:
X400APIException
-
getIPNContentAsText
Returns a English text representation of the content of the IPN- Throws:
X400APIException
-
getImportance
Returns the importance of the message- Throws:
X400APIException
-
getNumberOfBodyparts
Returns the number of bodyparts of the message- Throws:
X400APIException
-
getRecipients
Returns the message recipients, as an array list of Recipient objects This method is for internal use only.- Parameters:
type
-- Returns:
- Throws:
X400APIException
-
getEnvelopeRecipients
Returns the message envelope recipients, as an array list of Recipient objects- Throws:
X400APIException
-
getIPMHeaderRecipients
Returns the message IPM Header recipients, as an array list of Recipient objects- Throws:
X400APIException
-
getToRecipients
Returns the message primary recipients (To:), as an array list of Recipient objects- Throws:
X400APIException
-
getCcRecipients
Returns the message copy recipients (Cc:), as an array list of Recipient objects- Throws:
X400APIException
-
getBccRecipients
Returns the message blind copy recipients (Bcc:), as an array list of Recipient objects- Throws:
X400APIException
-
getIntendedRecipient
Returns the IPN Intended Recipient, if one is set. Otherwise it returns null.- Throws:
X400APIException
-
getBodypart
Returns the specified bodypart of the message- Parameters:
bp_num
- Bodypart number (starting from 1)- Returns:
- An Bodypart object
- Throws:
X400APIException
-
generateIPN
public X400Msg generateIPN(P3BindSession p3bind_session, int reason, int ackMode) throws X400APIException Generates an IPN message so that it can be submitted later on- Parameters:
p3bind_session
- the P3 or P7 session object to use for the IPN generationreason
- Reason to use for the IPNackMode
- the Acknowledgement mode- Returns:
- an IPN (X400Msg object) or null if it failed
- Throws:
X400APIException
-
generateP22IPN
public X400Msg generateP22IPN(P3BindSession p3bind_session, int reason, int ackMode) throws X400APIException Generates an IPN message so that it can be submitted later on. The content type is always P22 and the Acknowledgement Mode can be set- Parameters:
p3bind_session
- the P3 or P7 session object to use for the IPN generationreason
- Reason to use for the IPNackMode
- the Acknowledgement mode- Returns:
- an IPN (X400Msg object) or null if it failed
- Throws:
X400APIException
-
getMsgPrecedence
public int getMsgPrecedence()Returns the message precedence, taken from one of the recipients. -
getDLExpansionHistory
Returns the Distribution List Expansion History element of the message, if it exists, otherwise "" -
finishWithMessage
public int finishWithMessage(int errnum, int diag) After getting a message from the P3 channel, this method needs to be called to let the P3 channel know that the message was received and processed safely (i.e. by writing it to disk, a database or some other permanent storage)- Parameters:
errnum
-diag
-
-
getSecurityLabelAsBER
Read the X.411 security label from the message- Returns:
- a byte array with the BER encoded security label
- Throws:
X400APIException
-
getJRSecurityLabel
Read the X.411 security label from the message- Returns:
- a JRSecurityLabel object representing the X.411 security label of the message
- Throws:
X400APIException
-
getPrintableStringParam
Get a message parameter that has a Printable String format.- Parameters:
param
- int: One of the X400_att constants- Throws:
X400APIException
-
isMilitaryContentType
Returns true if the message's external content type is P772 (1.3.26.0.4406.0.4.1)- Throws:
X400APIException
-
getRedirectionHistory
Returns a string representation of the Redirection History element- Returns:
-
getTraceInformation
Returns a string representation of the Trace Information- Returns:
- Throws:
X400APIException
-
getInternalTraceInformation
Returns a string representation of the Internal Trace Information- Returns:
- Throws:
X400APIException
-