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.Default
Nested classes/interfaces inherited from interface org.jgrapes.core.Subchannel
Subchannel.DefaultSubchannel
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMonitorChannel
(OpenMailMonitor event, Channel mainChannel, Store store, String user, Password password) Instantiates a new monitor channel. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the connection to the store.void
closed
(ConnectionEvent event) Callback that indicates the connection close, can be called any time by jakarta mail.void
disconnected
(ConnectionEvent event) According to the documentation,ConnectionEvent.DISCONNECTED
is currently not used.void
notification
(StoreEvent event) void
onUpdateFolders
(UpdateMailFolders event) Retrieve the new messages from the folders specified in the event.void
opened
(ConnectionEvent event) Callback from store.connect is the connection is successful.Methods inherited from class org.jgrapes.mail.MailConnectionManager.AbstractMailChannel
openEvent
Methods inherited from class org.jgrapes.io.util.ConnectionManager.Connection
downPipeline
Methods inherited from class org.jgrapes.core.Subchannel.DefaultSubchannel
associated, mainChannel, setAssociated, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associated, associatedGet, setAssociated
Methods 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:
close
in classConnectionManager<MailMonitor.MonitorChannel>.Connection
-
opened
Callback from store.connect is the connection is successful.- Specified by:
opened
in interfaceConnectionListener
- Parameters:
event
- the event
-
disconnected
According to the documentation,ConnectionEvent.DISCONNECTED
is currently not used.It’s implemented nevertheless and called explicitly.
- Specified by:
disconnected
in interfaceConnectionListener
- Parameters:
event
- the event ornull
if 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:
closed
in interfaceConnectionListener
- Parameters:
event
- the event
-
notification
- Specified by:
notification
in interfaceStoreListener
-
onUpdateFolders
Retrieve the new messages from the folders specified in the event.- Parameters:
event
-
-