Class TimeTokenizer


  • public class TimeTokenizer
    extends Object
    Substitutes time tokens in a particular string, typically for task scheduling.

    Time tokens can be any of:

    • $NOW The current timestamp

    • $MIDNIGHT The most recent midnight in the time zone given

    • $YESTERDAY The second most recent midnight in the time zone given

    • $LASTSTART The last time the task was started, or 0 if no data

    • $LASTSTOP The last time the task was stopped, or 0 if no data

    • $(anyVariable as format) Formats the input timestamp using the given format (for querying string dates)

    • $(today at 14:00)

    • $(yesterday at 10:00) The described timestamp

    • $(+/-N UNITS) An offset of N UNITS (e.g. “-3 hours”), where the unit is one of ChronoUnit

    • $(+/-N UNITS at midnight)

    • $(LASTSTOP -N UNITS)

    • Method Detail

      • parseTimeComponents

        public static String parseTimeComponents​(sailpoint.object.TaskSchedule taskSchedule,
                                                 String inputString,
                                                 String zoneIdString)
                                          throws sailpoint.tools.GeneralException
        Parses the input string, which may or may not contain time tokens, by replacing the token with a string suitable for a Sailpoint filter (i.e., the DATE$ format).
        Parameters:
        taskSchedule - The task schedule, optionally. It will be used to populate the LASTSTART and LASTSTOP tokens if present.
        inputString - the input string to replace tokens within
        zoneIdString - The timezone to use for time tokens (optional)
        Returns:
        The parsed and reformatted input string
        Throws:
        sailpoint.tools.GeneralException - if any failures occur during parsing