FileDocCategorySizeDatePackage
UpdateImpl.javaAPI DocAzureus 3.0.3.44741Mon Jul 16 13:51:40 BST 2007org.gudy.azureus2.pluginsimpl.local.update

UpdateImpl

public class UpdateImpl extends Object implements Update
author
parg

Fields Summary
private UpdateCheckInstanceImpl
instance
private String
name
private String[]
description
private String
relative_url_base
private String
new_version
private ResourceDownloader[]
downloaders
private boolean
mandatory
private int
restart_required
private Object
user_object
private List
listeners
private String
description_url
Constructors Summary
protected UpdateImpl(UpdateCheckInstanceImpl _instance, String _name, String[] _desc, String _new_version, ResourceDownloader[] _downloaders, boolean _mandatory, int _restart_required)

	
	
	
			
							
						
							
			
							
								 
	
		instance			= _instance;
		name				= _name;
		description			= _desc;
		new_version			= _new_version;
		downloaders			= _downloaders;
		mandatory			= _mandatory;
		restart_required	= _restart_required;
		
		/*
		System.out.println( "Update:" + name + "/" + new_version + ", mand=" + mandatory + ", restart = " + restart_required  );
		
		for (int i=0;i<description.length;i++){
			
			System.out.println( description[i]);
		}
		
		for (int i=0;i<downloaders.length;i++){
			
			try{
				System.out.println( "  size:" + downloaders[i].getSize());
			}catch( Throwable e ){
				
				e.printStackTrace();
			}
		}
		*/
	
Methods Summary
public voidaddListener(UpdateListener l)

		listeners.add( l );
	
public voidcancel()

		for (int i=0;i<downloaders.length;i++){
			
			try{
				downloaders[i].cancel();
				
			}catch( Throwable e ){
				
				Debug.printStackTrace( e );
			}
		}
	
public voidcomplete()

		for (int i=0;i<listeners.size();i++){
			
			try{
				((UpdateListener)listeners.get(i)).complete( this );
				
			}catch( Throwable e ){
				
				Debug.printStackTrace(e);
			}
		}
	
public UpdateCheckInstancegetCheckInstance()

		return( instance );
	
public java.lang.ObjectgetDecision(int decision_type, java.lang.String decision_name, java.lang.String decision_description, java.lang.Object decision_data)

		return( instance.getDecision( 
				this, decision_type, decision_name, decision_description, decision_data ));
	
public java.lang.StringgetDesciptionURL()

		return description_url;
	
public java.lang.String[]getDescription()

		return( description );
	
public ResourceDownloader[]getDownloaders()

		return( downloaders );
	
public java.lang.StringgetName()

		return( name );
	
public java.lang.StringgetNewVersion()

		return( new_version );
	
public java.lang.StringgetRelativeURLBase()

		return( relative_url_base );
	
public intgetRestartRequired()

		return( restart_required );
	
public java.lang.ObjectgetUserObject()

		return( user_object );
	
public booleanisMandatory()

		return( mandatory );
	
public voidremoveListener(UpdateListener l)

		listeners.remove(l);
	
public voidsetDescriptionURL(java.lang.String url)

		description_url = url;
	
public voidsetRelativeURLBase(java.lang.String base)

		relative_url_base = base;
	
public voidsetRestartRequired(int _restart_required)

		restart_required	= _restart_required;
	
public voidsetUserObject(java.lang.Object obj)

		user_object	= obj;
	
public java.io.InputStreamverifyData(java.io.InputStream is, boolean force)

		return(((UpdateManagerImpl)instance.getManager()).verifyData( this, is, force ));