Class Message

java.lang.Object
overit.geocall.mail.Message
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DBMessage

public class Message extends Object implements Serializable
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 Details

    • _subject

      protected String _subject
    • _priority

      protected int _priority
      parametro 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

      protected Date _sendingDate
    • _receptionDate

      protected Date _receptionDate
    • _froms

      protected Addresses _froms
    • _replyTos

      protected Addresses _replyTos
    • _tos

      protected Addresses _tos
    • _ccs

      protected Addresses _ccs
    • _bccs

      protected Addresses _bccs
    • _body

      protected Body _body
    • _attachments

      protected HashMap _attachments
    • _messageid

      protected String _messageid
    • _inreplyto

      protected String _inreplyto
    • _attributes

      protected HashMap _attributes
    • _report

      protected Report _report
  • Constructor Details

    • Message

      public Message()
      Empty constructor
    • Message

      public Message(Body body)
      Constructor for Message
      Parameters:
      body - The Body of the message
    • Message

      public Message(Body body, Attachment[] attachments)
      Constructor for Message
      Parameters:
      body - The Body of the message
      attachments - The array of Attachment
  • Method Details

    • getReport

      public Report getReport()
      Returns the Report
      Returns:
      The Report
    • setReport

      public void setReport(Report r)
      Sets the Report
      Parameters:
      r - The Report
    • getBody

      public Body getBody()
      Returns the Body
      Returns:
      The Body
    • setBody

      public void setBody(Body body)
      Sets the Body
      Parameters:
      body - The Body
    • getAttachments

      public HashMap getAttachments()
      Returns the attachments
      Returns:
      An HashMap with attachments
    • extractAttachments

      public HashMap extractAttachments(String type)
      Extracts the attachments with a given type
      Parameters:
      type - The type used to extract
      Returns:
      An HashMap of extracted attachments
    • addAttachment

      public void addAttachment(Attachment a)
      Add an attachments
      Parameters:
      a - The Attachment
    • getAttachment

      public Attachment getAttachment(String id)
      Gets the attachment by its id
      Parameters:
      id - The id of the attachment
      Returns:
      The Attachment
    • setFrom

      public void setFrom(Address a)
      Sets the "from" of the message
      Parameters:
      a - The Address
    • setReplyTo

      public void setReplyTo(Address a)
      Sets the reply to of the message
      Parameters:
      a - The Address
    • getFroms

      public Addresses getFroms()
      Returns the "from" Addresses
      Returns:
      The "from" Addresses
    • getReplyTos

      public Addresses getReplyTos()
      Returns the "reply tos" Addresses
      Returns:
      The "reply tos" Addresses
    • getTos

      public Addresses getTos()
      Returns the "tos" Addresses
      Returns:
      The "tos" Addresses
    • getCcs

      public Addresses getCcs()
      Returns the "ccs" Addresses
      Returns:
      The "ccs" Addresses
    • getBccs

      public Addresses getBccs()
      Returns the "bccs" Addresses
      Returns:
      The "bccs" Addresses
    • getSubject

      public String getSubject()
      Returns the subject of the message
      Returns:
      The subject of the message
    • setSubject

      public void setSubject(String subject)
      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

      public void setSentDate(Date d)
      Sets the sending date
      Parameters:
      d - The sending Date
    • setReceptionDate

      public void setReceptionDate(Date d)
      Sets the reception date
      Parameters:
      d - The reception Date
    • getSendingDate

      public Date getSendingDate()
      Returns the sending date
      Returns:
      The sending Date
    • getReceptionDate

      public Date getReceptionDate()
      Returns the reception date
      Returns:
      The reception Date
    • getMessageID

      public String getMessageID()
      Returns the message id
      Returns:
      The message id
    • setMessageID

      public void setMessageID(String id)
      Sets the message id
      Parameters:
      id - The message id
    • getInReplyTo

      public String getInReplyTo()
      Returns the in reply to
      Returns:
      The in reply to
    • setInReplyTo

      public void setInReplyTo(String inreplyto)
      Sets the in reply to
      Parameters:
      inreplyto - The in reply to string
    • createCopy

      public Message createCopy()
      Creates a copy of the message
      Returns:
      The copied message
    • addAttribute

      public void addAttribute(String name, String value)
      Adds an attribute
      Parameters:
      name - The name
      value - The value
    • getAttributeMap

      public HashMap getAttributeMap()
      Returns the attributes
      Returns:
      The HashMap containing the attributes