Package ch.autumo.commons.application
Class AbstractVersion
java.lang.Object
ch.autumo.commons.application.AbstractVersion
- All Implemented Interfaces:
RegistrationVersion
Abstract version for update/upgrade handling.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classA version entry from the XML. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCurrentVersion(String appVersion) Get current APP version from loaded versions, not registration version.final StringReturn a compressed version string: E.g. "1.2.0" -> "120".abstract StringThe registration key stays the same for the same product.final StringGet the salt which is a combination of version and key.abstract StringRegistration version ('x.y.z'), e.g. "1.0.0".static doublegetVersion(String version) Get a version from string.hasFreeUpgrade(String appVersion) Check if a free upgrade is available based on loaded versions.hasUpgrade(String appVersion) Check if an upgrade is available based on loaded versions.booleanisLoaded()Are versions loaded from XML?voidload(InputStreamReader reader) Load a version history file (XML).toString()Get loaded versions.
-
Constructor Details
-
AbstractVersion
protected AbstractVersion()Default constructor.
-
-
Method Details
-
getRegistrationVersion
Description copied from interface:RegistrationVersionRegistration version ('x.y.z'), e.g. "1.0.0". Change this if you want to jump to a new license key (purchase necessary).- Specified by:
getRegistrationVersionin interfaceRegistrationVersion- Returns:
- registration version
-
getRegistrationKey
Description copied from interface:RegistrationVersionThe registration key stays the same for the same product. Use different keys for different applications! (length = 25 characters)- Specified by:
getRegistrationKeyin interfaceRegistrationVersion- Returns:
- registration version
-
getKeyRegistrationVersion
Description copied from interface:RegistrationVersionReturn a compressed version string: E.g. "1.2.0" -> "120".- Specified by:
getKeyRegistrationVersionin interfaceRegistrationVersion- Returns:
- registered key version representation.
-
getRegistrationSalt
Description copied from interface:RegistrationVersionGet the salt which is a combination of version and key.- Specified by:
getRegistrationSaltin interfaceRegistrationVersion- Returns:
- registration version salt
-
load
Load a version history file (XML).- Parameters:
reader- version file XML input stream reader
-
hasFreeUpgrade
Check if a free upgrade is available based on loaded versions.- Parameters:
appVersion- app version "x.x.x"- Returns:
- true if so
-
hasUpgrade
Check if an upgrade is available based on loaded versions.- Parameters:
appVersion- app version "x.x.x"- Returns:
- true if so
-
getCurrentVersion
Get current APP version from loaded versions, not registration version.- Parameters:
appVersion- app version "x.x.x"- Returns:
- APP version.
-
getVersion
Get a version from string.- Parameters:
version- version string- Returns:
- version value
-
isLoaded
public boolean isLoaded()Are versions loaded from XML?- Returns:
- true if so
-
toString
Get loaded versions.
-