Class MasterUpdater
java.lang.Object
zleurtor.scanmanager.model.update.AbstractUpdater
zleurtor.scanmanager.model.update.MasterUpdater
- All Implemented Interfaces:
EventListener
,ArtifactRepositoryManagerConnectorListener
public class MasterUpdater
extends AbstractUpdater
implements ArtifactRepositoryManagerConnectorListener
The class having in charge to search the updates and apply it (if needed).
- Author:
- Zleurtor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Registers a new object listening for master updater events.protected final Collection<String>
computePlan
(File archive) Compare the content of the installer archive and the installed pack, then compute the packs to unpack.final void
The event fired during an artifact download.final String
Search the latest version on the artifact repository.final boolean
update()
Check if an update is available (and install it).Methods inherited from class zleurtor.scanmanager.model.update.AbstractUpdater
mergeConfigurations
-
Constructor Details
-
MasterUpdater
public MasterUpdater()
-
-
Method Details
-
update
public final boolean update()Check if an update is available (and install it).- Specified by:
update
in classAbstractUpdater
- Returns:
- true if an update has been done, false otherwise.
-
computePlan
protected final Collection<String> computePlan(File archive) throws FileNotFoundException, IOException, NoSuchAlgorithmException, ClassNotFoundException Compare the content of the installer archive and the installed pack, then compute the packs to unpack.- Specified by:
computePlan
in classAbstractUpdater
- Parameters:
archive
- The new 3D Scan Manager version archive.- Returns:
- The collection of packs to unpack from the archive.
- Throws:
IOException
- If the new version archive file can not be read.FileNotFoundException
- If the new version archive file does not exist.NoSuchAlgorithmException
- If no Provider supports MD5 or SHA-1 implementation.ClassNotFoundException
- If the Class of a serialized object cannot be found.
-
searchLatestVersion
public final String searchLatestVersion() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, IOExceptionSearch the latest version on the artifact repository.- Returns:
- The latest version found on the artifact repository.
- Throws:
KeyStoreException
- If the TrustStrategy fails to load.NoSuchAlgorithmException
- If no Provider supports aTrustManagerFactorySpi implementation for the "trust all" strategy.KeyManagementException
- If the SSL context builder fails to initialize.IOException
- If the artifact repository manager connector fails to close.
-
addMasterUpdaterListener
Registers a new object listening for master updater events.- Parameters:
listener
- The new object listening for master updater events to register.
-
downloadingArtifact
Description copied from interface:ArtifactRepositoryManagerConnectorListener
The event fired during an artifact download.- Specified by:
downloadingArtifact
in interfaceArtifactRepositoryManagerConnectorListener
- Parameters:
evt
- The event object containing information on the artifact which is being downloaded.
-