Package icc.util
Class AttributeHelper
- java.lang.Object
-
- icc.util.AttributeHelper
-
public class AttributeHelper extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description AttributeHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
calculateCompany(sailpoint.api.SailPointContext context, sailpoint.object.Identity identity)
Calculate Company of Identityjava.lang.String
calculateDatasource(sailpoint.api.SailPointContext ctx, sailpoint.object.Identity identity)
Calculate the siDataSource for a given identity as a csv-valuejava.lang.String
calculateDisplayName(java.lang.String firstName, java.lang.String lastName, java.lang.String unumber)
Calculate DisplayName of Identity.java.lang.String
calculateEmployeeType(sailpoint.api.SailPointContext ctx, sailpoint.object.Identity identity)
Calculate the employeetype of a given identity.boolean
calculateIsFk(sailpoint.api.SailPointContext ctx, sailpoint.object.Identity identity)
Calculate isFk for a given identity.java.lang.String
calculateManager(sailpoint.api.SailPointContext context, sailpoint.object.Identity iden)
Calculates the name of the given identity's managerjava.lang.String
calculatePersonType(sailpoint.api.SailPointContext ctx, sailpoint.object.Identity identity)
calculate siPersonType of a given identity as a csv-valuejava.lang.String
convertEmail(java.lang.String originalEmail)
Convert original Email to some arbitrary address safe for testingjava.lang.String
getEarliestEntryDate(sailpoint.api.SailPointContext context, sailpoint.object.Identity identity)
Calculates the earliest entry date of the given identityint
getEarliestEntryDateForApp(sailpoint.api.SailPointContext context, sailpoint.object.Identity iden, java.lang.String appName)
Calculates the earliest entry date of the given identity for an applicationjava.lang.String
getHrLinkAttribute(sailpoint.api.SailPointContext context, sailpoint.object.Link link, java.lang.String attributeName)
Calculates the attribute value from the given HR link and the attribute namejava.lang.String
getIdentityNameForEmail(sailpoint.api.SailPointContext context, java.lang.String email)
Get Identity Name for Emailstatic AttributeHelper
getInstance()
java.lang.String
getLatestExitDate(sailpoint.api.SailPointContext context, sailpoint.object.Identity identity)
Calculates the latest exit date of the given identityint
getLatestExitDateForApp(sailpoint.api.SailPointContext context, sailpoint.object.Identity iden, java.lang.String appName)
Calculates the latest exit date of the given identity for an applicationboolean
isTimestampTodayOrInPast(java.lang.String timeStamp, java.lang.String format)
Check if Timestamp is in past relative to todays datejava.lang.String
regexApplicationAttribute(sailpoint.api.SailPointContext context, java.lang.String applicationName, java.lang.String attribute, java.lang.String searchString, java.lang.String regex)
Searches for a link-attribute that contains a searched substring.java.lang.String
removeContractNumberFromAttribute(java.lang.String originalValue)
Remove ContractNumber from Attribute Value by splitting String at the '@' Symbol
-
-
-
Method Detail
-
getInstance
public static AttributeHelper getInstance()
-
calculateEmployeeType
public java.lang.String calculateEmployeeType(sailpoint.api.SailPointContext ctx, sailpoint.object.Identity identity) throws sailpoint.tools.GeneralException
Calculate the employeetype of a given identity. Only returns value for identities with a PAISY account- Parameters:
ctx
-identity
-- Returns:
- IdentityAttr.EMPLOYEETYPE_INTERN or IdentityAttr.EMPLOYEETYPE_EXTERN
- Throws:
sailpoint.tools.GeneralException
-
calculateIsFk
public boolean calculateIsFk(sailpoint.api.SailPointContext ctx, sailpoint.object.Identity identity) throws sailpoint.tools.GeneralException
Calculate isFk for a given identity. Only returns other than false for identities with a PAISY account- Parameters:
ctx
-identity
-- Returns:
- true if KENNZ_LTG Attribute of PAISY account is "1"
- Throws:
sailpoint.tools.GeneralException
-
calculatePersonType
public java.lang.String calculatePersonType(sailpoint.api.SailPointContext ctx, sailpoint.object.Identity identity) throws sailpoint.tools.GeneralException
calculate siPersonType of a given identity as a csv-value- Parameters:
ctx
-identity
-- Returns:
- csv of person types
- Throws:
sailpoint.tools.GeneralException
-
calculateDatasource
public java.lang.String calculateDatasource(sailpoint.api.SailPointContext ctx, sailpoint.object.Identity identity) throws sailpoint.tools.GeneralException
Calculate the siDataSource for a given identity as a csv-value- Parameters:
ctx
-identity
-- Returns:
- csv of datasources
- Throws:
sailpoint.tools.GeneralException
-
convertEmail
public java.lang.String convertEmail(java.lang.String originalEmail)
Convert original Email to some arbitrary address safe for testing- Parameters:
orginialEmail
-- Returns:
- changed Email
-
getIdentityNameForEmail
public java.lang.String getIdentityNameForEmail(sailpoint.api.SailPointContext context, java.lang.String email) throws sailpoint.tools.GeneralException
Get Identity Name for Email- Parameters:
context
- SailPointContextemail
- Email- Returns:
- Identity Name
- Throws:
sailpoint.tools.GeneralException
-
isTimestampTodayOrInPast
public boolean isTimestampTodayOrInPast(java.lang.String timeStamp, java.lang.String format) throws java.text.ParseException
Check if Timestamp is in past relative to todays date- Parameters:
timeStamp
- Time Stamp (e.g. 2021_04_22)format
- Time Stamp Format (e.g. yyyy_MM_dd)- Returns:
- negative or null distance means, that the date delivered by timestamp is today or in the past, thus result is 'true', otherwise 'false'
- Throws:
java.text.ParseException
-
calculateDisplayName
public java.lang.String calculateDisplayName(java.lang.String firstName, java.lang.String lastName, java.lang.String unumber)
Calculate DisplayName of Identity. If FirstName and LastName have values use both, otherwise user either one.- Parameters:
firstName
- First NamelastName
- Last Name- Returns:
- 'LastName, FirstName' if both have values, otherwise only FirstName or only LastName
-
calculateCompany
public java.lang.String calculateCompany(sailpoint.api.SailPointContext context, sailpoint.object.Identity identity) throws sailpoint.tools.GeneralException
Calculate Company of Identity- Parameters:
link
- ISIM Application Link of Identitydelimiter
- The delimiter character used for the CSV List in the result String, defaults to ',' if parameter is null- Returns:
- CSV String with Company Names without Contract Numbers
- Throws:
sailpoint.tools.GeneralException
-
removeContractNumberFromAttribute
public java.lang.String removeContractNumberFromAttribute(java.lang.String originalValue)
Remove ContractNumber from Attribute Value by splitting String at the '@' Symbol- Parameters:
originalValue
- The original Value, with the ContractNumber attached- Returns:
- first Part of original Value, without the ContractNumber
-
calculateManager
public java.lang.String calculateManager(sailpoint.api.SailPointContext context, sailpoint.object.Identity iden) throws sailpoint.tools.GeneralException
Calculates the name of the given identity's manager- Parameters:
context
-iden
- Identity for which the manager should be calculated- Returns:
- identityName of the manager
- Throws:
sailpoint.tools.GeneralException
-
getLatestExitDate
public java.lang.String getLatestExitDate(sailpoint.api.SailPointContext context, sailpoint.object.Identity identity) throws sailpoint.tools.GeneralException, java.text.ParseException
Calculates the latest exit date of the given identity- Parameters:
context
-identity
-- Returns:
- A String with the generalized Time for the latest exit date
- Throws:
sailpoint.tools.GeneralException
java.text.ParseException
-
getLatestExitDateForApp
public int getLatestExitDateForApp(sailpoint.api.SailPointContext context, sailpoint.object.Identity iden, java.lang.String appName) throws sailpoint.tools.GeneralException
Calculates the latest exit date of the given identity for an application- Parameters:
context
-identity
-appName
-- Returns:
- An int with the generalized Time for the latest exit date
- Throws:
sailpoint.tools.GeneralException
java.text.ParseException
-
getEarliestEntryDate
public java.lang.String getEarliestEntryDate(sailpoint.api.SailPointContext context, sailpoint.object.Identity identity) throws sailpoint.tools.GeneralException, java.text.ParseException
Calculates the earliest entry date of the given identity- Parameters:
context
-identity
-- Returns:
- A String with the generalized Time for the earliest entry date
- Throws:
sailpoint.tools.GeneralException
java.text.ParseException
-
getEarliestEntryDateForApp
public int getEarliestEntryDateForApp(sailpoint.api.SailPointContext context, sailpoint.object.Identity iden, java.lang.String appName) throws sailpoint.tools.GeneralException
Calculates the earliest entry date of the given identity for an application- Parameters:
context
-identity
-appName
-- Returns:
- An int with the generalized Time for the earliest entry date
- Throws:
sailpoint.tools.GeneralException
java.text.ParseException
-
getHrLinkAttribute
public java.lang.String getHrLinkAttribute(sailpoint.api.SailPointContext context, sailpoint.object.Link link, java.lang.String attributeName) throws sailpoint.tools.GeneralException
Calculates the attribute value from the given HR link and the attribute name- Parameters:
context
-link
-attributeName
-- Returns:
- A string with the value of the attribute
- Throws:
sailpoint.tools.GeneralException
-
regexApplicationAttribute
public java.lang.String regexApplicationAttribute(sailpoint.api.SailPointContext context, java.lang.String applicationName, java.lang.String attribute, java.lang.String searchString, java.lang.String regex) throws sailpoint.tools.GeneralException
Searches for a link-attribute that contains a searched substring. Before it returns the attribute, a regular expression is applied on the result- Parameters:
context
-applicationName
- Application to be searchedattribute
- Attribute to be searchedsearchString
- Substring of a link-attribute to be searchedregex
- Regex applied on substring- Returns:
- Resulting attribute after regex was applied. Only the first match and the first group is returned
- Throws:
sailpoint.tools.GeneralException
-
-