Interface CalendarConversionSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CalendarConversionSession extends OsidSession

This session defines methods to convert dates across calendar systems.

  • Method Details

    • getSourceCalendarType

      Type getSourceCalendarType()
      Gets the source calendar type used in this session.
      Returns:
      the source calendar type
      Compliance:
      mandatory - This method must be implemented.
    • getSourceTimeType

      Type getSourceTimeType()
      Gets the source time type used in this session.
      Returns:
      the source time type
      Compliance:
      mandatory - This method must be implemented.
    • getTargetCalendarType

      Type getTargetCalendarType()
      Gets the target calendar type used in this session.
      Returns:
      the target calendar
      Compliance:
      mandatory - This method must be implemented.
    • getTargetTimeType

      Type getTargetTimeType()
      Gets the target time type used in this session.
      Returns:
      the target time type
      Compliance:
      mandatory - This method must be implemented.
    • canConvertCalendars

      boolean canConvertCalendars()
      Tests if this user can perform calendar conversions. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations.
      Returns:
      false if conversion methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • convertCalendar

      Converts a date.
      Parameters:
      sourceDate - the date to convert
      Returns:
      the resulting date
      Throws:
      InvalidArgumentException - sourceDate.getCalendarType() != getSourceCalendarType() or sourceDate.getTimeType() != getSourceTimeType()
      NullArgumentException - sourceDate is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • convertCalendars

      Converts dates.
      Parameters:
      sourceDateList - the dates to convert
      Returns:
      the resulting dates
      Throws:
      InvalidArgumentException - sourceDate.getCalendarType() != getSourceCalendarType() or sourceDate.getTimeType() != getSourceTimeType()
      NullArgumentException - sourceDateList is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.