com.atlassian.confluence.mail
Class DefaultMailContentManager

java.lang.Object
  extended by com.atlassian.confluence.mail.DefaultMailContentManager
All Implemented Interfaces:
ContentEntityManager, MailContentManager

Deprecated. since 4.2. See MailContentManager.

@Deprecated
public class DefaultMailContentManager
extends java.lang.Object
implements MailContentManager


Field Summary
 
Fields inherited from interface com.atlassian.confluence.core.ContentEntityManager
ITERATE_ALL
 
Constructor Summary
DefaultMailContentManager()
          Deprecated.  
 
Method Summary
 int findMailTotal(Space space)
          Deprecated.  
 ContentEntityObject getById(long id)
          Deprecated.  
 Mail getFirstMailAfter(java.lang.String spaceKey, long mailId)
          Deprecated.  
 Mail getFirstMailBefore(java.lang.String spaceKey, long mailId)
          Deprecated.  
 java.util.List<Mail> getMail(Space space, boolean currentOnly)
          Deprecated.  
 Mail getMailById(long id)
          Deprecated. Get a mail by its database id.
 Mail getMailByMessageId(java.lang.String messageId)
          Deprecated. Get a mail by its message-id.
 java.util.List getMailsByMessageId(java.lang.String messageId)
          Deprecated. Get all mails with the matching message-id.
 ContentEntityObject getNextVersion(ContentEntityObject ceo)
          Deprecated.  
 ContentEntityObject getOtherVersion(ContentEntityObject ceo, int version)
          Deprecated.  
 ContentEntityObject getPreviousVersion(ContentEntityObject ceo)
          Deprecated.  
 java.util.Iterator getRecentlyAddedEntities(java.lang.String spaceKey, int maxResults)
          Deprecated. Retrieve an iterator of recently added entities, in order of most recent to last.
 java.util.Iterator getRecentlyModifiedEntities(java.lang.String spaceKey, int maxResults)
          Deprecated. Retrieve an iterator of recently modified entities, in order of most recent to last.
 java.util.Iterator getRecentlyModifiedEntitiesForUser(java.lang.String username)
          Deprecated. Retrieve an iterator of recently modified entities, in order of most recent to last.
 java.util.List getRecentlyModifiedForChangeDigest(java.util.Date fromDate)
          Deprecated. Retrieves a list of ContentEntityObjects that have been newly added or modified since the date specified.
 java.util.List getSpaceMail(int firstResult, int maxResults, java.lang.String spaceKey)
          Deprecated.  
 java.util.Iterator getSpaceMailIterator(java.lang.String spaceKey)
          Deprecated.  
 java.util.Iterator getSpaceMailWithAttachmentsIterator(java.lang.String spaceKey)
          Deprecated.  
 java.util.List<VersionHistorySummary> getVersionHistorySummaries(ContentEntityObject ceo)
          Deprecated. Get a VersionHistorySummary for all previous versions of a ContentEntityObject, starting with the current content.
 void refreshContentEntity(ContentEntityObject obj)
          Deprecated. Refreshes the specified entity (including content) in the Hibernate session to ensure that subsequent retrievals are up-to-date.
 void removeAllMail(Space space)
          Deprecated.  
 void removeAttachmentsForMail(Mail mail)
          Deprecated.  
 void removeContentEntity(ContentEntityObject obj)
          Deprecated. Removes given content entity object and all associated domain objects i.e.
 void removeHistoricalVersion(ContentEntityObject historicalVersion)
          Deprecated. Removes a historical ContentEntityObject.
 void removeMail(Mail mail)
          Deprecated. removes mail and its associated attachments
 void revertContentEntityBackToVersion(ContentEntityObject obj, int version, java.lang.String revertComment, boolean revertTitle)
          Deprecated.  Reverts a ContentEntityObject back to its state at the version specified by version.
 void saveContentEntity(ContentEntityObject obj, ContentEntityObject origObj, SaveContext saveContext)
          Deprecated. In order to create a history for this object, we need to pass in the modified as well as the original version of the object.
 void saveContentEntity(ContentEntityObject obj, SaveContext saveContext)
          Deprecated.  
