Package overit.geocall.mail
Class MailBox
java.lang.Object
overit.geocall.mail.MailBox
Class that manages the mailbox with its protocols, host, port etc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Authenticatorprotected Integerprotected intprotected booleanprotected booleanprotected FetchLoggerprotected Folderprotected Stringprotected booleanprotected Stringprotected Message[]protected Stringprotected Integerprotected Stringprotected Stringprotected Storeprotected intprotected Integerprotected booleanprotected LinkedListSe nullo significa che ?static final intstatic final intstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the foldervoidcommit()Commit the messagesFetch the messageprotected voidfinalize()booleanReturns if the full client parsing is abilitatedReturns the protocolgetSsl()Returns the sslbooleangetTls()Returns if tls is abilitated or notgetUID()Returns the UIDstatic voidReturns the next messagevoidrollback()Roll back the commit of the messagesvoidsetAutoCommit(boolean autocommit) Sets autocommit capabilityvoidsetFetchLogger(String name, FetchLogger fl) Sets the fetch loggerfinal voidsetProtocol(String protocol) Sets the protocol
-
Field Details
-
TYPE_IMAP
- See Also:
-
TYPE_IMAPS
- See Also:
-
TYPE_POP
- See Also:
-
TYPE_POP3S
- See Also:
-
_technique
protected int _technique -
_protocol
-
_host
-
_port
-
_timeout
-
_cacheTime
-
_fullClientParsing
protected boolean _fullClientParsing -
_folderName
-
_a
-
_store
-
_folder
-
_messages
-
_cursor
protected int _cursor -
_fl
-
_name
-
_debug
protected boolean _debug -
_tls
protected boolean _tls -
_ssl
-
_toCommit
Se nullo significa che ? automommittante, altrimenti contiene la lista degli indici dei messaggi da committare; -
FETCH_AND_REMOVE
public static final int FETCH_AND_REMOVE- See Also:
-
FETCH_AND_READ
public static final int FETCH_AND_READ- See Also:
-
FETCH_AND_NOTHING
public static final int FETCH_AND_NOTHING- See Also:
-
-
Constructor Details
-
MailBox
public MailBox(String protocol, String host, String folderName, Authenticator a, int technique) throws EmailException Constructor for MailBox- Parameters:
protocol- The protocolhost- The hostfolderName- The folder namea- TheAuthenticatortechnique- The technique used- Throws:
EmailException- If an error occurs
-
MailBox
public MailBox(String protocol, String host, Integer port, String folderName, Authenticator a, int technique) throws EmailException Constructor for MailBox- Parameters:
protocol- The protocolhost- The hostport- The portfolderName- The folder namea- TheAuthenticatortechnique- The technique used- Throws:
EmailException- If an error occurs
-
-
Method Details
-
setFetchLogger
Sets the fetch logger- Parameters:
name- String containing the namefl- TheFetchLoggerto set
-
getTls
public boolean getTls()Returns if tls is abilitated or not- Returns:
trueif tls is abilitated,falseotherwise
-
getSsl
Returns the ssl- Returns:
- String containing the ssl
-
setProtocol
Sets the protocol- Parameters:
protocol- The protocol
-
getProtocol
Returns the protocol- Returns:
- String containing the protocol
-
setAutoCommit
Sets autocommit capability- Parameters:
autocommit- Boolean value for autocommit- Throws:
EmailException- If an exception occurs sending the email
-
getFullClientParsing
public boolean getFullClientParsing()Returns if the full client parsing is abilitated- Returns:
trueif the full client parsing is abilitated,falseotherwise
-
nextMessage
Returns the next message- Returns:
- The next message
- Throws:
EmailException- if an error occurs
-
fetchMessage
Fetch the message- Returns:
- The
Message - Throws:
EmailException- If an error occurs
-
commit
Commit the messages- Throws:
EmailException- if an error occurs
-
rollback
Roll back the commit of the messages- Throws:
EmailException- if an error occurs
-
getUID
Returns the UID- Returns:
- The UID
-
close
public void close()Close the folder -
finalize
-
main
- Throws:
Exception
-