org.broadleafcommerce.common.time
Class SystemTime
java.lang.Object
org.broadleafcommerce.common.time.SystemTime
public class SystemTime
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SystemTime
public SystemTime()
getTimeSource
public static TimeSource getTimeSource()
setGlobalTimeSource
public static void setGlobalTimeSource(TimeSource globalTS)
resetGlobalTimeSource
public static void resetGlobalTimeSource()
setLocalTimeSource
public static void setLocalTimeSource(TimeSource localTS)
resetLocalTimeSource
public static void resetLocalTimeSource()
reset
public static void reset()
asMillis
public static long asMillis()
asMillis
public static long asMillis(boolean includeTime)
asDate
public static Date asDate()
asDate
public static Date asDate(boolean includeTime)
asCalendar
public static Calendar asCalendar()
asCalendar
public static Calendar asCalendar(boolean includeTime)
asCalendar
public static Calendar asCalendar(Locale locale)
asCalendar
public static Calendar asCalendar(TimeZone timeZone)
shouldCacheDate
public static boolean shouldCacheDate()
- Returns false if the current time source is a
FixedTimeSource indicating that the
time is being overridden. For example to preview items in a later time.
- Returns:
getCurrentDateWithinTimeResolution
public static Date getCurrentDateWithinTimeResolution(Date cachedDate,
Long dateResolutionMillis)
- Many DAO objects in Broadleaf use a cached time concept. Since most entities have an active
start and end date, the DAO may ask for a representation of "NOW" that is within some
threshold.
By default, most entities cache active-date queries to every 10 seconds. These DAO
classes can be overridden to extend or decrease this default.
- Returns:
asCalendar
public static Calendar asCalendar(Locale locale,
TimeZone timeZone,
boolean includeTime)
Copyright © 2013. All Rights Reserved.