Class NamedTimestampUtils


  • public class NamedTimestampUtils
    extends Object
    In 8.4, a new class NamedTimestamp was added.

    We can’t depend on it existing in earlier versions, but the behavior is so useful, we want to simulate it.

    In pre-8.4 versions, we will do so using a database table, iiqc_named_timestamps. In 8.4, we will simply use the object as-is via reflection.

    • Constructor Detail

      • NamedTimestampUtils

        public NamedTimestampUtils​(sailpoint.api.SailPointContext context)
        Creates a new NamedTimestampUtils instance.
        Parameters:
        context - the SailPointContext to use
    • Method Detail

      • get

        public Optional<Instantget​(String name)
                              throws sailpoint.tools.GeneralException
        Fetches a timestamp by name.

        If the timestamp is not found, an empty Optional is returned.

        Parameters:
        name - The name of the timestamp
        Returns:
        An Optional containing the timestamp, or an empty Optional if the timestamp is not found
        Throws:
        sailpoint.tools.GeneralException - if an error occurs during retrieval
      • put

        public void put​(String name,
                        Instant instant)
                 throws sailpoint.tools.GeneralException
        Stores a timestamp by name.
        Parameters:
        name - the name of the timestamp
        instant - the timestamp to store
        Throws:
        sailpoint.tools.GeneralException - if an error occurs during storage
      • put

        public void put​(String name,
                        long value)
                 throws sailpoint.tools.GeneralException
        Stores a timestamp by name.

        Equivalent to calling storeTimestamp(name, Instant.ofEpochMillis(value)).

        Parameters:
        name - the name of the timestamp
        value - the timestamp to store
        Throws:
        sailpoint.tools.GeneralException - if an error occurs during storage