Package com.identityworksllc.iiq.common
Class NamedTimestampUtils
- java.lang.Object
-
- com.identityworksllc.iiq.common.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.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDELETE_QUERYThe SQL query to delete a timestamp by name.static StringFETCH_VALUE_QUERYThe SQL query to fetch a timestamp by name.static StringIIQ_84The version string for IIQ 8.4.static StringINSERT_QUERYThe SQL query to insert a timestamp by name.static StringMETHOD_GET_TIMESTAMPThe method names for the NamedTimestamp class.static StringMETHOD_SET_TIMESTAMPThe method names for the NamedTimestamp class.static StringOBJECT_NAMED_TIMESTAMPThe name of the NamedTimestamp object.static StringTABLE_EXISTS_QUERYThe SQL query to check if the iiqc_named_timestamps table exists.static StringUPDATE_QUERYThe SQL query to update a timestamp by name.
-
Constructor Summary
Constructors Constructor Description NamedTimestampUtils(sailpoint.api.SailPointContext context)Creates a new NamedTimestampUtils instance.
-
-
-
Field Detail
-
DELETE_QUERY
public static final String DELETE_QUERY
The SQL query to delete a timestamp by name.- See Also:
- Constant Field Values
-
FETCH_VALUE_QUERY
public static final String FETCH_VALUE_QUERY
The SQL query to fetch a timestamp by name.- See Also:
- Constant Field Values
-
IIQ_84
public static final String IIQ_84
The version string for IIQ 8.4.- See Also:
- Constant Field Values
-
INSERT_QUERY
public static final String INSERT_QUERY
The SQL query to insert a timestamp by name.- See Also:
- Constant Field Values
-
METHOD_GET_TIMESTAMP
public static final String METHOD_GET_TIMESTAMP
The method names for the NamedTimestamp class.- See Also:
- Constant Field Values
-
METHOD_SET_TIMESTAMP
public static final String METHOD_SET_TIMESTAMP
The method names for the NamedTimestamp class.- See Also:
- Constant Field Values
-
OBJECT_NAMED_TIMESTAMP
public static final String OBJECT_NAMED_TIMESTAMP
The name of the NamedTimestamp object.- See Also:
- Constant Field Values
-
TABLE_EXISTS_QUERY
public static final String TABLE_EXISTS_QUERY
The SQL query to check if the iiqc_named_timestamps table exists.- See Also:
- Constant Field Values
-
UPDATE_QUERY
public static final String UPDATE_QUERY
The SQL query to update a timestamp by name.- See Also:
- Constant Field Values
-
-
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<Instant> get(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 timestampinstant- 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 timestampvalue- the timestamp to store- Throws:
sailpoint.tools.GeneralException- if an error occurs during storage
-
-