Class ImapWrapper

  • All Implemented Interfaces:
    org.alfresco.utility.dsl.DSL<ImapWrapper>, org.alfresco.utility.dsl.DSLContentModelAction<ImapWrapper>, org.alfresco.utility.dsl.DSLFolder<ImapWrapper>

    @Service
    @Scope("prototype")
    public class ImapWrapper
    extends org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
    implements org.alfresco.utility.dsl.DSLContentModelAction<ImapWrapper>, org.alfresco.utility.dsl.DSLFolder<ImapWrapper>
    • Constructor Detail

      • ImapWrapper

        public ImapWrapper()
    • Method Detail

      • getImapStore

        public javax.mail.Store getImapStore()
      • assertThat

        public ImapAssertion assertThat()
        Overrides:
        assertThat in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
      • withJMX

        public JmxUtil withJMX()
        Returns:
        JMX DSL for this wrapper
      • withImapUtil

        public ImapUtil withImapUtil()
        Returns:
        utilities that are used by CMIS
      • authenticateUser

        public ImapWrapper authenticateUser​(org.alfresco.utility.model.UserModel userModel)
                                     throws java.lang.Exception
        Specified by:
        authenticateUser in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        java.lang.Exception
      • disconnect

        public ImapWrapper disconnect()
                               throws java.lang.Exception
        Specified by:
        disconnect in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        java.lang.Exception
      • getPrefixSpace

        public java.lang.String getPrefixSpace()
        Specified by:
        getPrefixSpace in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
      • getRootPath

        public java.lang.String getRootPath()
                                     throws org.alfresco.utility.exception.TestConfigurationException
        Specified by:
        getRootPath in interface org.alfresco.utility.dsl.DSL<ImapWrapper>
        Specified by:
        getRootPath in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        org.alfresco.utility.exception.TestConfigurationException
      • getSitesPath

        public java.lang.String getSitesPath()
                                      throws org.alfresco.utility.exception.TestConfigurationException
        Specified by:
        getSitesPath in interface org.alfresco.utility.dsl.DSL<ImapWrapper>
        Specified by:
        getSitesPath in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        org.alfresco.utility.exception.TestConfigurationException
      • getUserHomesPath

        public java.lang.String getUserHomesPath()
                                          throws org.alfresco.utility.exception.TestConfigurationException
        Specified by:
        getUserHomesPath in interface org.alfresco.utility.dsl.DSL<ImapWrapper>
        Specified by:
        getUserHomesPath in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        org.alfresco.utility.exception.TestConfigurationException
      • getDataDictionaryPath

        public java.lang.String getDataDictionaryPath()
                                               throws org.alfresco.utility.exception.TestConfigurationException
        Specified by:
        getDataDictionaryPath in interface org.alfresco.utility.dsl.DSL<ImapWrapper>
        Specified by:
        getDataDictionaryPath in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        org.alfresco.utility.exception.TestConfigurationException
      • getProtocolJMXConfigurationStatus

        protected java.lang.String getProtocolJMXConfigurationStatus()
                                                              throws java.lang.Exception
        Specified by:
        getProtocolJMXConfigurationStatus in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        java.lang.Exception
      • usingDataDictionary

        public ImapWrapper usingDataDictionary()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • usingPath

        public ImapWrapper usingPath​(java.lang.String path)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • usingSites

        public ImapWrapper usingSites()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • usingSite

        public ImapWrapper usingSite​(org.alfresco.utility.model.SiteModel siteModel)
                              throws java.lang.Exception
        Specified by:
        usingSite in interface org.alfresco.utility.dsl.DSL<ImapWrapper>
        Specified by:
        usingSite in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        java.lang.Exception
      • usingUserHome

        public ImapWrapper usingUserHome​(java.lang.String username)
                                  throws java.lang.Exception
        Specified by:
        usingUserHome in interface org.alfresco.utility.dsl.DSL<ImapWrapper>
        Specified by:
        usingUserHome in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        java.lang.Exception
      • usingUserHome

        public ImapWrapper usingUserHome()
                                  throws java.lang.Exception
        Specified by:
        usingUserHome in interface org.alfresco.utility.dsl.DSL<ImapWrapper>
        Specified by:
        usingUserHome in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        java.lang.Exception
      • usingUserHomeRoot

        public ImapWrapper usingUserHomeRoot()
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • usingAlfrescoImap

        public ImapWrapper usingAlfrescoImap()
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • usingSiteWikiContainer

        public ImapWrapper usingSiteWikiContainer​(org.alfresco.utility.model.SiteModel siteModel)
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • usingSiteLinksContainer

        public ImapWrapper usingSiteLinksContainer​(org.alfresco.utility.model.SiteModel siteModel)
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • usingSiteCalendarContainer

        public ImapWrapper usingSiteCalendarContainer​(org.alfresco.utility.model.SiteModel siteModel)
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createFolder

        public ImapWrapper createFolder​(org.alfresco.utility.model.FolderModel folderModel)
                                 throws java.lang.Exception
        Specified by:
        createFolder in interface org.alfresco.utility.dsl.DSLFolder<ImapWrapper>
        Throws:
        java.lang.Exception
      • delete

        public ImapWrapper delete()
                           throws java.lang.Exception
        Delete the folder. Folder must be closed in order to be deleted.
        Specified by:
        delete in interface org.alfresco.utility.dsl.DSLContentModelAction<ImapWrapper>
        Throws:
        java.lang.Exception
      • attemptToDeleteOpenFolder

        public ImapWrapper attemptToDeleteOpenFolder()
                                              throws java.lang.Exception
        Attempts to delete an open folder Note: this will always fail since a folder must be closed in order to be deleted
        Throws:
        java.lang.Exception
      • getFolders

        public java.util.List<org.alfresco.utility.model.FolderModel> getFolders()
                                                                          throws java.lang.Exception
        Specified by:
        getFolders in interface org.alfresco.utility.dsl.DSLFolder<ImapWrapper>
        Throws:
        java.lang.Exception
      • rename

        public ImapWrapper rename​(java.lang.String newName)
                           throws java.lang.Exception
        Specified by:
        rename in interface org.alfresco.utility.dsl.DSLContentModelAction<ImapWrapper>
        Throws:
        java.lang.Exception
      • update

        public ImapWrapper update​(java.lang.String content)
                           throws java.lang.Exception
        Specified by:
        update in interface org.alfresco.utility.dsl.DSLContentModelAction<ImapWrapper>
        Throws:
        java.lang.Exception
      • copyTo

        public ImapWrapper copyTo​(org.alfresco.utility.model.ContentModel destination)
                           throws java.lang.Exception
        Specified by:
        copyTo in interface org.alfresco.utility.dsl.DSLContentModelAction<ImapWrapper>
        Throws:
        java.lang.Exception
      • moveTo

        public ImapWrapper moveTo​(org.alfresco.utility.model.ContentModel destination)
                           throws java.lang.Exception
        Specified by:
        moveTo in interface org.alfresco.utility.dsl.DSLContentModelAction<ImapWrapper>
        Throws:
        java.lang.Exception
      • deleteMessage

        public ImapWrapper deleteMessage​(java.lang.String... contentNames)
                                  throws java.lang.Exception
        Delete specified message(s) (content) by given name. A message in IMAP client can be identified by the name of the content. Parent folder must be closed at the end in order message to be deleted.
        Parameters:
        contentNames - name of the content(s)
        Returns:
        current wrapper
        Throws:
        java.lang.Exception
      • deleteMessage

        public ImapWrapper deleteMessage()
                                  throws java.lang.Exception
        Delete current message. Parent folder must be closed at the end in order message to be deleted.
        Returns:
        current wrapper
        Throws:
        java.lang.Exception
      • usingSite

        public ImapWrapper usingSite​(java.lang.String siteId)
                              throws java.lang.Exception
        Specified by:
        usingSite in interface org.alfresco.utility.dsl.DSL<ImapWrapper>
        Specified by:
        usingSite in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        java.lang.Exception
      • usingResource

        public ImapWrapper usingResource​(org.alfresco.utility.model.ContentModel contentModel)
                                  throws java.lang.Exception
        Specified by:
        usingResource in interface org.alfresco.utility.dsl.DSL<ImapWrapper>
        Specified by:
        usingResource in class org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
        Throws:
        java.lang.Exception
      • copyMessageTo

        public ImapWrapper copyMessageTo​(org.alfresco.utility.model.ContentModel destinationContentModel)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • copyMessagesTo

        public ImapWrapper copyMessagesTo​(org.alfresco.utility.model.ContentModel destinationContentModel)
                                   throws java.lang.Exception
        Copy all messages from current folder to destination folder
        Parameters:
        destinationContentModel - destination folder
        Returns:
        Throws:
        java.lang.Exception
      • renameMessageTo

        public ImapWrapper renameMessageTo​(org.alfresco.utility.model.ContentModel newContent)
                                    throws java.lang.Exception
        Rename message to the name of new content
        Parameters:
        newContent -
        Returns:
        Throws:
        java.lang.Exception
      • moveMessageTo

        public ImapWrapper moveMessageTo​(org.alfresco.utility.model.ContentModel destinationContentModel)
                                  throws java.lang.Exception
        Move all messages from current folder to destination folder
        Parameters:
        destinationContentModel - destination folder
        Returns:
        Throws:
        java.lang.Exception
      • authenticateUser

        public ImapWrapper authenticateUser​(org.alfresco.utility.model.UserModel userModel,
                                            java.lang.String host)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • authenticateUser

        public ImapWrapper authenticateUser​(org.alfresco.utility.model.UserModel userModel,
                                            int port)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • authenticateUser

        public ImapWrapper authenticateUser​(org.alfresco.utility.model.UserModel userModel,
                                            java.lang.String host,
                                            int port)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • withMessage

        public MessageFlags withMessage()
                                 throws java.lang.Exception
        Starts process of working with message flags of current content (file)
        Returns:
        Throws:
        java.lang.Exception
      • searchSubjectWithWildcardsFor

        public ImapWrapper searchSubjectWithWildcardsFor​(java.lang.String searchedTerm)
                                                  throws java.lang.Exception
        Search subject message for searched term that can contains wild cards
        Parameters:
        searchedTerm -
        Returns:
        Throws:
        java.lang.Exception
      • searchSubjectFor

        public ImapWrapper searchSubjectFor​(java.lang.String searchedTerm)
                                     throws java.lang.Exception
        Search subject message for searched term
        Parameters:
        searchedTerm -
        Returns:
        Throws:
        java.lang.Exception
      • usingSearchResults

        public java.util.List<javax.mail.Message> usingSearchResults()
        Gets all search results
        Returns:
        list of returned messaged by searched
      • subscribe

        public ImapWrapper subscribe()
                              throws java.lang.Exception
        Subscribe the current folder
        Returns:
        Throws:
        java.lang.Exception
      • unsubscribe

        public ImapWrapper unsubscribe()
                                throws java.lang.Exception
        Unsubscribe the current folder
        Returns:
        Throws:
        java.lang.Exception
      • usingSiteRoot

        public ImapWrapper usingSiteRoot​(org.alfresco.utility.model.SiteModel siteModel)
                                  throws java.lang.Exception
        Set the currentSpace to /Sites/siteId
        Throws:
        java.lang.Exception