aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Is it possible to use IMAP + paging? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Is it possible to use IMAP + paging?" Watch "Is it possible to use IMAP + paging?" New topic
Author

Is it possible to use IMAP + paging?

salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 928

Hi,
I have a Requirement to make an IMAP client as a Web application

I achieved the functionality of Sorting as:



The code snippet is not complete , its just brief
SORT_SENT_DATE,SORT_TYPE_DESCENDING are my own constants.

Actually This solution is working fine, but it fails in logic for paging
Being a Web based application, i cant expect server to load all messages for every user and sort them
(We do have situations >1000 Simultaneous users with mail boxes having > 1000 messages each )

It also does not make sense for the web server to load all, sort them, return just a small part (say 1-20),
and on the next request, again load all sort them and return (21-40). Caching possible, but whts the gaurantee user would actually make a request ?

I heard there is a class called FetchProfile, can that help me here ? (I guess it would still load all messages but just the information thats required)
Is there any other way to achieve this ?

I need a solution that could also work in Search operation (searching with paging),
I have built an archietecture to create a SearchTerm but here too i would require paging.


My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 928

for ref, i have asked this same Question at http://stackoverflow.com/questions/1387999/is-it-possible-to-use-imap-paging
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19719
    
  20

I think you made a mistake with that cross post URL - it points to this thread.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 928

sorry, mistake rectified
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 928

From the information gathered from other sites,

it seems that i can use the FetchProfile to optimally fetch required content like envelope or content
in a batch like fashion and then sort them.

the server would then look at the page size and return only records matching a given page size only.

server would then discard rest of the messages, is there a better alternative for this ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to use IMAP + paging?