Class MessageType

All Implemented Interfaces:
Serializable, Id<Integer>, IdTitle<Integer>, Title
Direct Known Subclasses:
MessageTypeCall, MessageTypeEmail, MessageTypeHelpDesk, MessageTypeNote

public abstract class MessageType extends IdTitle
See Also:
  • Field Details

    • configMap

      protected final ConfigMap configMap
    • unprocessedMessagesCount

      protected volatile Integer unprocessedMessagesCount
  • Constructor Details

    • MessageType

      protected MessageType(int id, String title, ConfigMap config)
  • Method Details

    • getConfigMap

      public ConfigMap getConfigMap()
    • getSearchMap

      public Map<Integer, MessageTypeSearch> getSearchMap()
    • getContactSaver

      public MessageTypeContactSaver getContactSaver()
    • isCheckEmptySubject

      public boolean isCheckEmptySubject()
    • isReading

      public boolean isReading()
      Message type is currently running newMessageList(ConnectionSet, String)
      Returns:
      true if reading
    • getUnprocessedMessagesCount

      public Integer getUnprocessedMessagesCount()
      Count of unprocessed messages
      Returns:
      value or null if unknown
    • isAnswerSupport

      public boolean isAnswerSupport()
    • getAnswerMessage

      public Message getAnswerMessage(Message original)
    • answerText

      protected String answerText(String text)
    • isEditable

      public boolean isEditable(Message message)
      Can a message be edited
      Parameters:
      message - the message, null for adding a message of the type
      Returns:
      true if editable
    • isRemovable

      public boolean isRemovable(Message message)
    • isReadable

      public boolean isReadable()
      Returns:
      possibility to mark message as read/unread using kernel logic
    • isProcessChangeSupport

      public boolean isProcessChangeSupport()
    • getViewerJsp

      public String getViewerJsp()
      Returns:
      Plugin's endpoint for unprocessed message viewing
    • getProcessMessageHeaderColor

      public String getProcessMessageHeaderColor(Message message)
    • getHeaderJsp

      public String getHeaderJsp()
      Returns:
      Plugin's endpoint for process message header
    • getMessageDescription

      public String getMessageDescription(String lang, Message message)
      Generates short message description
      Parameters:
      lang - language
      message - message with the type
      Returns:
      the description
    • getEditorJsp

      public String getEditorJsp()
      Plugin's endpoint for process message editor
      Returns:
      the JSP path, or null
    • process

      public void process()
      Sends and reads message list
    • newMessageList

      public List<Message> newMessageList(ConnectionSet conSet, String from) throws Exception
      List of unprocessed messages from storage, for example - E-Mails from IMAP folder
      Parameters:
      conSet - DB connections
      from - optional substring filter by sender
      Returns:
      the new messages
      Throws:
      Exception
    • newMessageGet

      public Message newMessageGet(ConnectionSet conSet, String messageId) throws Exception
      Gets unprocessed message from storage
      Parameters:
      conSet - DB connections
      messageId - unique ID
      Returns:
      the message, or null if not found
      Throws:
      Exception
    • messageDelete

      public void messageDelete(ConnectionSet conSet, String... messageIds) throws Exception
      Deletes both processed and unprocessed messages
      Parameters:
      conSet - DB connections
      messageIds - set with int DB IDs or type related string IDs
      Throws:
      Exception
    • newMessageLoad

      public Message newMessageLoad(Connection con, String messageId) throws Exception
      Gets unprocessed message from storage and persists it in DB
      Parameters:
      con - the DB connection
      messageId - the message ID
      Returns:
      the loaded message, or null
      Throws:
      Exception
    • updateMessage

      public abstract void updateMessage(Connection con, DynActionForm form, Message message) throws Exception
      Throws:
      Exception
    • searchObjectsForLink

      public List<CommonObjectLink> searchObjectsForLink(Message message)
    • messageLinkedToProcess

      public Message messageLinkedToProcess(Message message) throws Exception
      Throws:
      Exception
    • processMessageAttaches

      protected Map<Integer,FileInfo> processMessageAttaches(Connection con, DynActionForm form, Message message) throws Exception
      Throws:
      Exception