Package overit.geocall.mail
Class Message
java.lang.Object
overit.geocall.mail.Message
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DBMessage
Class that manages the Message used to send emails.
The default value for the priority is 3, there are 5 possible values:
1 highest
2 high
3 normal
4 low
5 lowest
Where 2 and 4 are used not often
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HashMapprotected HashMapprotected Addressesprotected Bodyprotected Addressesprotected Addressesprotected Stringprotected Stringprotected intparametro con significato similare all'header (non standard) X-Priority.protected Dateprotected Addressesprotected Reportprotected Dateprotected Stringprotected Addresses -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an attachmentsvoidaddAttribute(String name, String value) Adds an attributeCreates a copy of the messageextractAttachments(String type) Extracts the attachments with a given typegetAttachment(String id) Gets the attachment by its idReturns the attachmentsReturns the attributesgetBccs()Returns the "bccs"AddressesgetBody()Returns theBodygetCcs()Returns the "ccs"AddressesgetFroms()Returns the "from"AddressesReturns the in reply toReturns the message idintGets the priority of the messageReturns the reception dateReturns the "reply tos"AddressesReturns theReportReturns the sending dateReturns the subject of the messagegetTos()Returns the "tos"AddressesvoidSets theBodyvoidSets the "from" of the messagevoidsetInReplyTo(String inreplyto) Sets the in reply tovoidsetMessageID(String id) Sets the message idvoidsetPriority(int priority) Sets the priority of the message (1-2-3-4-5 are the possible values, 3 is default)voidSets the reception datevoidSets the reply to of the messagevoidSets theReportvoidsetSentDate(Date d) Sets the sending datevoidsetSubject(String subject) Sets the subject of the message
-
Field Details
-
_subject
-
_priority
protected int _priorityparametro con significato similare all'header (non standard) X-Priority. I valori possibili (da più prioritario al meno prioritario) sono: 1 highest 2 high 3 normal 4 low 5 lowest in cui il 2 ed il 4 non sono poco usati Il parametro Importance è standard ed assume i valori High (1 o 2), omesso (3) o Low (4 o 5) -
_sendingDate
-
_receptionDate
-
_froms
-
_replyTos
-
_tos
-
_ccs
-
_bccs
-
_body
-
_attachments
-
_messageid
-
_inreplyto
-
_attributes
-
_report
-
-
Constructor Details
-
Message
public Message()Empty constructor -
Message
Constructor for Message- Parameters:
body- TheBodyof the message
-
Message
Constructor for Message- Parameters:
body- TheBodyof the messageattachments- The array ofAttachment
-
-
Method Details
-
getReport
Returns theReport- Returns:
- The
Report
-
setReport
Sets theReport- Parameters:
r- TheReport
-
getBody
Returns theBody- Returns:
- The
Body
-
setBody
Sets theBody- Parameters:
body- TheBody
-
getAttachments
Returns the attachments- Returns:
- An HashMap with attachments
-
extractAttachments
Extracts the attachments with a given type- Parameters:
type- The type used to extract- Returns:
- An HashMap of extracted attachments
-
addAttachment
Add an attachments- Parameters:
a- TheAttachment
-
getAttachment
Gets the attachment by its id- Parameters:
id- The id of the attachment- Returns:
- The
Attachment
-
setFrom
Sets the "from" of the message- Parameters:
a- TheAddress
-
setReplyTo
Sets the reply to of the message- Parameters:
a- TheAddress
-
getFroms
Returns the "from"Addresses- Returns:
- The "from"
Addresses
-
getReplyTos
Returns the "reply tos"Addresses- Returns:
- The "reply tos"
Addresses
-
getTos
Returns the "tos"Addresses- Returns:
- The "tos"
Addresses
-
getCcs
Returns the "ccs"Addresses- Returns:
- The "ccs"
Addresses
-
getBccs
Returns the "bccs"Addresses- Returns:
- The "bccs"
Addresses
-
getSubject
Returns the subject of the message- Returns:
- The subject of the message
-
setSubject
Sets the subject of the message- Parameters:
subject- String containing the subject
-
getPriority
public int getPriority()Gets the priority of the message- Returns:
- The priority
-
setPriority
public void setPriority(int priority) Sets the priority of the message (1-2-3-4-5 are the possible values, 3 is default)- Parameters:
priority- The priority
-
setSentDate
Sets the sending date- Parameters:
d- The sendingDate
-
setReceptionDate
Sets the reception date- Parameters:
d- The receptionDate
-
getSendingDate
Returns the sending date- Returns:
- The sending
Date
-
getReceptionDate
Returns the reception date- Returns:
- The reception
Date
-
getMessageID
Returns the message id- Returns:
- The message id
-
setMessageID
Sets the message id- Parameters:
id- The message id
-
getInReplyTo
Returns the in reply to- Returns:
- The in reply to
-
setInReplyTo
Sets the in reply to- Parameters:
inreplyto- The in reply to string
-
createCopy
Creates a copy of the message- Returns:
- The copied message
-
addAttribute
Adds an attribute- Parameters:
name- The namevalue- The value
-
getAttributeMap
Returns the attributes- Returns:
- The HashMap containing the attributes
-