atg.service.util
Class CurrentDate

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.util.CurrentDate
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.io.Serializable, java.util.EventListener
Direct Known Subclasses:
SchedulableDate

public class CurrentDate
extends GenericService
implements java.io.Serializable

This is a nucleus component that returns aspects of the current date (such as the year, date, month, etc.). The date can also be set manually, in which case all of those fields are set from the specified date.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String[] MONTH_NAMES
           
static java.lang.String[] SHORT_MONTH_NAMES
           
static java.lang.String[] SHORT_WEEKDAY_NAMES
           
static java.lang.String[] WEEKDAY_NAMES
           
 
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
CurrentDate()
           
 
Method Summary
 int getDate()
          Returns the day of the month (1-31)
 java.util.Date getDateAsDate()
          Returns the day of the month as a java.util.Date
 int getDayOfWeek()
          Returns the day of the week (1-7)
 int getDayOfWeekInMonth()
          Returns which occurrence (1 - 5) of the weekday in the month.
 java.lang.String getDayOfWeekName()
          Returns the name of the day of the week ("Sunday", "Monday", etc.)
 java.lang.String getEpochTime()
          Returns the Epoch time value in String format.
 int getHour()
          Returns the hour of the day (0-23)
 java.util.Date getHourAsDate()
          Returns the hour of the day as a java.util.Date
 int getMinute()
          Returns the minute of the hour (0-59)
 java.util.Date getMinuteAsDate()
          Returns the minute of the hour as a java.util.Date
 int getMonth()
          Returns the month as an integer (1-12)
 java.lang.String getMonthName()
          Returns the name of the month ("January", "February", etc.)
 long getNextDate()
           
 long getNextHour()
           
 long getNextMinute()
           
 long getNextSecond()
           
 int getSecond()
          Returns the second of the minute (0-59)
 java.util.Date getSecondAsDate()
          Returns the second of the minute as a java.util.Date
 java.lang.String getShortDayOfWeekName()
          Returns the shortened name of the day of the week ("Sun", "Mon", etc.)
 java.lang.String getShortMonthName()
          Returns the shortened name of the month ("Jan", "Feb", etc.)
 long getTime()
          Returns the time in milliseconds
 java.util.Date getTimeAsDate()
          Returns the time in milliseconds as a java.util.Date.
 java.sql.Timestamp getTimeAsTimestamp()
          Returns the time in milliseconds as a java.sql.Timestamp.
 int getWeekOfMonth()
          Returns the week of the month (1-5).
 int getYear()
          Returns the date as an integer (e.g., 1998)
 boolean isMinimizeDateConstruction()
          Returns property MinimizeDateConstruction
 void setMinimizeDateConstruction(boolean pMinimizeDateConstruction)
          Sets property MinimizeDateConstruction
 void setTime(long pTime)
          Sets the properties to reflect the specified time.
 void setTimeAsDate(java.util.Date pDate)
          Sets the properties to reflect the specified date.
 
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 java.lang.String CLASS_VERSION

MONTH_NAMES

public static final java.lang.String[] MONTH_NAMES

SHORT_MONTH_NAMES

public static final java.lang.String[] SHORT_MONTH_NAMES

WEEKDAY_NAMES

public static final java.lang.String[] WEEKDAY_NAMES

SHORT_WEEKDAY_NAMES

public static final java.lang.String[] SHORT_WEEKDAY_NAMES
Constructor Detail

CurrentDate

public CurrentDate()
Method Detail

setMinimizeDateConstruction

public void setMinimizeDateConstruction(boolean pMinimizeDateConstruction)
Sets property MinimizeDateConstruction


isMinimizeDateConstruction

public boolean isMinimizeDateConstruction()
Returns property MinimizeDateConstruction


getNextDate

public long getNextDate()

getNextHour

public long getNextHour()

getNextMinute

public long getNextMinute()

getNextSecond

public long getNextSecond()

getTime

public long getTime()
Returns the time in milliseconds


setTime

public void setTime(long pTime)
Sets the properties to reflect the specified time. Once this is called, this will no longer track the current time.


getTimeAsDate

public java.util.Date getTimeAsDate()
Returns the time in milliseconds as a java.util.Date.


getTimeAsTimestamp

public java.sql.Timestamp getTimeAsTimestamp()
Returns the time in milliseconds as a java.sql.Timestamp.


setTimeAsDate

public void setTimeAsDate(java.util.Date pDate)
Sets the properties to reflect the specified date. Once this is called, this will no longer track the current time.


getYear

public int getYear()
Returns the date as an integer (e.g., 1998)


getMonth

public int getMonth()
Returns the month as an integer (1-12)


getMonthName

public java.lang.String getMonthName()
Returns the name of the month ("January", "February", etc.)


getShortMonthName

public java.lang.String getShortMonthName()
Returns the shortened name of the month ("Jan", "Feb", etc.)


getDate

public int getDate()
Returns the day of the month (1-31)


getDateAsDate

public java.util.Date getDateAsDate()
Returns the day of the month as a java.util.Date


getHour

public int getHour()
Returns the hour of the day (0-23)


getHourAsDate

public java.util.Date getHourAsDate()
Returns the hour of the day as a java.util.Date


getMinute

public int getMinute()
Returns the minute of the hour (0-59)


getMinuteAsDate

public java.util.Date getMinuteAsDate()
Returns the minute of the hour as a java.util.Date


getSecond

public int getSecond()
Returns the second of the minute (0-59)


getSecondAsDate

public java.util.Date getSecondAsDate()
Returns the second of the minute as a java.util.Date


getDayOfWeek

public int getDayOfWeek()
Returns the day of the week (1-7)


getDayOfWeekName

public java.lang.String getDayOfWeekName()
Returns the name of the day of the week ("Sunday", "Monday", etc.)


getShortDayOfWeekName

public java.lang.String getShortDayOfWeekName()
Returns the shortened name of the day of the week ("Sun", "Mon", etc.)


getDayOfWeekInMonth

public int getDayOfWeekInMonth()
Returns which occurrence (1 - 5) of the weekday in the month. For example, the second Wednesday returns 2.


getWeekOfMonth

public int getWeekOfMonth()
Returns the week of the month (1-5).


getEpochTime

public java.lang.String getEpochTime()
Returns the Epoch time value in String format. The time value is divided by 1000 in order to get the Epoch (seconds) time value, which is compatible with Search's date format.

Returns:
the time value in String format