<T extends ContentEntityObject>
void
saveNewVersion(T current, Modification<T> modification)
          Deprecated. Applies the state changes supplied by modification and persists those changes to a new version.
<T extends ContentEntityObject>
void
saveNewVersion(T current, Modification<T> modification, SaveContext saveContext)
          Deprecated. Applies the state changes supplied by modification and persists those changes to a new version.
 void setEventManager(com.atlassian.event.EventManager eventManager)
          Deprecated.  
 boolean spaceHasMail(java.lang.String spaceKey)
          Deprecated.  
 Mail storeIncomingMail(Space space, byte[] rawMessage)
          Deprecated. Create a new mail content object in the given space for the given raw RFC822 message.
 Mail storeIncomingMail(Space space, javax.mail.internet.MimeMessage mimeMessage)
          Deprecated. Create a new mail content object in the given space for the given mimeMessage.
 void updateContentLinkingTo(SpaceContentEntityObject contentBeingRefactored, java.lang.String newSpaceKey, java.lang.String newTitle)
          Deprecated. Loops through all the content that currently links to 'contentBeingChanged' and renames all the links.
 void updateOutgoingLinksInContent(SpaceContentEntityObject contentBeingRefactored, java.lang.String newSpaceKey)
          Deprecated. Update the links on the page itself.
 void updateSingleContentLinkinTo(ContentEntityObject referringContent, SpaceContentEntityObject contentBeingRefactored, java.lang.String newSpaceKey, java.lang.String newTitle)
          Deprecated. Renames all links contained in the 'referringContent' that currently links to 'contentBeingRefactored'.
 void updateSingleContentLinkinTo(ContentEntityObject referringContent, SpaceContentEntityObject contentBeingRefactored, java.lang.String newSpaceKey, java.lang.String newTitle, SaveContext saveContext)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMailContentManager

public DefaultMailContentManager()
Deprecated. 
Method Detail

refreshContentEntity

public void refreshContentEntity(ContentEntityObject obj)
Deprecated. 
Description copied from interface: ContentEntityManager
Refreshes the specified entity (including content) in the Hibernate session to ensure that subsequent retrievals are up-to-date.

Specified by:
refreshContentEntity in interface ContentEntityManager
Parameters:
obj - the object to be refreshed in the Hibernate session.

saveContentEntity

public void saveContentEntity(ContentEntityObject obj,
                              SaveContext saveContext)
Deprecated. 
Specified by:
saveContentEntity in interface ContentEntityManager
Parameters:
obj - - the ContentEntityObject to save
saveContext - - a SaveContext object for the manager.

saveContentEntity

public void saveContentEntity(ContentEntityObject obj,
                              ContentEntityObject origObj,
                              SaveContext saveContext)
Deprecated. 
Description copied from interface: ContentEntityManager
In order to create a history for this object, we need to pass in the modified as well as the original version of the object.

Specified by:
saveContentEntity in interface ContentEntityManager
saveContext - - a SaveContext holding additional parameters for the manager to use when saving.

saveNewVersion

public <T extends ContentEntityObject> void saveNewVersion(T current,
                                                           Modification<T> modification)
Deprecated. 
Description copied from interface: ContentEntityManager
Applies the state changes supplied by modification and persists those changes to a new version.
 manager.<Page>saveNewVersion(page, new Modification<Page>() {
      public void modify(Page page) {
          page.setTitle("foobar");
      }
 });
 

Specified by:
saveNewVersion in interface ContentEntityManager
Type Parameters:
T - the type content. This ensures that the type of current is the same as the type passed to the modification
Parameters:
current - the current / latest version
modification - an implementation of Modification which describes the state changes you require

saveNewVersion

public <T extends ContentEntityObject> void saveNewVersion(T current,
                                                           Modification<T> modification,
                                                           SaveContext saveContext)
Deprecated. 
Description copied from interface: ContentEntityManager
Applies the state changes supplied by modification and persists those changes to a new version.
 manager.<Page>saveNewVersion(page, new Modification<Page>() {
      public void modify(Page page) {
          page.setTitle("foobar");
      }
 }, new DefaultSaveContext());
 

