atg.projects.store.email
Class RecentlySentList

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.projects.store.email.RecentlySentList
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class RecentlySentList
extends atg.nucleus.GenericService

This service holds the list of recently sent emails. Every entry contains type of email template, list of recipients, timestamp, and template meta parameters.


Nested Class Summary
 class RecentlySentList.SentItem
          SentItem object, which contains email type, map of email parameters and time of email creation
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String LOCALE
           
static java.lang.String SENT_DATE_FORMAT
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
RecentlySentList()
           
 
Method Summary
 boolean addItem(RecentlySentList.SentItem pItem)
          Adds new item to the list.
 void addItem(java.lang.String pType, java.util.Map pEmailParams, java.lang.String pTimestamp)
          Create and add new item based on given input parameters
 RecentlySentList.SentItem getItem(int pIndex)
          Return SentItem at the given index
 int getListSize()
          Returns list size
 java.util.List<RecentlySentList.SentItem> getSentList()
          Returns list of sent items
 java.lang.String getTemplateName(java.lang.String pTemplateUrl)
          Resolve template name for the given URL
 java.util.Map<java.lang.String,java.lang.String> getTemplateToTypeMap()
           
 java.util.Map<java.lang.String,java.lang.String> getTypeToMenuItemMap()
           
 boolean removeItem(RecentlySentList.SentItem pItem)
          Removes item from the list
 void setListSize(int pListSize)
          Sets new list size
 void setSentList(java.util.LinkedList<RecentlySentList.SentItem> pSentList)
          Sets new list for recently sent items
 void setTemplateToTypeMap(java.util.Map<java.lang.String,java.lang.String> pTemplateToTypeMap)
           
 void setTypeToMenuItemMap(java.util.Map<java.lang.String,java.lang.String> pTypeToMenuItemMap)
           
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

SENT_DATE_FORMAT

public static final java.lang.String SENT_DATE_FORMAT
See Also:
Constant Field Values

LOCALE

public static final java.lang.String LOCALE
See Also:
Constant Field Values
Constructor Detail

RecentlySentList

public RecentlySentList()
Method Detail

getListSize

public int getListSize()
Returns list size

Returns:
return size of the list

setListSize

public void setListSize(int pListSize)
Sets new list size

Parameters:
pListSize - new list size

getTemplateToTypeMap

public java.util.Map<java.lang.String,java.lang.String> getTemplateToTypeMap()
Returns:
the mTemplateToTypeMap

setTemplateToTypeMap

public void setTemplateToTypeMap(java.util.Map<java.lang.String,java.lang.String> pTemplateToTypeMap)
Parameters:
pTemplateToTypeMap - the templateToTypeMap to set

getTypeToMenuItemMap

public java.util.Map<java.lang.String,java.lang.String> getTypeToMenuItemMap()
Returns:
the mTypeToMenuItemMap

setTypeToMenuItemMap

public void setTypeToMenuItemMap(java.util.Map<java.lang.String,java.lang.String> pTypeToMenuItemMap)
Parameters:
pTypeToMenuItemMap - the typeToMenuItemMap to set

getSentList

public java.util.List<RecentlySentList.SentItem> getSentList()
Returns list of sent items

Returns:
list of sent items

setSentList

public void setSentList(java.util.LinkedList<RecentlySentList.SentItem> pSentList)
Sets new list for recently sent items

Parameters:
pSentList - new list

addItem

public boolean addItem(RecentlySentList.SentItem pItem)
Adds new item to the list. If size of the SentList is exceed ListSize then remove first item from the list and add new item at the end of the list.

Parameters:
pItem - new SentItem element
Returns:
true if element has been added

getItem

public RecentlySentList.SentItem getItem(int pIndex)
Return SentItem at the given index

Parameters:
pIndex - the index
Returns:
SentItem bean

addItem

public void addItem(java.lang.String pType,
                    java.util.Map pEmailParams,
                    java.lang.String pTimestamp)
Create and add new item based on given input parameters

Parameters:
pType - email type
pEmailParams - email parameters
pTimestamp - timestamp

removeItem

public boolean removeItem(RecentlySentList.SentItem pItem)
Removes item from the list

Parameters:
pItem - item to remove
Returns:
true if list contains the pItem

getTemplateName

public java.lang.String getTemplateName(java.lang.String pTemplateUrl)
Resolve template name for the given URL

Parameters:
pTemplateUrl - template url
Returns:
template name