com.atlassian.confluence.upgrade
Class IsNewerThanAndConfiguredNumberHighEnough

java.lang.Object
  extended by com.atlassian.confluence.upgrade.IsNewerThanAndConfiguredNumberHighEnough
All Implemented Interfaces:
BuildNumberUpgradeConstraint

public class IsNewerThanAndConfiguredNumberHighEnough
extends Object
implements BuildNumberUpgradeConstraint

A constraint that will test whether the build number configured on the constraint is newer than the build number passed to test(int) AND the application configured build number is higher than a configured value.

This type of constraint would typically be used if you only wanted an upgrade task to run if the configured build number was newer than a certain value but you are upgrading from a certain old version. value.

A hypothetical example:

If you upgrade from build 5 - 9 then the build 10 upgrade task is required.
If you upgrade from build 0 - 4 then the build 10 upgrade task is not required .

For the above example you would construct the constraint like new IsNewerThanAndConfiguredNumberHighEnough(5,10)


Constructor Summary
IsNewerThanAndConfiguredNumberHighEnough(int applicationConfigBuildNumber, int minApplicationConfig, int constraintBuildNumber)
           
 
Method Summary
 boolean test(int buildNumber)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IsNewerThanAndConfiguredNumberHighEnough

public IsNewerThanAndConfiguredNumberHighEnough(int applicationConfigBuildNumber,
                                                int minApplicationConfig,
                                                int constraintBuildNumber)
Parameters:
applicationConfigBuildNumber - the actual application configured build number
minApplicationConfig - the minimum application configured build number required for this constraint to pass
constraintBuildNumber - the constraint build number to test other build numbers against
Method Detail

test

public boolean test(int buildNumber)
Specified by:
test in interface BuildNumberUpgradeConstraint
Parameters:
buildNumber - the build number to test the constraint against.
Returns:
true if the application configured build number is less than or equal

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2013 Atlassian. All Rights Reserved.