Specified by:
saveNewVersion in interface ContentEntityManager
Type Parameters:
T - the type content. This ensures that the type of current is the same as the type passed to the modification
Parameters:
current - the current / latest version
modification - an implementation of Modification which describes the state changes you require
saveContext - the save context (null if you have no specific requirements - or just use ContentEntityManager.saveNewVersion(ContentEntityObject, Modification)).

removeContentEntity

public void removeContentEntity(ContentEntityObject obj)
Deprecated. 
Description copied from interface: ContentEntityManager
Removes given content entity object and all associated domain objects i.e. if we remove a page it removes all its labels and attachments

Specified by:
removeContentEntity in interface ContentEntityManager

revertContentEntityBackToVersion

public void revertContentEntityBackToVersion(ContentEntityObject obj,
                                             int version,
                                             java.lang.String revertComment,
                                             boolean revertTitle)
Deprecated. 
Description copied from interface: ContentEntityManager

Reverts a ContentEntityObject back to its state at the version specified by version. Creates a new latest version that resembles the previous state.

Since Confluence 4.0 most ContentEntityObjects are assumed to be XHTML formatted. So in reverting a ContentEntityObject which actually has a WIKI BodyType this will be migrated on the fly to XHTML.

Specified by:
revertContentEntityBackToVersion in interface ContentEntityManager
Parameters:
obj - The ContentEntityObject to revert
version - The version to revert to
revertComment - A comment to be associated with the revert
revertTitle - If true, the ContentEntityObject title will be reverted to the old state

getRecentlyAddedEntities

public java.util.Iterator getRecentlyAddedEntities(java.lang.String spaceKey,
                                                   int maxResults)
Deprecated. 
Description copied from interface: ContentEntityManager
Retrieve an iterator of recently added entities, in order of most recent to last. The iterator is lazy-loading, so you can filter the output and return the first 'n' that interest you. For performance reasons, it's a VERY bad idea to supply both a space key, and infinite results. If you supply a space key, this WILL NOT RETURN ANY COMMENTS. There is currently no way around this, you have to retrieve comments separately and splice the results together. Sorry.

Specified by:
getRecentlyAddedEntities in interface ContentEntityManager
Parameters:
spaceKey - the space key to look up the entities for. If spaceKey is null, there is assumed to be no space, and things like user info and space descriptions will also be returned.
maxResults - the maximum number of entities to return in the iterator. Any number zero or less (Use the ITERATE_ALL constant) will cause the iterator to go over every entity.

getRecentlyModifiedEntities

public java.util.Iterator getRecentlyModifiedEntities(java.lang.String spaceKey,
                                                      int maxResults)
Deprecated. 
Description copied from interface: ContentEntityManager
Retrieve an iterator of recently modified entities, in order of most recent to last. The iterator is lazy-loading, so you can filter the output and return the first 'n' that interest you. For performance reasons, it's a VERY bad idea to supply both a space key, and infinite results.

Specified by:
getRecentlyModifiedEntities in interface ContentEntityManager
Parameters:
spaceKey - the space key to look up the entities for.
maxResults - the maximum number of entities to return in the iterator. Any number zero or less (Use the ITERATE_ALL constant) will cause the iterator to go over every entity.

getRecentlyModifiedForChangeDigest

public java.util.List getRecentlyModifiedForChangeDigest(java.util.Date fromDate)
Deprecated. 
Description copied from interface: ContentEntityManager
Retrieves a list of ContentEntityObjects that have been newly added or modified since the date specified. This list excludes drafts, space descriptions and mail.

Specified by:
getRecentlyModifiedForChangeDigest in interface ContentEntityManager
Parameters:
fromDate - content modified after this date will be returned
Returns:
a list of ContentEntityObjects that have been newly added or modified since the date specified

getRecentlyModifiedEntitiesForUser

