com.google.appengine.api.mail.dev
Class LocalMailService
- java.lang.Object
-
- AbstractLocalRpcService
-
- com.google.appengine.api.mail.dev.LocalMailService
-
public final class LocalMailService extends AbstractLocalRpcServiceStub implementation of the Google App Engine mail api. This implementation logs messages using aLoggerassociated with this class and keeps messages that were sent in memory. If you want to access the list of sent messages you can get ahold of the registered LocalMailService instance as follows:
You can then access the list viaApiProxyLocal proxy = (ApiProxyLocal) ApiProxy.getDelegate(); LocalMailService mailService = (LocalMailService)delegate.getService(LocalMailService.PACKAGE);getSentMessages()and clear the list viaclearSentMessages(). By default, messages are logged atLevel.INFOand the body of the message is excluded. The log level and whether or not the body of the message is logged can be configured. SeeLOG_MAIL_BODY_PROPERTYandLOG_MAIL_LEVEL_PROPERTYfor more information.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringLOG_MAIL_BODY_PROPERTYInit property that determines whether or not we log the body of the email.static java.lang.StringLOG_MAIL_LEVEL_PROPERTYInit property that specifies theLevelat which we log mail messages.static java.lang.StringPACKAGEThe package name for this service.
-
Constructor Summary
Constructors Constructor and Description LocalMailService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclearSentMessages()Clear the list of sent messages.java.lang.IntegergetMaxApiRequestSize()java.lang.StringgetPackage()java.util.List<MailServicePb.MailMessage>getSentMessages()voidinit(LocalServiceContext context, java.util.Map<java.lang.String,java.lang.String> properties)ApiBasePb.VoidProtosend(Status status, MailServicePb.MailMessage msg)ApiBasePb.VoidProtosendToAdmins(Status status, MailServicePb.MailMessage msg)voidstart()voidstop()
-
-
-
Field Detail
-
PACKAGE
public static final java.lang.String PACKAGE
The package name for this service.- See Also:
- Constant Field Values
-
LOG_MAIL_BODY_PROPERTY
public static final java.lang.String LOG_MAIL_BODY_PROPERTY
Init property that determines whether or not we log the body of the email. Value must be a string representation of eitherBoolean.TRUEorBoolean.FALSE.- See Also:
- Constant Field Values
-
LOG_MAIL_LEVEL_PROPERTY
public static final java.lang.String LOG_MAIL_LEVEL_PROPERTY
Init property that specifies theLevelat which we log mail messages. Value must be a string representation of aLevel(callingLevel.parse(String)with the value as the arg should return a valid instance).- See Also:
- Constant Field Values
-
-
Method Detail
-
getPackage
public java.lang.String getPackage()
-
init
public void init(LocalServiceContext context, java.util.Map<java.lang.String,java.lang.String> properties)
-
start
public void start()
-
stop
public void stop()
-
send
public ApiBasePb.VoidProto send(Status status, MailServicePb.MailMessage msg)
-
sendToAdmins
public ApiBasePb.VoidProto sendToAdmins(Status status, MailServicePb.MailMessage msg)
-
getSentMessages
public java.util.List<MailServicePb.MailMessage> getSentMessages()
- Returns:
- A list of all messages that have been sent.
-
clearSentMessages
public void clearSentMessages()
Clear the list of sent messages.
-
getMaxApiRequestSize
public java.lang.Integer getMaxApiRequestSize()
-
-