Class OldPolicyConditionMigrationUpgradeStep

  • All Implemented Interfaces:
    UpgradeStep

    public class OldPolicyConditionMigrationUpgradeStep
    extends AbstractUpgradeStep

    Will attempt to migrate old policy conditions to new entitlement conditions.

    Will only migrate conditions that have a defined migration path from old to new. Any policies which can't be upgrade will be listed in the long report and will have to be manually upgraded at a later date.

    Since:
    12.0.0
    • Constructor Detail

      • OldPolicyConditionMigrationUpgradeStep

        @Inject
        public OldPolicyConditionMigrationUpgradeStep​(PrivilegedAction<SSOToken> adminTokenAction,
                                                      ConnectionFactory connectionFactory)
        Constructs a new OldPolicyConditionMigrationUpgradeStep instance.
        Parameters:
        adminTokenAction - An instance of the admin action.
        connectionFactory - An instance of a ConnectionFactory.
    • Method Detail

      • initialize

        public void initialize()
                        throws UpgradeException
        Checks what policies could be automatically upgraded and performs the upgrade without saving so that the migrated policy can be validated to ensure the upgrade went well.
        Throws:
        UpgradeException - If a problem occurred checking the policies.
      • isApplicable

        public boolean isApplicable()
        Returns true if there are any policies that can be upgraded.
        Returns:
        true if there are any policies that can be upgraded.
      • perform

        public void perform()
                     throws UpgradeException
        Does the persisting of the upgraded policies.
        Throws:
        UpgradeException - If there is a problem saving the policies.
      • getShortReport

        public String getShortReport​(String delimiter)
        Returns a short report for this upgrade step that should be suitable for the upgrade screen.
        Parameters:
        delimiter - The delimiter to use between lines.
        Returns:
        The short upgrade report.
      • getDetailedReport

        public String getDetailedReport​(String delimiter)
        Generates a detailed upgrade report suitable for reviewing changes.
        Parameters:
        delimiter - The delimiter to use between lines.
        Returns:
        The detailed upgrade report.