public class IMAPMailBoxReader extends Object implements ResourceAwareRealTimeLineReader<javax.mail.Message>
Modifier and Type | Field and Description |
---|---|
protected String |
folderName |
protected javax.mail.Folder |
mailbox |
Constructor and Description |
---|
IMAPMailBoxReader() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Any cleanup
|
void |
dispose()
Un-initialize reader, so that it maybe re consumed
Except for the main Resource & configuration set by Spring context
all other instance variables used will be re-set/disposed/cleared. |
protected List<MessagePart<String,String>> |
getContentAsString(String type,
Object content)
Marshal content from an Email (IMAP) to a
MessagePart |
List<MessagePart<String,String>> |
getContentFromMail(javax.mail.Message mail) |
Long |
getCurrentIndex()
Depending on the resource the
ResourceAwareRealTimeLineReader.size() may factor in redundant rows also that maybe filtered by the reader if it uses some sort of filter. |
String |
getFolderName() |
String |
getHost() |
int |
getIndex() |
Properties |
getJavaMailProperties() |
javax.mail.Folder |
getMailbox() |
String |
getPassword() |
int |
getSize() |
String |
getSourceLocation() |
String |
getUsername() |
boolean |
hasNext()
True if there is another record that can be read by the parser, false implies end of parse/read
|
void |
init()
Allow lazy initialization of Reader in cases where the resource may not be known @
PostConstruct time |
boolean |
isInitialized()
Allow the calling API to determine if the reader has been initialized via
RealTimeLineReader.init() or PostConstruct phase
If not RealTimeLineReader.init() should be called upon the instance. |
javax.mail.Message |
next()
Read line from Source, on Record construction complete return the Record.
|
void |
setFolderName(String folderName) |
void |
setHost(String host) |
void |
setIndex(int index) |
void |
setJavaMailProperties(Properties javaMailProperties) |
void |
setMailbox(javax.mail.Folder mailbox) |
void |
setPassword(String password) |
void |
setUsername(String username) |
Long |
size()
Get number of tuples/records in resource
|
protected String folderName
protected transient javax.mail.Folder mailbox
protected List<MessagePart<String,String>> getContentAsString(String type, Object content) throws javax.mail.MessagingException, IOException
MessagePart
type
- as String (part details)content
- as String (raw content)MessagePart
javax.mail.MessagingException
IOException
public List<MessagePart<String,String>> getContentFromMail(javax.mail.Message mail) throws javax.mail.MessagingException, IOException
javax.mail.MessagingException
IOException
public javax.mail.Message next() throws javax.mail.MessagingException
RealTimeLineReader
next
in interface RealTimeLineReader<javax.mail.Message>
javax.mail.MessagingException
public boolean hasNext()
RealTimeLineReader
hasNext
in interface RealTimeLineReader<javax.mail.Message>
public void close() throws Exception
RealTimeLineReader
close
in interface RealTimeLineReader<javax.mail.Message>
Exception
public String getSourceLocation()
getSourceLocation
in interface RealTimeLineReader<javax.mail.Message>
public void init() throws Exception
RealTimeLineReader
PostConstruct
timeinit
in interface RealTimeLineReader<javax.mail.Message>
Exception
public boolean isInitialized() throws Exception
RealTimeLineReader
RealTimeLineReader.init()
or PostConstruct
phase
RealTimeLineReader.init()
should be called upon the instance.isInitialized
in interface RealTimeLineReader<javax.mail.Message>
Exception
public void dispose() throws Exception
RealTimeLineReader
Resource
& configuration set by Spring context
all other instance variables used will be re-set/disposed/cleared.dispose
in interface RealTimeLineReader<javax.mail.Message>
Exception
public Long size()
ResourceAwareRealTimeLineReader
size
in interface ResourceAwareRealTimeLineReader<javax.mail.Message>
public Long getCurrentIndex()
ResourceAwareRealTimeLineReader
ResourceAwareRealTimeLineReader.size()
may factor in redundant rows also that maybe filtered by the reader if it uses some sort of filter.
getCurrentIndex
in interface ResourceAwareRealTimeLineReader<javax.mail.Message>
public String getHost()
public void setHost(String host)
public String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public String getFolderName()
public void setFolderName(String folderName)
public javax.mail.Folder getMailbox()
public void setMailbox(javax.mail.Folder mailbox)
public int getIndex()
public void setIndex(int index)
public int getSize()
public Properties getJavaMailProperties()
public void setJavaMailProperties(Properties javaMailProperties)
Copyright © 2018. All rights reserved.