Class Outcome
- java.lang.Object
-
- com.identityworksllc.iiq.common.vo.Outcome
-
- All Implemented Interfaces:
Serializable
,AutoCloseable
- Direct Known Subclasses:
AggregationOutcome
public class Outcome extends Object implements AutoCloseable, Serializable
A generic class to represent (and perhaps log) some operation outcome.It contains fields for generic start/stop tracking, as well as fields for a slew of output and logging indicators.
This class is not intended to be used in any particular way. It is used for various purposes throughout Instrumental ID’s codebase.
This class implements
AutoCloseable
so that it can be used in the following sort of structure:Outcome outcome; try(outcome = Outcome.start()) { // Do things, recording the outcome } // Your outcome will have a proper start/stop time for that block here
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Outcome()
Basic constructor, also used by Jackson to figure out what the ‘default’ for each item in the class is.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(String input, Throwable err)
Adds a timestamped error to this outcomevoid
addMessage(String input)
Adds a timestamped log message of INFO level to this outcomevoid
addMessage(sailpoint.tools.Message input)
Adds a timestamped IIQ message to this outcomevoid
close()
If the outcome has not yet had its stop timestamp set, sets it to the current timeString
getApplicationName()
String
getAttribute()
long
getCreated()
String
getIdentityName()
List<StampedMessage>
getMessages()
String
getNativeIdentity()
String
getObjectId()
String
getObjectName()
String
getObjectType()
String
getProvisioningTransaction()
int
getResponseCode()
long
getStartTimeMillis()
OutcomeType
getStatus()
Gets the status, or calculates it based on other fields.long
getStopTimeMillis()
String
getText()
String
getValue()
boolean
isRefreshed()
boolean
isUpdated()
void
setApplicationName(String applicationName)
void
setAttribute(String attribute)
void
setIdentityName(String identityName)
void
setNativeIdentity(String nativeIdentity)
void
setObjectId(String objectId)
void
setObjectName(String objectName)
void
setObjectType(String objectType)
void
setProvisioningTransaction(String provisioningTransaction)
void
setRefreshed(Boolean refreshed)
void
setResponseCode(Integer responseCode)
void
setStartTimeMillis(long startTimeMillis)
void
setStatus(OutcomeType status)
void
setStopTimeMillis(long stopTimeMillis)
void
setText(String text)
void
setUpdated(Boolean updated)
void
setValue(String value)
static Outcome
start()
Create and start a new Outcome object.void
terminate()
Sets the status to Terminated and the stop time to the current timestampString
toString()
-
-
-
Constructor Detail
-
Outcome
public Outcome()
Basic constructor, also used by Jackson to figure out what the ‘default’ for each item in the class is.
-
-
Method Detail
-
start
public static Outcome start()
Create and start a new Outcome object.This is intended to be used in conjunction with the try-with-resources and AutoClosable function to start/stop your Outcome along with its operation.
- Returns:
- A started outcome
-
addError
public void addError(String input, Throwable err)
Adds a timestamped error to this outcome- Parameters:
input
- A string message to use with the errorerr
- The error itself
-
addMessage
public void addMessage(sailpoint.tools.Message input)
Adds a timestamped IIQ message to this outcome- Parameters:
input
- The IIQ outcome
-
addMessage
public void addMessage(String input)
Adds a timestamped log message of INFO level to this outcome- Parameters:
input
- The log message
-
close
public void close()
If the outcome has not yet had its stop timestamp set, sets it to the current time- Specified by:
close
in interfaceAutoCloseable
-
getApplicationName
public String getApplicationName()
-
getAttribute
public String getAttribute()
-
getCreated
public long getCreated()
-
getIdentityName
public String getIdentityName()
-
getMessages
public List<StampedMessage> getMessages()
-
getNativeIdentity
public String getNativeIdentity()
-
getObjectId
public String getObjectId()
-
getObjectName
public String getObjectName()
-
getObjectType
public String getObjectType()
-
getProvisioningTransaction
public String getProvisioningTransaction()
-
getResponseCode
public int getResponseCode()
-
getStartTimeMillis
public long getStartTimeMillis()
-
getStatus
public OutcomeType getStatus()
Gets the status, or calculates it based on other fields.If there is no status explicitly set and the stop time is not set, returns null.
- Returns:
- The status, or null if the outcome is not yet stopped
-
getStopTimeMillis
public long getStopTimeMillis()
-
isRefreshed
public boolean isRefreshed()
-
isUpdated
public boolean isUpdated()
-
setApplicationName
public void setApplicationName(String applicationName)
-
setAttribute
public void setAttribute(String attribute)
-
setIdentityName
public void setIdentityName(String identityName)
-
setNativeIdentity
public void setNativeIdentity(String nativeIdentity)
-
setObjectId
public void setObjectId(String objectId)
-
setObjectName
public void setObjectName(String objectName)
-
setObjectType
public void setObjectType(String objectType)
-
setProvisioningTransaction
public void setProvisioningTransaction(String provisioningTransaction)
-
setRefreshed
public void setRefreshed(Boolean refreshed)
-
setResponseCode
public void setResponseCode(Integer responseCode)
-
setStartTimeMillis
public void setStartTimeMillis(long startTimeMillis)
-
setStatus
public void setStatus(OutcomeType status)
-
setStopTimeMillis
public void setStopTimeMillis(long stopTimeMillis)
-
setUpdated
public void setUpdated(Boolean updated)
-
terminate
public void terminate()
Sets the status to Terminated and the stop time to the current timestamp
-
-