Package com.biglybt.pifimpl.local.update
Class UpdateManagerImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.update.UpdateManagerImpl
-
- All Implemented Interfaces:
UpdateCheckInstanceListener
,UpdateManager
public class UpdateManagerImpl extends java.lang.Object implements UpdateManager, UpdateCheckInstanceListener
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<UpdateCheckInstanceImpl>
checkers
private java.util.List<UpdatableComponentImpl>
components
private Core
core
private java.util.List<UpdateInstaller>
installers
private java.util.List
listeners
private static UpdateManagerImpl
singleton
protected AEMonitor
this_mon
private java.util.List
verification_listeners
-
Constructor Summary
Constructors Modifier Constructor Description protected
UpdateManagerImpl(Core _core)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(UpdateManagerListener l)
void
addVerificationListener(UpdateManagerVerificationListener l)
void
applyUpdates(boolean restart_after)
applies any updates and stops or restarts Azureusvoid
cancelled(UpdateCheckInstance instance)
void
complete(UpdateCheckInstance instance)
UpdateCheckInstanceImpl
createEmptyUpdateCheckInstance(int type, java.lang.String name)
creates an update check instance with no attached updateable components (as opposed to automatically including all registeredUpdateCheckInstanceImpl
createEmptyUpdateCheckInstance(int type, java.lang.String name, boolean low_noise)
UpdateInstaller
createInstaller()
create a stand alone update installer.UpdateCheckInstance
createUpdateCheckInstance()
creates an update check instance with currently registered updatable components Default check type is "UCI_UPDATE"UpdateCheckInstance
createUpdateCheckInstance(int type, java.lang.String name)
creates an update check instance with currently registered updatable componentsUpdateCheckInstance[]
getCheckInstances()
protected Core
getCore()
java.lang.String
getInstallDir()
UpdateInstaller[]
getInstallers()
returns the currently declared installers, if anystatic UpdateManager
getSingleton(Core core)
java.lang.String
getUserDir()
boolean
hasPendingInstalls()
void
registerUpdatableComponent(UpdatableComponent component, boolean mandatory)
All updateable components must register in order to receive update check eventsprotected void
removeInstaller(UpdateInstaller installer)
void
removeListener(UpdateManagerListener l)
void
removeVerificationListener(UpdateManagerVerificationListener l)
java.io.InputStream
verifyData(Update update, java.io.InputStream is, boolean force)
-
-
-
Field Detail
-
singleton
private static UpdateManagerImpl singleton
-
core
private Core core
-
checkers
private java.util.List<UpdateCheckInstanceImpl> checkers
-
components
private java.util.List<UpdatableComponentImpl> components
-
listeners
private java.util.List listeners
-
verification_listeners
private java.util.List verification_listeners
-
installers
private java.util.List<UpdateInstaller> installers
-
this_mon
protected AEMonitor this_mon
-
-
Constructor Detail
-
UpdateManagerImpl
protected UpdateManagerImpl(Core _core)
-
-
Method Detail
-
getSingleton
public static UpdateManager getSingleton(Core core)
-
getCore
protected Core getCore()
-
registerUpdatableComponent
public void registerUpdatableComponent(UpdatableComponent component, boolean mandatory)
Description copied from interface:UpdateManager
All updateable components must register in order to receive update check events- Specified by:
registerUpdatableComponent
in interfaceUpdateManager
mandatory
- indicates that this component must successfully complete checking for any overall update check to complete
-
getCheckInstances
public UpdateCheckInstance[] getCheckInstances()
- Specified by:
getCheckInstances
in interfaceUpdateManager
-
createUpdateCheckInstance
public UpdateCheckInstance createUpdateCheckInstance()
Description copied from interface:UpdateManager
creates an update check instance with currently registered updatable components Default check type is "UCI_UPDATE"- Specified by:
createUpdateCheckInstance
in interfaceUpdateManager
- Returns:
-
createUpdateCheckInstance
public UpdateCheckInstance createUpdateCheckInstance(int type, java.lang.String name)
Description copied from interface:UpdateManager
creates an update check instance with currently registered updatable components- Specified by:
createUpdateCheckInstance
in interfaceUpdateManager
- Parameters:
type
- see UpdateCheckInstance.UCI_xxname
- name of the update instance
-
createEmptyUpdateCheckInstance
public UpdateCheckInstanceImpl createEmptyUpdateCheckInstance(int type, java.lang.String name)
Description copied from interface:UpdateManager
creates an update check instance with no attached updateable components (as opposed to automatically including all registered- Specified by:
createEmptyUpdateCheckInstance
in interfaceUpdateManager
- Parameters:
type
- see UpdateCheckInstance.UCI_xxname
- name of the update instance- Returns:
-
createEmptyUpdateCheckInstance
public UpdateCheckInstanceImpl createEmptyUpdateCheckInstance(int type, java.lang.String name, boolean low_noise)
-
createInstaller
public UpdateInstaller createInstaller() throws UpdateException
Description copied from interface:UpdateManager
create a stand alone update installer. you will need to restart Azureus for it to be installed- Specified by:
createInstaller
in interfaceUpdateManager
- Returns:
- Throws:
UpdateException
-
getInstallers
public UpdateInstaller[] getInstallers()
Description copied from interface:UpdateManager
returns the currently declared installers, if any- Specified by:
getInstallers
in interfaceUpdateManager
- Returns:
-
hasPendingInstalls
public boolean hasPendingInstalls()
- Specified by:
hasPendingInstalls
in interfaceUpdateManager
-
cancelled
public void cancelled(UpdateCheckInstance instance)
- Specified by:
cancelled
in interfaceUpdateCheckInstanceListener
-
complete
public void complete(UpdateCheckInstance instance)
- Specified by:
complete
in interfaceUpdateCheckInstanceListener
-
removeInstaller
protected void removeInstaller(UpdateInstaller installer)
-
getInstallDir
public java.lang.String getInstallDir()
- Specified by:
getInstallDir
in interfaceUpdateManager
-
getUserDir
public java.lang.String getUserDir()
- Specified by:
getUserDir
in interfaceUpdateManager
-
applyUpdates
public void applyUpdates(boolean restart_after) throws UpdateException
Description copied from interface:UpdateManager
applies any updates and stops or restarts Azureus- Specified by:
applyUpdates
in interfaceUpdateManager
- Throws:
UpdateException
-
verifyData
public java.io.InputStream verifyData(Update update, java.io.InputStream is, boolean force) throws UpdateException
- Throws:
UpdateException
-
addVerificationListener
public void addVerificationListener(UpdateManagerVerificationListener l)
- Specified by:
addVerificationListener
in interfaceUpdateManager
-
removeVerificationListener
public void removeVerificationListener(UpdateManagerVerificationListener l)
- Specified by:
removeVerificationListener
in interfaceUpdateManager
-
addListener
public void addListener(UpdateManagerListener l)
- Specified by:
addListener
in interfaceUpdateManager
-
removeListener
public void removeListener(UpdateManagerListener l)
- Specified by:
removeListener
in interfaceUpdateManager
-
-