Package org.alfresco.email
Class ImapWrapper
- java.lang.Object
-
- org.alfresco.utility.dsl.DSLWrapper<Client>
-
- org.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
-
- org.alfresco.email.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 Summary
Constructors Constructor Description ImapWrapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImapAssertionassertThat()ImapWrapperattemptToDeleteOpenFolder()Attempts to delete an open folder Note: this will always fail since a folder must be closed in order to be deletedImapWrapperauthenticateUser(org.alfresco.utility.model.UserModel userModel)ImapWrapperauthenticateUser(org.alfresco.utility.model.UserModel userModel, int port)ImapWrapperauthenticateUser(org.alfresco.utility.model.UserModel userModel, java.lang.String host)ImapWrapperauthenticateUser(org.alfresco.utility.model.UserModel userModel, java.lang.String host, int port)ImapWrappercopyMessagesTo(org.alfresco.utility.model.ContentModel destinationContentModel)Copy all messages from current folder to destination folderImapWrappercopyMessageTo(org.alfresco.utility.model.ContentModel destinationContentModel)ImapWrappercopyTo(org.alfresco.utility.model.ContentModel destination)ImapWrappercreateFolder(org.alfresco.utility.model.FolderModel folderModel)ImapWrapperdelete()Delete the folder.ImapWrapperdeleteMessage()Delete current message.ImapWrapperdeleteMessage(java.lang.String... contentNames)Delete specified message(s) (content) by given name.ImapWrapperdisconnect()java.lang.StringgetDataDictionaryPath()java.util.List<org.alfresco.utility.model.FolderModel>getFolders()javax.mail.StoregetImapStore()java.lang.StringgetPrefixSpace()protected java.lang.StringgetProtocolJMXConfigurationStatus()java.lang.StringgetRootPath()java.lang.StringgetSitesPath()java.lang.StringgetUserHomesPath()ImapWrappermoveMessageTo(org.alfresco.utility.model.ContentModel destinationContentModel)Move all messages from current folder to destination folderImapWrappermoveTo(org.alfresco.utility.model.ContentModel destination)ImapWrapperrename(java.lang.String newName)ImapWrapperrenameMessageTo(org.alfresco.utility.model.ContentModel newContent)Rename message to the name of new contentImapWrappersearchSubjectFor(java.lang.String searchedTerm)Search subject message for searched termImapWrappersearchSubjectWithWildcardsFor(java.lang.String searchedTerm)Search subject message for searched term that can contains wild cardsImapWrappersubscribe()Subscribe the current folderImapWrapperunsubscribe()Unsubscribe the current folderImapWrapperupdate(java.lang.String content)ImapWrapperusingAlfrescoImap()ImapWrapperusingDataDictionary()ImapWrapperusingPath(java.lang.String path)ImapWrapperusingResource(org.alfresco.utility.model.ContentModel contentModel)java.util.List<javax.mail.Message>usingSearchResults()Gets all search resultsImapWrapperusingSite(java.lang.String siteId)ImapWrapperusingSite(org.alfresco.utility.model.SiteModel siteModel)ImapWrapperusingSiteCalendarContainer(org.alfresco.utility.model.SiteModel siteModel)ImapWrapperusingSiteLinksContainer(org.alfresco.utility.model.SiteModel siteModel)ImapWrapperusingSiteRoot(org.alfresco.utility.model.SiteModel siteModel)Set the currentSpace to /Sites/siteIdImapWrapperusingSites()ImapWrapperusingSiteWikiContainer(org.alfresco.utility.model.SiteModel siteModel)ImapWrapperusingUserHome()ImapWrapperusingUserHome(java.lang.String username)ImapWrapperusingUserHomeRoot()ImapUtilwithImapUtil()JmxUtilwithJMX()MessageFlagswithMessage()Starts process of working with message flags of current content (file)-
Methods inherited from class org.alfresco.utility.dsl.DSLProtocol
and, buildPath, buildSiteDocumentLibraryPath, buildUserHomePath, closeJmxConnection, getCurrentSpace, getCurrentUser, getLastContentModel, getLastResource, getLastResourceWithoutPrefix, getProtocolName, isProtocolEnabled, setCurrentSpace, setLastContentModel, setLastResource, then, usingAdmin, usingRoot, usingUser, waitSeconds, when
-
-
-
-
Method Detail
-
getImapStore
public javax.mail.Store getImapStore()
-
assertThat
public ImapAssertion assertThat()
- Overrides:
assertThatin classorg.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:
authenticateUserin classorg.alfresco.utility.dsl.DSLProtocol<ImapWrapper>- Throws:
java.lang.Exception
-
disconnect
public ImapWrapper disconnect() throws java.lang.Exception
- Specified by:
disconnectin classorg.alfresco.utility.dsl.DSLProtocol<ImapWrapper>- Throws:
java.lang.Exception
-
getPrefixSpace
public java.lang.String getPrefixSpace()
- Specified by:
getPrefixSpacein classorg.alfresco.utility.dsl.DSLProtocol<ImapWrapper>
-
getRootPath
public java.lang.String getRootPath() throws org.alfresco.utility.exception.TestConfigurationException- Specified by:
getRootPathin interfaceorg.alfresco.utility.dsl.DSL<ImapWrapper>- Specified by:
getRootPathin classorg.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:
getSitesPathin interfaceorg.alfresco.utility.dsl.DSL<ImapWrapper>- Specified by:
getSitesPathin classorg.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:
getUserHomesPathin interfaceorg.alfresco.utility.dsl.DSL<ImapWrapper>- Specified by:
getUserHomesPathin classorg.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:
getDataDictionaryPathin interfaceorg.alfresco.utility.dsl.DSL<ImapWrapper>- Specified by:
getDataDictionaryPathin classorg.alfresco.utility.dsl.DSLProtocol<ImapWrapper>- Throws:
org.alfresco.utility.exception.TestConfigurationException
-
getProtocolJMXConfigurationStatus
protected java.lang.String getProtocolJMXConfigurationStatus() throws java.lang.Exception- Specified by:
getProtocolJMXConfigurationStatusin classorg.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:
usingSitein interfaceorg.alfresco.utility.dsl.DSL<ImapWrapper>- Specified by:
usingSitein classorg.alfresco.utility.dsl.DSLProtocol<ImapWrapper>- Throws:
java.lang.Exception
-
usingUserHome
public ImapWrapper usingUserHome(java.lang.String username) throws java.lang.Exception
- Specified by:
usingUserHomein interfaceorg.alfresco.utility.dsl.DSL<ImapWrapper>- Specified by:
usingUserHomein classorg.alfresco.utility.dsl.DSLProtocol<ImapWrapper>- Throws:
java.lang.Exception
-
usingUserHome
public ImapWrapper usingUserHome() throws java.lang.Exception
- Specified by:
usingUserHomein interfaceorg.alfresco.utility.dsl.DSL<ImapWrapper>- Specified by:
usingUserHomein classorg.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:
createFolderin interfaceorg.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:
deletein interfaceorg.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:
getFoldersin interfaceorg.alfresco.utility.dsl.DSLFolder<ImapWrapper>- Throws:
java.lang.Exception
-
rename
public ImapWrapper rename(java.lang.String newName) throws java.lang.Exception
- Specified by:
renamein interfaceorg.alfresco.utility.dsl.DSLContentModelAction<ImapWrapper>- Throws:
java.lang.Exception
-
update
public ImapWrapper update(java.lang.String content) throws java.lang.Exception
- Specified by:
updatein interfaceorg.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:
copyToin interfaceorg.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:
moveToin interfaceorg.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:
usingSitein interfaceorg.alfresco.utility.dsl.DSL<ImapWrapper>- Specified by:
usingSitein classorg.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:
usingResourcein interfaceorg.alfresco.utility.dsl.DSL<ImapWrapper>- Specified by:
usingResourcein classorg.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
-
-