Package totalcross.net.mail
Class Store
- java.lang.Object
-
- totalcross.net.mail.Store
-
- Direct Known Subclasses:
POP3Store
public abstract class Store extends java.lang.ObjectAn abstract class that models a message store and its access protocol, for storing and retrieving messages. Subclasses provide actual implementations.- Since:
- TotalCross 1.13
-
-
Field Summary
Fields Modifier and Type Field Description protected Socketconnectionprotected MailSessionsessionprotected SocketFactorysocketFactory
-
Constructor Summary
Constructors Modifier Constructor Description protectedStore(MailSession session)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidclose()Close this store and terminate its connection.abstract voidconnect()A generic connect method that takes no parameters.abstract FoldergetDefaultFolder()Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.abstract FoldergetFolder(java.lang.String name)Return the Folder object corresponding to the given name.
-
-
-
Field Detail
-
session
protected MailSession session
-
socketFactory
protected SocketFactory socketFactory
-
connection
protected Socket connection
-
-
Constructor Detail
-
Store
protected Store(MailSession session)
-
-
Method Detail
-
connect
public abstract void connect() throws AuthenticationException, MessagingExceptionA generic connect method that takes no parameters. Subclasses can implement the appropriate authentication schemes. Subclasses that need additional information might want to use some properties or might get it interactively. Most clients should just call this method to connect to the store.- Throws:
AuthenticationExceptionMessagingException- Since:
- TotalCross 1.13
-
close
public abstract void close() throws MessagingExceptionClose this store and terminate its connection. Any Messaging components (Folders, Messages, etc.) belonging to this service are invalid after this store is closed. Note that the store is closed even if this method terminates abnormally by throwing a MessagingException.- Throws:
MessagingException- Since:
- TotalCross 1.13
-
getFolder
public abstract Folder getFolder(java.lang.String name)
Return the Folder object corresponding to the given name. Folder objects are not cached by the Store, so invoking this method on the same name multiple times will return that many distinct Folder objects.- Parameters:
name- The name of the Folder. In some Stores, name can be an absolute path if it starts with the hierarchy delimiter. Else it is interpreted relative to the 'root' of this namespace.- Returns:
- Folder object
- Since:
- TotalCross 1.13
-
getDefaultFolder
public abstract Folder getDefaultFolder()
Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.- Returns:
- the root Folder
- Since:
- TotalCross 1.13
-
-