Package jadex.platform.service.email
Class EmailAgent
- java.lang.Object
-
- jadex.platform.service.email.EmailAgent
-
- All Implemented Interfaces:
IEmailService
public class EmailAgent extends java.lang.Object implements IEmailService
The email agent can be used to send emails and subscribe for incoming mails.
-
-
Field Summary
Fields Modifier and Type Field Description protected EmailAccount
account
The email account.protected IInternalAccess
agent
The component.protected long
checkformail
The delay between checking for mail.protected static java.lang.String
DEFAULT_SSL_VERSION
Default SSL versions.protected IntervalBehavior<java.lang.Void>
receive
The receive behavior.protected java.util.Map<SubscriptionIntermediateFuture<Email>,SubscriptionInfo>
subscriptions
The subscriptions (subscription future -> subscription info).
-
Constructor Summary
Constructors Constructor Description EmailAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addSubscription(SubscriptionIntermediateFuture<Email> future, SubscriptionInfo si)
Add a new subscription.protected void
checkForNewMails()
Check for new emails and notify the corresponding subscribers.IntervalBehavior<java.lang.Void>
getReceiveBehavior(long delay)
Get (or create, or renew) the receive behavior.protected void
removeSubscription(SubscriptionIntermediateFuture<Email> fut)
Remove an existing subscription.IFuture<java.lang.Void>
sendEmail(Email email, EmailAccount acc)
Send an email.IFuture<java.lang.Void>
shutdown()
Called when service is shudowned.IFuture<java.lang.Void>
start()
Called on agent start.ISubscriptionIntermediateFuture<Email>
subscribeForEmail(IFilter<Email> filter, EmailAccount acc)
Subscribe for email.ISubscriptionIntermediateFuture<Email>
subscribeForEmail(IFilter<Email> filter, EmailAccount acc, boolean fullconv)
Subscribe for email.
-
-
-
Field Detail
-
DEFAULT_SSL_VERSION
protected static final java.lang.String DEFAULT_SSL_VERSION
Default SSL versions.
-
agent
protected IInternalAccess agent
The component.
-
checkformail
protected long checkformail
The delay between checking for mail.
-
account
protected EmailAccount account
The email account.
-
receive
protected IntervalBehavior<java.lang.Void> receive
The receive behavior.
-
subscriptions
protected java.util.Map<SubscriptionIntermediateFuture<Email>,SubscriptionInfo> subscriptions
The subscriptions (subscription future -> subscription info).
-
-
Method Detail
-
start
public IFuture<java.lang.Void> start()
Called on agent start.
-
shutdown
public IFuture<java.lang.Void> shutdown()
Called when service is shudowned.
-
sendEmail
public IFuture<java.lang.Void> sendEmail(Email email, EmailAccount acc)
Send an email.- Specified by:
sendEmail
in interfaceIEmailService
- Parameters:
email
- The email.account
- The email account.
-
subscribeForEmail
public ISubscriptionIntermediateFuture<Email> subscribeForEmail(IFilter<Email> filter, EmailAccount acc)
Subscribe for email.- Specified by:
subscribeForEmail
in interfaceIEmailService
- Parameters:
filter
- The filter.account
- The email account.
-
subscribeForEmail
public ISubscriptionIntermediateFuture<Email> subscribeForEmail(IFilter<Email> filter, EmailAccount acc, boolean fullconv)
Subscribe for email.- Specified by:
subscribeForEmail
in interfaceIEmailService
- Parameters:
filter
- The filter.account
- The email account.
-
addSubscription
protected void addSubscription(SubscriptionIntermediateFuture<Email> future, SubscriptionInfo si)
Add a new subscription.- Parameters:
future
- The subscription future.si
- The subscription info.
-
removeSubscription
protected void removeSubscription(SubscriptionIntermediateFuture<Email> fut)
Remove an existing subscription.- Parameters:
fut
- The subscription future to remove.
-
checkForNewMails
protected void checkForNewMails()
Check for new emails and notify the corresponding subscribers.
-
getReceiveBehavior
public IntervalBehavior<java.lang.Void> getReceiveBehavior(long delay)
Get (or create, or renew) the receive behavior.
-
-