public class EmailAgent
extends java.lang.Object
implements jadex.bridge.service.types.email.IEmailService
Modifier and Type | Field and Description |
---|---|
protected jadex.bridge.service.types.email.EmailAccount |
account
The email account.
|
protected jadex.bridge.IInternalAccess |
agent
The component.
|
protected long |
checkformail
The delay between checking for mail.
|
protected jadex.micro.IntervalBehavior<java.lang.Void> |
receive
The receive behavior.
|
protected java.util.Map<jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.email.Email>,SubscriptionInfo> |
subscriptions
The subscriptions (subscription future -> subscription info).
|
Constructor and Description |
---|
EmailAgent() |
Modifier and Type | Method and Description |
---|---|
protected void |
addSubscription(jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.email.Email> future,
SubscriptionInfo si)
Add a new subscription.
|
protected void |
checkForNewMails()
Check for new emails and notify the
corresponding subscribers.
|
jadex.micro.IntervalBehavior<java.lang.Void> |
getReceiveBehavior(long delay)
Get (or create, or renew) the receive behavior.
|
protected void |
removeSubscription(jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.email.Email> fut)
Remove an existing subscription.
|
jadex.commons.future.IFuture<java.lang.Void> |
sendEmail(jadex.bridge.service.types.email.Email email,
jadex.bridge.service.types.email.EmailAccount acc)
Send an email.
|
jadex.commons.future.IFuture<java.lang.Void> |
shutdown()
Called when service is shudowned.
|
jadex.commons.future.IFuture<java.lang.Void> |
start()
Called on agent start.
|
jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.email.Email> |
subscribeForEmail(jadex.commons.IFilter<jadex.bridge.service.types.email.Email> filter,
jadex.bridge.service.types.email.EmailAccount acc)
Subscribe for email.
|
jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.email.Email> |
subscribeForEmail(jadex.commons.IFilter<jadex.bridge.service.types.email.Email> filter,
jadex.bridge.service.types.email.EmailAccount acc,
boolean fullconv)
Subscribe for email.
|
protected jadex.bridge.IInternalAccess agent
protected long checkformail
protected jadex.bridge.service.types.email.EmailAccount account
protected jadex.micro.IntervalBehavior<java.lang.Void> receive
protected java.util.Map<jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.email.Email>,SubscriptionInfo> subscriptions
public jadex.commons.future.IFuture<java.lang.Void> start()
public jadex.commons.future.IFuture<java.lang.Void> shutdown()
public jadex.commons.future.IFuture<java.lang.Void> sendEmail(jadex.bridge.service.types.email.Email email, jadex.bridge.service.types.email.EmailAccount acc)
sendEmail
in interface jadex.bridge.service.types.email.IEmailService
email
- The email.account
- The email account.public jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.email.Email> subscribeForEmail(jadex.commons.IFilter<jadex.bridge.service.types.email.Email> filter, jadex.bridge.service.types.email.EmailAccount acc)
subscribeForEmail
in interface jadex.bridge.service.types.email.IEmailService
filter
- The filter.account
- The email account.public jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.email.Email> subscribeForEmail(jadex.commons.IFilter<jadex.bridge.service.types.email.Email> filter, jadex.bridge.service.types.email.EmailAccount acc, boolean fullconv)
subscribeForEmail
in interface jadex.bridge.service.types.email.IEmailService
filter
- The filter.account
- The email account.protected void addSubscription(jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.email.Email> future, SubscriptionInfo si)
future
- The subscription future.si
- The subscription info.protected void removeSubscription(jadex.commons.future.SubscriptionIntermediateFuture<jadex.bridge.service.types.email.Email> fut)
fut
- The subscription future to remove.protected void checkForNewMails()
public jadex.micro.IntervalBehavior<java.lang.Void> getReceiveBehavior(long delay)