Package com.biglybt.pifimpl.local.update
Class UpdateCheckInstanceImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.update.UpdateCheckInstanceImpl
-
- All Implemented Interfaces:
UpdateCheckInstance
public class UpdateCheckInstanceImpl extends java.lang.Object implements UpdateCheckInstance
-
-
Field Summary
Fields Modifier and Type Field Description private static UpdateCheckInstanceImpl
active_checker
private boolean
automatic
private boolean
cancelled
private int
check_type
private UpdateCheckerImpl[]
checkers
private boolean
completed
private UpdatableComponentImpl[]
components
private java.util.List<UpdateManagerDecisionListener>
decision_listeners
private java.util.List<UpdateCheckInstanceListener>
listeners
private static LogIDs
LOGID
private boolean
low_noise
private UpdateManager
manager
private java.lang.String
name
private java.util.Map<java.lang.Integer,java.lang.Object>
properties
private AESemaphore
sem
protected AEMonitor
this_mon
private java.util.List<UpdateImpl>
updates
-
Fields inherited from interface com.biglybt.pif.update.UpdateCheckInstance
PT_CLOSE_OR_RESTART_ALREADY_IN_PROGRESS, PT_RESOURCE_OVERRIDES, PT_UI_DISABLE_ON_SUCCESS_SLIDEY, PT_UI_EXTRA_MESSAGE, PT_UI_PARENT_SWT_COMPOSITE, PT_UI_STYLE, PT_UI_STYLE_DEFAULT, PT_UI_STYLE_NONE, PT_UI_STYLE_SIMPLE, PT_UNINSTALL_RESTART_REQUIRED, UCI_INSTALL, UCI_UNINSTALL, UCI_UPDATE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UpdateCheckInstanceImpl(UpdateManager _manager, int _check_type, java.lang.String _name, UpdatableComponentImpl[] _components)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDecisionListener(UpdateManagerDecisionListener l)
void
addListener(UpdateCheckInstanceListener l)
void
addUpdatableComponent(UpdatableComponent component, boolean mandatory)
Add a further updatable component to this instance.protected UpdateImpl
addUpdate(UpdatableComponentImpl comp, java.lang.String update_name, java.lang.String[] desc, java.lang.String old_version, java.lang.String new_version, ResourceDownloader[] downloaders, int restart_required)
void
cancel()
UpdateInstaller
createInstaller()
UpdateChecker[]
getCheckers()
protected java.lang.Object
getDecision(Update update, int decision_type, java.lang.String decision_name, java.lang.String decision_description, java.lang.Object decision_data)
UpdateManager
getManager()
Access to the update managerjava.lang.String
getName()
returns the name supplied when the instance was created (or "" if it wasn't)java.lang.Object
getProperty(int property_name)
int
getType()
returns one of the above UCI_ constantsUpdate[]
getUpdates()
boolean
isAutomatic()
boolean
isCancelled()
boolean
isCompleteOrCancelled()
boolean
isLowNoise()
void
removeDecisionListener(UpdateManagerDecisionListener l)
void
removeListener(UpdateCheckInstanceListener l)
void
setAutomatic(boolean a)
void
setLowNoise(boolean a)
void
setProperty(int property_name, java.lang.Object value)
void
start()
private void
startSupport()
-
-
-
Field Detail
-
LOGID
private static final LogIDs LOGID
-
active_checker
private static UpdateCheckInstanceImpl active_checker
-
listeners
private java.util.List<UpdateCheckInstanceListener> listeners
-
updates
private java.util.List<UpdateImpl> updates
-
decision_listeners
private java.util.List<UpdateManagerDecisionListener> decision_listeners
-
sem
private AESemaphore sem
-
manager
private UpdateManager manager
-
check_type
private int check_type
-
name
private java.lang.String name
-
components
private UpdatableComponentImpl[] components
-
checkers
private UpdateCheckerImpl[] checkers
-
completed
private boolean completed
-
cancelled
private boolean cancelled
-
automatic
private boolean automatic
-
low_noise
private boolean low_noise
-
this_mon
protected AEMonitor this_mon
-
properties
private java.util.Map<java.lang.Integer,java.lang.Object> properties
-
-
Constructor Detail
-
UpdateCheckInstanceImpl
protected UpdateCheckInstanceImpl(UpdateManager _manager, int _check_type, java.lang.String _name, UpdatableComponentImpl[] _components)
-
-
Method Detail
-
getType
public int getType()
Description copied from interface:UpdateCheckInstance
returns one of the above UCI_ constants- Specified by:
getType
in interfaceUpdateCheckInstance
- Returns:
-
getName
public java.lang.String getName()
Description copied from interface:UpdateCheckInstance
returns the name supplied when the instance was created (or "" if it wasn't)- Specified by:
getName
in interfaceUpdateCheckInstance
- Returns:
-
addUpdatableComponent
public void addUpdatableComponent(UpdatableComponent component, boolean mandatory)
Description copied from interface:UpdateCheckInstance
Add a further updatable component to this instance. Must be called before the check process is started- Specified by:
addUpdatableComponent
in interfaceUpdateCheckInstance
-
setAutomatic
public void setAutomatic(boolean a)
- Specified by:
setAutomatic
in interfaceUpdateCheckInstance
-
isAutomatic
public boolean isAutomatic()
- Specified by:
isAutomatic
in interfaceUpdateCheckInstance
-
setLowNoise
public void setLowNoise(boolean a)
- Specified by:
setLowNoise
in interfaceUpdateCheckInstance
-
isLowNoise
public boolean isLowNoise()
- Specified by:
isLowNoise
in interfaceUpdateCheckInstance
-
getProperty
public java.lang.Object getProperty(int property_name)
- Specified by:
getProperty
in interfaceUpdateCheckInstance
-
setProperty
public void setProperty(int property_name, java.lang.Object value)
- Specified by:
setProperty
in interfaceUpdateCheckInstance
-
start
public void start()
- Specified by:
start
in interfaceUpdateCheckInstance
-
startSupport
private void startSupport()
-
addUpdate
protected UpdateImpl addUpdate(UpdatableComponentImpl comp, java.lang.String update_name, java.lang.String[] desc, java.lang.String old_version, java.lang.String new_version, ResourceDownloader[] downloaders, int restart_required)
-
getUpdates
public Update[] getUpdates()
- Specified by:
getUpdates
in interfaceUpdateCheckInstance
-
getCheckers
public UpdateChecker[] getCheckers()
- Specified by:
getCheckers
in interfaceUpdateCheckInstance
-
createInstaller
public UpdateInstaller createInstaller() throws UpdateException
- Specified by:
createInstaller
in interfaceUpdateCheckInstance
- Throws:
UpdateException
-
isCompleteOrCancelled
public boolean isCompleteOrCancelled()
- Specified by:
isCompleteOrCancelled
in interfaceUpdateCheckInstance
-
cancel
public void cancel()
- Specified by:
cancel
in interfaceUpdateCheckInstance
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfaceUpdateCheckInstance
-
getManager
public UpdateManager getManager()
Description copied from interface:UpdateCheckInstance
Access to the update manager- Specified by:
getManager
in interfaceUpdateCheckInstance
- Returns:
-
getDecision
protected java.lang.Object getDecision(Update update, int decision_type, java.lang.String decision_name, java.lang.String decision_description, java.lang.Object decision_data)
-
addDecisionListener
public void addDecisionListener(UpdateManagerDecisionListener l)
- Specified by:
addDecisionListener
in interfaceUpdateCheckInstance
-
removeDecisionListener
public void removeDecisionListener(UpdateManagerDecisionListener l)
- Specified by:
removeDecisionListener
in interfaceUpdateCheckInstance
-
addListener
public void addListener(UpdateCheckInstanceListener l)
- Specified by:
addListener
in interfaceUpdateCheckInstance
-
removeListener
public void removeListener(UpdateCheckInstanceListener l)
- Specified by:
removeListener
in interfaceUpdateCheckInstance
-
-