Package com.atlassian.jira.timezone
Class TimeZoneServiceCachingDecorator
java.lang.Object
com.atlassian.jira.timezone.TimeZoneServiceCachingDecorator
- All Implemented Interfaces:
TimeZoneService
Caches user time zones on a per-request basis.
- Since:
- v4.4
-
Field Summary
Fields inherited from interface com.atlassian.jira.timezone.TimeZoneService
JIRA, SYSTEM -
Constructor Summary
ConstructorsConstructorDescriptionTimeZoneServiceCachingDecorator(TimeZoneService timeZoneService) Creates a new TimeZoneServiceCachingDecorator. -
Method Summary
Modifier and TypeMethodDescriptionvoidclearDefaultTimeZone(JiraServiceContext serviceContext) Reset the default time zone to the JVM time zone.voidclearUserDefaultTimeZone(JiraServiceContext serviceContext) Resets the time zone for this user to the JIRA default time zone.getDefaultTimeZoneInfo(JiraServiceContext serviceContext) Returns the default time zone which is globally configured.Return the region key of the current default time zone.getJVMTimeZoneInfo(JiraServiceContext serviceContext) Returns the time zone of the JVMgetTimeZoneInfos(JiraServiceContext serviceContext) Retrieves all time zones.getTimeZoneRegions(JiraServiceContext serviceContext) Returns all time zone regions.getUserTimeZoneInfo(JiraServiceContext serviceContext) Return the time zone for this user.voidsetDefaultTimeZone(String timeZoneId, JiraServiceContext serviceContext) Allows to set the default time zone.voidsetUserDefaultTimeZone(String timeZoneId, JiraServiceContext serviceContext) Sets the default time zone for this user.booleanusesJiraTimeZone(JiraServiceContext serviceContext) Returns true if this user is using the JIRA default time zone or false if the user has is using a custom time zone.booleanReturns true if the JVM time zone is used, otherwise false.
-
Constructor Details
-
TimeZoneServiceCachingDecorator
Creates a new TimeZoneServiceCachingDecorator.- Parameters:
timeZoneService- a TimeZoneService
-
-
Method Details
-
setUserDefaultTimeZone
Description copied from interface:TimeZoneServiceSets the default time zone for this user.- Specified by:
setUserDefaultTimeZonein interfaceTimeZoneService- Parameters:
timeZoneId- the time zone idserviceContext- JIRA Service Context containing the user.
-
clearUserDefaultTimeZone
Description copied from interface:TimeZoneServiceResets the time zone for this user to the JIRA default time zone.- Specified by:
clearUserDefaultTimeZonein interfaceTimeZoneService- Parameters:
serviceContext- JIRA Service Context containing the user.
-
setDefaultTimeZone
Description copied from interface:TimeZoneServiceAllows to set the default time zone. The user requires the JIRA administrator permission to perform this operation. Only time zones with IDs returned by getTimeZoneInfos() are supported.- Specified by:
setDefaultTimeZonein interfaceTimeZoneService- Parameters:
timeZoneId- the id of the time zone.serviceContext- JIRA Service Context containing the user that changing the default time zone.
-
clearDefaultTimeZone
Description copied from interface:TimeZoneServiceReset the default time zone to the JVM time zone.- Specified by:
clearDefaultTimeZonein interfaceTimeZoneService- Parameters:
serviceContext- JIRA Service Context containing the user that changing the default time zone.
-
getUserTimeZoneInfo
Description copied from interface:TimeZoneServiceReturn the time zone for this user. This can either be a time zone which the user has defined in its preferences or the JIRA default time zone. NB: If the user is null JIRA's default time zone is returned.- Specified by:
getUserTimeZoneInfoin interfaceTimeZoneService- Parameters:
serviceContext- JIRA Service Context containing the user.- Returns:
- the TimeZone for this user.
-
getJVMTimeZoneInfo
Description copied from interface:TimeZoneServiceReturns the time zone of the JVM- Specified by:
getJVMTimeZoneInfoin interfaceTimeZoneService- Parameters:
serviceContext- JIRA Service Context containing the user that is retrieving the time zone information.- Returns:
- the time zone of the JVM
-
getDefaultTimeZoneInfo
Description copied from interface:TimeZoneServiceReturns the default time zone which is globally configured. This can either be the JVM time zone or a time zone configured by the administrator.- Specified by:
getDefaultTimeZoneInfoin interfaceTimeZoneService- Parameters:
serviceContext- JIRA Service Context containing the user that is retrieving the time zone information.- Returns:
- Returns the default time zone
-
getTimeZoneRegions
Description copied from interface:TimeZoneServiceReturns all time zone regions. Timezones are grouped by region, so it is more convenient for the user to find the correct time zone. Regions have a key and an i18n display name.- Specified by:
getTimeZoneRegionsin interfaceTimeZoneService- Parameters:
serviceContext- JIRA Service Context containing the user that is retrieving the time zone information.- Returns:
- Returns all time zone regions.
-
getTimeZoneInfos
Description copied from interface:TimeZoneServiceRetrieves all time zones. Returns only a subset of the time zones which are provided by the JVM. This cannonical list of time zones can be found here: See http://joda-time.sourceforge.net/time zones.html- Specified by:
getTimeZoneInfosin interfaceTimeZoneService- Parameters:
serviceContext- JIRA Service Context containing the user that is retrieving the time zone information.- Returns:
- all supported time zones
-
getDefaultTimeZoneRegionKey
Description copied from interface:TimeZoneServiceReturn the region key of the current default time zone. If the region key is SYSTEM, it indicates it is using the JVM time zone.- Specified by:
getDefaultTimeZoneRegionKeyin interfaceTimeZoneService- Returns:
- region key.
-
useSystemTimeZone
public boolean useSystemTimeZone()Description copied from interface:TimeZoneServiceReturns true if the JVM time zone is used, otherwise false.- Specified by:
useSystemTimeZonein interfaceTimeZoneService- Returns:
- true if the JVM time zone is used.
-
usesJiraTimeZone
Description copied from interface:TimeZoneServiceReturns true if this user is using the JIRA default time zone or false if the user has is using a custom time zone.- Specified by:
usesJiraTimeZonein interfaceTimeZoneService- Parameters:
serviceContext-- Returns:
- true if this user is using the JIRA default time zone or false if the user has is using a custom time zone.
-