Package com.atlassian.jira.timezone
Class TimeZoneServiceImpl
java.lang.Object
com.atlassian.jira.timezone.TimeZoneServiceImpl
- All Implemented Interfaces:
TimeZoneResolver,TimeZoneService
- Since:
- v4.4
-
Field Summary
Fields inherited from interface com.atlassian.jira.timezone.TimeZoneService
JIRA, SYSTEM -
Constructor Summary
ConstructorsConstructorDescriptionTimeZoneServiceImpl(ApplicationProperties applicationProperties, PermissionManager permissionManager, UserPreferencesManager userPreferencesManager) TimeZoneServiceImpl(ApplicationProperties applicationProperties, PermissionManager permissionManager, UserPreferencesManager userPreferencesManager, com.atlassian.jira.timezone.TimeZoneIdsProvider timeZoneIdsProvider) -
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.getDefaultTimeZone(JiraServiceContext serviceContext) Returns 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.protected TimeZonegetJVMTimeZoneInfo(JiraServiceContext serviceContext) Returns the time zone of the JVMgetTimeZoneInfos(JiraServiceContext serviceContext) Retrieves all time zones.getTimeZoneRegions(JiraServiceContext serviceContext) Returns all time zone regions.getUserTimeZone(JiraServiceContext serviceContext) Returns a user's effective time zone.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
-
TimeZoneServiceImpl
public TimeZoneServiceImpl(ApplicationProperties applicationProperties, PermissionManager permissionManager, UserPreferencesManager userPreferencesManager) -
TimeZoneServiceImpl
public TimeZoneServiceImpl(ApplicationProperties applicationProperties, PermissionManager permissionManager, UserPreferencesManager userPreferencesManager, com.atlassian.jira.timezone.TimeZoneIdsProvider timeZoneIdsProvider)
-
-
Method Details
-
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
-
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.
-
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
-
getCanonicalIds
-
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
-
getJVMTimeZone
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
getDefaultTimeZone
Description copied from interface:TimeZoneResolverReturns the JIRA default time zone.- Specified by:
getDefaultTimeZonein interfaceTimeZoneResolver- Parameters:
serviceContext- a JiraServiceContext- Returns:
- a TimeZone
- See Also:
-
getUserTimeZone
Description copied from interface:TimeZoneResolverReturns a user's effective time zone.- Specified by:
getUserTimeZonein interfaceTimeZoneResolver- Parameters:
serviceContext- a JiraServiceContext- Returns:
- a TimeZone
- See Also:
-