public java.util.Iterator getRecentlyModifiedEntitiesForUser(java.lang.String username)
Deprecated. 
Description copied from interface: ContentEntityManager
Retrieve an iterator of recently modified entities, in order of most recent to last. The iterator is lazy-loading, so you can filter the output and return the first 'n' that interest you.

Specified by:
getRecentlyModifiedEntitiesForUser in interface ContentEntityManager
Parameters:
username - the user for which to retrieve the modified content

getById

public ContentEntityObject getById(long id)
Deprecated. 
Specified by:
getById in interface ContentEntityManager
Returns:
the object with the corresponding id or null if the object with that id does not exist

updateContentLinkingTo

public void updateContentLinkingTo(SpaceContentEntityObject contentBeingRefactored,
                                   java.lang.String newSpaceKey,
                                   java.lang.String newTitle)
Deprecated. 
Description copied from interface: ContentEntityManager
Loops through all the content that currently links to 'contentBeingChanged' and renames all the links.
This will skip any referring content that is the 'contentBeingChanged' (i.e. content links to itself).
If you only want to change the links of a specific content object, use the 'updateSingleContentLinkinTo' function.
This rename will be recorded in the content's history

Specified by:
updateContentLinkingTo in interface ContentEntityManager

updateOutgoingLinksInContent

public void updateOutgoingLinksInContent(SpaceContentEntityObject contentBeingRefactored,
                                         java.lang.String newSpaceKey)
Deprecated. 
Description copied from interface: ContentEntityManager
Update the links on the page itself. If links are local (refering to the current space), a spacekey has to be added to the link

Specified by:
updateOutgoingLinksInContent in interface ContentEntityManager

updateSingleContentLinkinTo

public void updateSingleContentLinkinTo(ContentEntityObject referringContent,
                                        SpaceContentEntityObject contentBeingRefactored,
                                        java.lang.String newSpaceKey,
                                        java.lang.String newTitle)
Deprecated. 
Description copied from interface: ContentEntityManager
Renames all links contained in the 'referringContent' that currently links to 'contentBeingRefactored'.
This rename will be recorded in the content's history

Specified by:
updateSingleContentLinkinTo in interface ContentEntityManager

updateSingleContentLinkinTo

public void updateSingleContentLinkinTo(ContentEntityObject referringContent,
                                        SpaceContentEntityObject contentBeingRefactored,
                                        java.lang.String newSpaceKey,
                                        java.lang.String newTitle,
                                        SaveContext saveContext)
Deprecated. 
Specified by:
updateSingleContentLinkinTo in interface ContentEntityManager

setEventManager

public void setEventManager(com.atlassian.event.EventManager eventManager)
Deprecated. 
Specified by:
setEventManager in interface ContentEntityManager

getPreviousVersion

public ContentEntityObject getPreviousVersion(ContentEntityObject ceo)
Deprecated. 
Specified by:
getPreviousVersion in interface ContentEntityManager

getNextVersion

public ContentEntityObject getNextVersion(ContentEntityObject ceo)
Deprecated. 
Specified by:
getNextVersion in interface ContentEntityManager

getOtherVersion

public ContentEntityObject getOtherVersion(ContentEntityObject ceo,
                                           int version)
Deprecated. 
Specified by:
getOtherVersion in interface ContentEntityManager

getVersionHistorySummaries

public java.util.List<VersionHistorySummary> getVersionHistorySummaries(ContentEntityObject ceo)
Deprecated. 
Description copied from interface: ContentEntityManager
Get a VersionHistorySummary for all previous versions of a ContentEntityObject, starting with the current content.

Specified by:
getVersionHistorySummaries in interface ContentEntityManager
Parameters:
ceo - the entity object to return the version history of
Returns:
the full version history of that object, as VersionHistorySummary objects.

getMailById

public Mail getMailById(long id)
Deprecated. 
Description copied from interface: MailContentManager
Get a mail by its database id. If the mail does not exist, null is returned.

Specified by:
getMailById in interface MailContentManager

getMailByMessageId

public Mail getMailByMessageId(java.lang.String messageId)
Deprecated. 
Description copied from interface: MailContentManager
Get a mail by its message-id. If the mail does not exist, or if there are multiple mails with the same message id, null is returned

