Package icc.util

Class 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 Identity
      java.lang.String calculateDatasource​(sailpoint.api.SailPointContext ctx, sailpoint.object.Identity identity)
      Calculate the siDataSource for a given identity as a csv-value
      java.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 manager
      java.lang.String calculatePersonType​(sailpoint.api.SailPointContext ctx, sailpoint.object.Identity identity)
      calculate siPersonType of a given identity as a csv-value
      java.lang.String convertEmail​(java.lang.String originalEmail)
      Convert original Email to some arbitrary address safe for testing
      java.lang.String getEarliestEntryDate​(sailpoint.api.SailPointContext context, sailpoint.object.Identity identity)
      Calculates the earliest entry date of the given identity
      int getEarliestEntryDateForApp​(sailpoint.api.SailPointContext context, sailpoint.object.Identity iden, java.lang.String appName)
      Calculates the earliest entry date of the given identity for an application
      java.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 name
      java.lang.String getIdentityNameForEmail​(sailpoint.api.SailPointContext context, java.lang.String email)
      Get Identity Name for Email
      static AttributeHelper getInstance()  
      java.lang.String getLatestExitDate​(sailpoint.api.SailPointContext context, sailpoint.object.Identity identity)
      Calculates the latest exit date of the given identity
      int getLatestExitDateForApp​(sailpoint.api.SailPointContext context, sailpoint.object.Identity iden, java.lang.String appName)
      Calculates the latest exit date of the given identity for an application
      boolean isTimestampTodayOrInPast​(java.lang.String timeStamp, java.lang.String format)
      Check if Timestamp is in past relative to todays date
      java.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
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AttributeHelper

        public AttributeHelper()
    • Method Detail

      • 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 - SailPointContext
        email - 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 Name
        lastName - 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 Identity
        delimiter - 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 searched
        attribute - Attribute to be searched
        searchString - Substring of a link-attribute to be searched
        regex - 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