com.caucho.hemp.services
Class BamMailService

java.lang.Object
  extended by com.caucho.bam.AbstractBamService
      extended by com.caucho.bam.SimpleBamService
          extended by com.caucho.hemp.services.BamMailService
All Implemented Interfaces:
BamService, BamStream, AlarmListener, java.util.EventListener

public class BamMailService
extends SimpleBamService
implements AlarmListener

mail service


Constructor Summary
BamMailService()
           
 
Method Summary
 void addTo(java.lang.String to)
          Adds a 'to'
 void close()
           
 void handleAlarm(Alarm alarm)
          Handles a callback from an alarm.
 void init()
           
 void message(java.lang.String to, java.lang.String from, java.io.Serializable value)
          Sends to a mailbox
protected  java.lang.String messageToText(java.io.Serializable value)
           
 void setDelayTime(Period period)
          Sets the delay time, i.e.
 void setMailSession(Session session)
          Sets the mail session
 void setProperties(java.util.Properties props)
          Sets properties
 void setProperty(java.lang.String key, java.lang.String value)
          Sets a property
 void setSubject(java.lang.String subject)
          Sets subject
 
Methods inherited from class com.caucho.bam.SimpleBamService
getAgentStream, getBamSkeleton, getBrokerStream, messageError, presence, presenceError, presenceProbe, presenceSubscribe, presenceSubscribed, presenceUnavailable, presenceUnsubscribe, presenceUnsubscribed, queryError, queryGet, queryResult, querySet, setBrokerStream
 
Methods inherited from class com.caucho.bam.AbstractBamService
getAgentFilter, getBrokerFilter, getJid, logData, logValue, onAgentStart, onAgentStop, setJid, startAgent, stopAgent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.bam.BamStream
getJid
 

Constructor Detail

BamMailService

public BamMailService()
Method Detail

setDelayTime

public void setDelayTime(Period period)
Sets the delay time, i.e. how long the service should accumulate messages before sending them.


setMailSession

public void setMailSession(Session session)
Sets the mail session


setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Sets a property


setProperties

public void setProperties(java.util.Properties props)
Sets properties


setSubject

public void setSubject(java.lang.String subject)
Sets subject


addTo

public void addTo(java.lang.String to)
           throws AddressException
Adds a 'to'

Throws:
AddressException

init

public void init()

message

public void message(java.lang.String to,
                    java.lang.String from,
                    java.io.Serializable value)
Sends to a mailbox

Specified by:
message in interface BamStream
Overrides:
message in class SimpleBamService
Parameters:
to - the target JID
from - the source JID
value - the message payload

messageToText

protected java.lang.String messageToText(java.io.Serializable value)

handleAlarm

public void handleAlarm(Alarm alarm)
Description copied from interface: AlarmListener
Handles a callback from an alarm.

Specified by:
handleAlarm in interface AlarmListener

close

public void close()