Package org.openbravo.erpCommon.modules
Class VersionUtility
- java.lang.Object
-
- org.openbravo.erpCommon.modules.VersionUtility
-
public class VersionUtility extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VersionUtility.VersionComparator
-
Constructor Summary
Constructors Constructor Description VersionUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
checkLocal(VariablesSecureApp vars, Module[] modulesToInstall, Module[] modulesToUpdate, Module[] modulesToMerge, OBError obErrors)
check the dependencies to install new modules locally, without connecting to central repositorystatic ModuleInstallDetail
checkRemote(VariablesSecureApp vars, String[] moduleVersionId, String[] moduleVersionToUpdateId, OBError obErrors, HashMap<String,String> maturityLevels)
check the dependencies to install new modulesstatic boolean
getOBError(OBError rt, ConnectionProvider conn, VariablesSecureApp vars, String[] errors)
static String
toCommaString(String[] arr)
Transform a String array into a comma separated String Example ["aaa", "bbb", "ccc"] -> "aaa, bbb, cccc"static String
toCommaString(String[] arr, boolean parenthesys)
static int
versionCompareStrictMajorVersion(String ver1, String ver2)
Compares 2 versions taking into account just their major versions.
-
-
-
Method Detail
-
toCommaString
public static String toCommaString(String[] arr)
Transform a String array into a comma separated String Example ["aaa", "bbb", "ccc"] -> "aaa, bbb, cccc"- Parameters:
arr
- A String Array- Returns:
- The comma separated String
-
versionCompareStrictMajorVersion
public static int versionCompareStrictMajorVersion(String ver1, String ver2)
Compares 2 versions taking into account just their major versions.- Returns:
- -1 in case ver1 is lower than ver2
- 0 in case ver1 equals ver2
- 1 in case ver1 is higher than ver2
-
getOBError
public static boolean getOBError(OBError rt, ConnectionProvider conn, VariablesSecureApp vars, String[] errors)
-
checkRemote
public static ModuleInstallDetail checkRemote(VariablesSecureApp vars, String[] moduleVersionId, String[] moduleVersionToUpdateId, OBError obErrors, HashMap<String,String> maturityLevels) throws Exception
check the dependencies to install new modules- Parameters:
moduleVersionId
- In param. An String array with the modules version ids, that we want to install.moduleVersionToUpdateId
- Out param. Modules that need an update.obErrors
- Out param. Errors in dependencies. Null if no errors.maturityLevels
-- Returns:
- ModuleInstallDetail with modulesToInstall, modulesToUpdate and isValidConfiguration
- Throws:
Exception
-
checkLocal
public static boolean checkLocal(VariablesSecureApp vars, Module[] modulesToInstall, Module[] modulesToUpdate, Module[] modulesToMerge, OBError obErrors) throws Exception
check the dependencies to install new modules locally, without connecting to central repository- Parameters:
modulesToInstall
- In param. New modules to install, with its dependencies.modulesToUpdate
- In param. Modules to install, with its dependencies.modulesToMerge
- In param. Modules to merge.obErrors
- Out param. Errors in dependencies. Null if no errors.- Returns:
- true if all dependencies can be resolved without need of download any package from central repository, false in other case.
- Throws:
Exception
-
-