|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.repo.imap.ImapServiceImpl
public class ImapServiceImpl
| Nested Class Summary | |
|---|---|
static class |
ImapServiceImpl.ImapServiceBootstrap
Bootstrap initialization bean for the service implementation. |
| Nested classes/interfaces inherited from interface org.alfresco.repo.imap.ImapService |
|---|
ImapService.EmailBodyFormat, ImapService.FolderStatus |
| Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy |
|---|
Policy.Arg |
| Field Summary |
|---|
| Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy |
|---|
QNAME |
| Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteChildAssociationPolicy |
|---|
QNAME |
| Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy |
|---|
ARG_0, ARG_1, ARG_2, QNAME |
| Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy |
|---|
QNAME |
| Fields inherited from interface org.alfresco.repo.policy.Policy |
|---|
NAMESPACE |
| Constructor Summary | |
|---|---|
ImapServiceImpl()
|
|
| Method Summary | |
|---|---|
void |
beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Called before a node is deleted. |
protected void |
bindBehaviour()
|
com.icegreen.greenmail.store.SimpleStoredMessage |
createImapMessage(FileInfo fileInfo,
boolean generateBody)
Creates a MIME message for the given file |
void |
deleteMailbox(AlfrescoImapUser user,
java.lang.String mailboxName)
Deletes an existing MailBox. |
void |
expungeMessage(FileInfo fileInfo)
Expunges (deletes) an IMAP message if its flags indicates |
org.alfresco.service.cmr.repository.NodeRef |
extractAttachments(org.alfresco.service.cmr.repository.NodeRef parentFolder,
org.alfresco.service.cmr.repository.NodeRef messageFile,
javax.mail.internet.MimeMessage originalMessage)
Extract attachments from a MimeMessage Puts the attachments into a subfolder below the parent folder. |
java.lang.String |
getAlfrescoServerUID()
This method should returns a unique identifier of Alfresco server. |
java.lang.String |
getDefaultEmailBodyTemplate(ImapService.EmailBodyFormat type)
Returns a template for email body. |
java.lang.String |
getDefaultFromAddress()
|
java.lang.String |
getDefaultToAddress()
|
javax.mail.Flags |
getFlags(FileInfo messageInfo)
Return flags that belong to the specified imap folder. |
ImapService.FolderStatus |
getFolderStatus(java.lang.String userName,
org.alfresco.service.cmr.repository.NodeRef contextNodeRef,
AlfrescoImapConst.ImapViewMode viewMode)
Search for emails in specified folder depending on view mode. |
boolean |
getImapServerEnabled()
Determines whether the IMAP server is enabled. |
com.icegreen.greenmail.store.SimpleStoredMessage |
getMessage(FileInfo mesInfo)
Gets a cached MIME message for the given file, complete with message body. |
org.alfresco.service.namespace.NamespaceService |
getNamespaceService()
|
AlfrescoImapFolder |
getOrCreateMailbox(AlfrescoImapUser user,
java.lang.String mailboxName,
boolean mayExist,
boolean mayCreate)
Returns a reference to a mailbox, either creating a new one or retrieving an existing one. |
java.lang.String |
getRepositoryTemplatePath()
|
org.alfresco.service.cmr.search.SearchService |
getSearchService()
|
java.lang.String |
getShareApplicationContextUrl()
|
org.alfresco.service.cmr.repository.NodeRef |
getUserImapHomeRef(java.lang.String userName)
Get the node ref of the user's imap home. |
java.lang.String |
getWebApplicationContextUrl()
|
void |
init()
|
boolean |
isNodeInSitesLibrary(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Return true if provided nodeRef is in Sites/.../documentlibrary |
java.util.List |
listMailboxes(AlfrescoImapUser user,
java.lang.String mailboxPattern,
boolean listSubscribed)
Depend on listSubscribed param, list Mailboxes or list subscribed Mailboxes |
void |
onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef,
boolean isNewNode)
Called after a node child association has been created. |
void |
onDeleteChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Called after a node child association has been deleted. |
void |
onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.Map before,
java.util.Map after)
Called after a node's properties have been changed. |
void |
renameMailbox(AlfrescoImapUser user,
java.lang.String oldMailboxName,
java.lang.String newMailboxName)
Renames an existing mailbox. |
void |
setDefaultFromAddress(java.lang.String defaultFromAddress)
|
void |
setDefaultToAddress(java.lang.String defaultToAddress)
|
void |
setExtractAttachmentsEnabled(boolean extractAttachmentsEnabled)
|
void |
setFileFolderService(FileFolderService fileFolderService)
|
void |
setFlag(FileInfo messageInfo,
javax.mail.Flags.Flag flag,
boolean value)
Set flags to the specified imapFolder. |
void |
setFlags(FileInfo messageInfo,
javax.mail.Flags flags,
boolean value)
Set flags to the specified imapFolder. |
void |
setFolderCacheSize(int folderCacheSize)
|
void |
setIgnoreExtractionFolders(RepositoryFolderConfigBean[] ignoreExtractionFolders)
|
void |
setImapConfigMountPoints(ImapConfigMountPointsBean[] imapConfigMountPointsBeans)
|
void |
setImapHome(RepositoryFolderConfigBean imapHomeConfigBean)
|
void |
setImapServerEnabled(boolean enabled)
|
void |
setMessageCache(org.alfresco.repo.cache.SimpleCache messageCache)
|
void |
setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
|
void |
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
|
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
|
void |
setPolicyFilter(BehaviourFilter policyFilter)
|
void |
setRepositoryTemplatePath(java.lang.String repositoryTemplatePath)
|
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
|
void |
setServiceRegistry(ServiceRegistry serviceRegistry)
|
void |
setSysAdminParams(SysAdminParams sysAdminParams)
|
void |
shutdown()
|
void |
startup()
This method is run as System within a single transaction on startup. |
protected void |
startupInTxn(boolean force)
|
void |
subscribe(AlfrescoImapUser user,
java.lang.String mailbox)
Subscribes a user to a mailbox. |
void |
unsubscribe(AlfrescoImapUser user,
java.lang.String mailbox)
Unsubscribes from a given mailbox. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImapServiceImpl()
| Method Detail |
|---|
public void setSysAdminParams(SysAdminParams sysAdminParams)
public void setMessageCache(org.alfresco.repo.cache.SimpleCache messageCache)
public void setFileFolderService(FileFolderService fileFolderService)
public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
public void setServiceRegistry(ServiceRegistry serviceRegistry)
public void setPolicyFilter(BehaviourFilter policyFilter)
public void setImapHome(RepositoryFolderConfigBean imapHomeConfigBean)
public void setFolderCacheSize(int folderCacheSize)
public java.lang.String getDefaultFromAddress()
getDefaultFromAddress in interface ImapServicepublic void setDefaultFromAddress(java.lang.String defaultFromAddress)
public java.lang.String getDefaultToAddress()
getDefaultToAddress in interface ImapServicepublic void setDefaultToAddress(java.lang.String defaultToAddress)
public java.lang.String getWebApplicationContextUrl()
getWebApplicationContextUrl in interface ImapServicepublic java.lang.String getShareApplicationContextUrl()
getShareApplicationContextUrl in interface ImapServicepublic java.lang.String getRepositoryTemplatePath()
getRepositoryTemplatePath in interface ImapServicepublic void setRepositoryTemplatePath(java.lang.String repositoryTemplatePath)
public void setImapConfigMountPoints(ImapConfigMountPointsBean[] imapConfigMountPointsBeans)
public void setIgnoreExtractionFolders(RepositoryFolderConfigBean[] ignoreExtractionFolders)
public void setExtractAttachmentsEnabled(boolean extractAttachmentsEnabled)
public void setImapServerEnabled(boolean enabled)
public boolean getImapServerEnabled()
ImapService
getImapServerEnabled in interface ImapServicepublic void init()
public void startup()
public void shutdown()
protected void startupInTxn(boolean force)
protected void bindBehaviour()
public com.icegreen.greenmail.store.SimpleStoredMessage getMessage(FileInfo mesInfo)
throws javax.mail.MessagingException
ImapService
getMessage in interface ImapServicemesInfo - imap file info.
javax.mail.MessagingException
public com.icegreen.greenmail.store.SimpleStoredMessage createImapMessage(FileInfo fileInfo,
boolean generateBody)
throws javax.mail.MessagingException
ImapService
createImapMessage in interface ImapServicefileInfo - imap file info.generateBody - Should the message body be generated?
javax.mail.MessagingExceptionpublic void expungeMessage(FileInfo fileInfo)
ImapService
expungeMessage in interface ImapServicefileInfo - imap file info.
public AlfrescoImapFolder getOrCreateMailbox(AlfrescoImapUser user,
java.lang.String mailboxName,
boolean mayExist,
boolean mayCreate)
ImapService
getOrCreateMailbox in interface ImapServiceuser - User making the request.mailboxName - String name of the target.mayExist - Is the mailbox allowed to exist already? If false and the mailbox already exists, an error will be thrownmayCreate - If the mailbox does not exist, can one be created? If false then an error is thrown if the folder does not exist
public void deleteMailbox(AlfrescoImapUser user,
java.lang.String mailboxName)
ImapService
deleteMailbox in interface ImapServiceuser - User making the request.mailboxName - String name of the target,
public void renameMailbox(AlfrescoImapUser user,
java.lang.String oldMailboxName,
java.lang.String newMailboxName)
ImapService
renameMailbox in interface ImapServiceuser - User making the request.oldMailboxName - String name of the existing foldernewMailboxName - String target new name
public ImapService.FolderStatus getFolderStatus(java.lang.String userName,
org.alfresco.service.cmr.repository.NodeRef contextNodeRef,
AlfrescoImapConst.ImapViewMode viewMode)
getFolderStatus in interface ImapServicecontextNodeRef - context folder for searchviewMode - context folder view mode
public void subscribe(AlfrescoImapUser user,
java.lang.String mailbox)
ImapService
subscribe in interface ImapServiceuser - User making the requestmailbox - String representation of a mailbox name.
public void unsubscribe(AlfrescoImapUser user,
java.lang.String mailbox)
ImapService
unsubscribe in interface ImapServiceuser - User making the requestmailbox - String representation of a mailbox name.public javax.mail.Flags getFlags(FileInfo messageInfo)
getFlags in interface ImapServicemessageInfo - imap folder info.
public void setFlags(FileInfo messageInfo,
javax.mail.Flags flags,
boolean value)
setFlags in interface ImapServicemessageInfo - FileInfo of imap Folder.flags - flags to set.value - value to set.
public void setFlag(FileInfo messageInfo,
javax.mail.Flags.Flag flag,
boolean value)
setFlag in interface ImapServicemessageInfo - FileInfo of imap Folderflag - flag to set.value - value value to set.
public java.util.List listMailboxes(AlfrescoImapUser user,
java.lang.String mailboxPattern,
boolean listSubscribed)
listMailboxes in interface ImapServiceuser - User making the requestmailboxPattern - String name of a mailbox, possible including a wildcard.listSubscribed - list only subscribed folders?
public org.alfresco.service.cmr.repository.NodeRef getUserImapHomeRef(java.lang.String userName)
getUserImapHomeRef in interface ImapServiceuserName - user name
public java.lang.String getDefaultEmailBodyTemplate(ImapService.EmailBodyFormat type)
ImapService"Data Dictionary > IMAP Templates >". This path should be set as the property of the "imapHelper" bean.
In this case it returns NodeRef.toString() of the template. If there are no template in the repository it
returns a default template on the classpath.
getDefaultEmailBodyTemplate in interface ImapServicepublic java.lang.String getAlfrescoServerUID()
public void onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef,
boolean isNewNode)
NodeServicePolicies.OnCreateChildAssociationPolicy
onCreateChildAssociation in interface NodeServicePolicies.OnCreateChildAssociationPolicychildAssocRef - the child association that has been createdisNewNode - true if the node is new or false if the node is being linked inpublic void onDeleteChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
NodeServicePolicies.OnDeleteChildAssociationPolicy
onDeleteChildAssociation in interface NodeServicePolicies.OnDeleteChildAssociationPolicychildAssocRef - the child association that has been deleted
public void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.Map before,
java.util.Map after)
NodeServicePolicies.OnUpdatePropertiesPolicy
onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicynodeRef - reference to the updated nodebefore - the node's properties before the changeafter - the node's properties after the changepublic void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeServicePolicies.BeforeDeleteNodePolicy
beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicynodeRef - the node referencepublic boolean isNodeInSitesLibrary(org.alfresco.service.cmr.repository.NodeRef nodeRef)
isNodeInSitesLibrary in interface ImapServicenodeRef - nodeRef
public org.alfresco.service.cmr.repository.NodeRef extractAttachments(org.alfresco.service.cmr.repository.NodeRef parentFolder,
org.alfresco.service.cmr.repository.NodeRef messageFile,
javax.mail.internet.MimeMessage originalMessage)
throws java.io.IOException,
javax.mail.MessagingException
extractAttachments in interface ImapServicemessageFile - the node ref of the message.
java.io.IOException
javax.mail.MessagingExceptionpublic void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
public org.alfresco.service.namespace.NamespaceService getNamespaceService()
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
public org.alfresco.service.cmr.search.SearchService getSearchService()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||