Specified by:
getMailByMessageId in interface MailContentManager

getMailsByMessageId

public java.util.List getMailsByMessageId(java.lang.String messageId)
Deprecated. 
Description copied from interface: MailContentManager
Get all mails with the matching message-id. Mostly you won't need to use this, as you'll generally be looking for a single message, message ids are reasonably unique, and the single-mail method is less code.

Specified by:
getMailsByMessageId in interface MailContentManager
Parameters:
messageId - the message id of the mails to retrieve
Returns:
a list of all messages matching that ID

storeIncomingMail

public Mail storeIncomingMail(Space space,
                              javax.mail.internet.MimeMessage mimeMessage)
Deprecated. 
Description copied from interface: MailContentManager
Create a new mail content object in the given space for the given mimeMessage. The message should be in the raw form it was received in. All post-arrival munging such as filter application, multipart content decisions and attachment removal happen inside this method

Specified by:
storeIncomingMail in interface MailContentManager
Parameters:
space - the space to attach the message to
mimeMessage - the message that has been received

storeIncomingMail

public Mail storeIncomingMail(Space space,
                              byte[] rawMessage)
Deprecated. 
Description copied from interface: MailContentManager
Create a new mail content object in the given space for the given raw RFC822 message. The message should be in the raw form it was received in. All post-arrival munging such as filter application, multipart content decisions and attachment removal happen inside this method

We use a byte array because RFC822 messages are streams of bytes - character encoding happens after the header is parsed

Specified by:
storeIncomingMail in interface MailContentManager
Parameters:
space - the space to attach the message to
rawMessage - the message that has been received

removeMail

public void removeMail(Mail mail)
Deprecated. 
Description copied from interface: MailContentManager
removes mail and its associated attachments

Specified by:
removeMail in interface MailContentManager
Parameters:
mail - the mail to remove

removeAttachmentsForMail

public void removeAttachmentsForMail(Mail mail)
Deprecated. 
Specified by:
removeAttachmentsForMail in interface MailContentManager

getSpaceMailIterator

public java.util.Iterator getSpaceMailIterator(java.lang.String spaceKey)
Deprecated. 
Specified by:
getSpaceMailIterator in interface MailContentManager

getSpaceMailWithAttachmentsIterator

public java.util.Iterator getSpaceMailWithAttachmentsIterator(java.lang.String spaceKey)
Deprecated. 
Specified by:
getSpaceMailWithAttachmentsIterator in interface MailContentManager

getSpaceMail

public java.util.List getSpaceMail(int firstResult,
                                   int maxResults,
                                   java.lang.String spaceKey)
Deprecated. 
Specified by:
getSpaceMail in interface MailContentManager

findMailTotal

public int findMailTotal(Space space)
Deprecated. 
Specified by:
findMailTotal in interface MailContentManager

getMail

public java.util.List<Mail> getMail(Space space,
                                    boolean currentOnly)
Deprecated. 
Specified by:
getMail in interface MailContentManager

spaceHasMail

public boolean spaceHasMail(java.lang.String spaceKey)
Deprecated. 
Specified by:
spaceHasMail in interface MailContentManager

getFirstMailAfter

public Mail getFirstMailAfter(java.lang.String spaceKey,
                              long mailId)
Deprecated. 
Specified by:
getFirstMailAfter in interface MailContentManager

getFirstMailBefore

public Mail getFirstMailBefore(java.lang.String spaceKey,
                               long mailId)
Deprecated. 
Specified by:
getFirstMailBefore in interface MailContentManager

removeAllMail

public void removeAllMail(Space space)
Deprecated. 
Specified by:
removeAllMail in interface MailContentManager

removeHistoricalVersion

public void removeHistoricalVersion(ContentEntityObject historicalVersion)
Deprecated. 
Description copied from interface: ContentEntityManager
Removes a historical ContentEntityObject.

Specified by:
removeHistoricalVersion in interface ContentEntityManager
Parameters:
historicalVersion - a historical entity object to remove


Copyright © 2003-2014 Atlassian. All Rights Reserved.