org.kuali.hr.time.timezone.service
Class TimezoneServiceImpl

java.lang.Object
  extended by org.kuali.hr.time.timezone.service.TimezoneServiceImpl
All Implemented Interfaces:
TimezoneService

public class TimezoneServiceImpl
extends Object
implements TimezoneService


Constructor Summary
TimezoneServiceImpl()
           
 
Method Summary
 long getTimezoneOffsetFromServerTime(org.joda.time.DateTimeZone dtz)
           
 String getUserTimezone()
          Used to determine if an override condition exists for a user timezone
 String getUserTimezone(String principalId)
          (this call may be cached) Fetch the users timezone, Data on: Principal Calendar > Job/Location > System Default
 org.joda.time.DateTimeZone getUserTimezoneWithFallback()
          Returns the DateTimeZone object for the current user OR the system default timezone if there is no current user / a time zone is missing.
 boolean isSameTimezone()
          Determine if Timezone is same as server timezone
 void translateForTimezone(List<TimeBlock> timeBlocks)
           
 List<TimeBlock> translateForTimezone(List<TimeBlock> timeBlocks, String timezone)
          Translation needed for UI Display
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimezoneServiceImpl

public TimezoneServiceImpl()
Method Detail

getUserTimezone

public String getUserTimezone(String principalId)
Description copied from interface: TimezoneService
(this call may be cached) Fetch the users timezone, Data on: Principal Calendar > Job/Location > System Default

Specified by:
getUserTimezone in interface TimezoneService
Parameters:
principalId - The principal you are looking for.
Returns:
String timezone, see: http://joda-time.sourceforge.net/timezones.html

getUserTimezone

public String getUserTimezone()
Used to determine if an override condition exists for a user timezone

Specified by:
getUserTimezone in interface TimezoneService
Returns:

getUserTimezoneWithFallback

public org.joda.time.DateTimeZone getUserTimezoneWithFallback()
Description copied from interface: TimezoneService
Returns the DateTimeZone object for the current user OR the system default timezone if there is no current user / a time zone is missing.

Specified by:
getUserTimezoneWithFallback in interface TimezoneService
Returns:

translateForTimezone

public List<TimeBlock> translateForTimezone(List<TimeBlock> timeBlocks,
                                            String timezone)
Translation needed for UI Display

Specified by:
translateForTimezone in interface TimezoneService
Parameters:
timeBlocks -
timezone -
Returns:
timeblock list modified with times offset for timezone

translateForTimezone

public void translateForTimezone(List<TimeBlock> timeBlocks)
Specified by:
translateForTimezone in interface TimezoneService

isSameTimezone

public boolean isSameTimezone()
Description copied from interface: TimezoneService
Determine if Timezone is same as server timezone

Specified by:
isSameTimezone in interface TimezoneService
Returns:

getTimezoneOffsetFromServerTime

public long getTimezoneOffsetFromServerTime(org.joda.time.DateTimeZone dtz)
Specified by:
getTimezoneOffsetFromServerTime in interface TimezoneService


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.