Package org.jgrapes.mail
Class MailMonitor.MonitorChannel
- All Implemented Interfaces:
ConnectionListener,StoreListener,EventListener,Associator,Channel,Eligible,Subchannel,MailChannel
- Enclosing class:
MailMonitor
protected class MailMonitor.MonitorChannel
extends MailConnectionManager<MailMonitor.MonitorChannel,OpenMailMonitor>.AbstractMailChannel
implements ConnectionListener, StoreListener
The specific implementation of the
MailChannel.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.DefaultNested classes/interfaces inherited from interface org.jgrapes.core.Subchannel
Subchannel.DefaultSubchannel -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMonitorChannel(OpenMailMonitor event, Channel mainChannel, Store store, String user, Password password) Instantiates a new monitor channel. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the connection to the store.voidclosed(ConnectionEvent event) Callback that indicates the connection close, can be called any time by jakarta mail.voiddisconnected(ConnectionEvent event) According to the documentation,ConnectionEvent.DISCONNECTEDis currently not used.voidnotification(StoreEvent event) voidonUpdateFolders(UpdateMailFolders event) Retrieve the new messages from the folders specified in the event.voidopened(ConnectionEvent event) Callback from store.connect is the connection is successful.Methods inherited from class org.jgrapes.mail.MailConnectionManager.AbstractMailChannel
openEventMethods inherited from class org.jgrapes.io.util.ConnectionManager.Connection
downPipelineMethods inherited from class org.jgrapes.core.Subchannel.DefaultSubchannel
associated, mainChannel, setAssociated, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associated, associatedGet, setAssociatedMethods inherited from interface org.jgrapes.core.Subchannel
defaultCriterion, isEligibleFor, mainChannel
-
Constructor Details
-
MonitorChannel
public MonitorChannel(OpenMailMonitor event, Channel mainChannel, Store store, String user, Password password) Instantiates a new monitor channel.- Parameters:
event- the event that triggered the creationmainChannel- the main channel (of thisSubchannel)store- the storeuser- the userpassword- the password
-
-
Method Details
-
close
Close the connection to the store.- Overrides:
closein classConnectionManager<MailMonitor.MonitorChannel>.Connection
-
opened
Callback from store.connect is the connection is successful.- Specified by:
openedin interfaceConnectionListener- Parameters:
event- the event
-
disconnected
According to the documentation,ConnectionEvent.DISCONNECTEDis currently not used.It’s implemented nevertheless and called explicitly.
- Specified by:
disconnectedin interfaceConnectionListener- Parameters:
event- the event ornullif called explicitly
-
closed
Callback that indicates the connection close, can be called any time by jakarta mail.Whether closing is intended (callback after a call to
close()) can be checked by looking at the state.- Specified by:
closedin interfaceConnectionListener- Parameters:
event- the event
-
notification
- Specified by:
notificationin interfaceStoreListener
-
onUpdateFolders
Retrieve the new messages from the folders specified in the event.- Parameters:
event-
-