This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 124717 - Allow setting autoupdate check interval programatically
Summary: Allow setting autoupdate check interval programatically
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Autoupdate (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-04 15:55 UTC by tomwheeler
Modified: 2008-01-13 14:15 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomwheeler 2008-01-04 15:55:51 UTC
While it is possible for the user to manually set the AU check interval (Tools|Plugins|Settings|Check Interval),
according to Jiri Rechtacek on the dev@openide mailing list, there is no way for a platform developer to set this
programmatically.  There should be such a way, because the platform developer is in a position to know how often updates
will be published for a given application.
Comment 1 Jiri Rechtacek 2008-01-09 14:40:44 UTC
I'm going to introduce a launcher option "plugin.manager.check.interval" with possible values: EVERY_STARTUP, EVERY_DAY,
EVERY_WEEK, EVERY_2WEEKS, EVERY_MONTH or NEVER. This option can force default value for Autoupdate module, i.e. if your
application is launched with -J-Dplugin.manager.check.interval=EVERY_STARTUP (or with modified etc/netbeans.conf),
content of subscribed UC will be checked every startup. If an user changes the check interval, future Autoupdate
invocations will read user's values regardless the plugin.manager.check.interval, as usual.

Btw. there is an another way how to force refresh content of AU automatically which works in NB6.0 already, do use
Autoupdate (still under-development) API. Call UpdateUnitProviderFactory.getDefault().refreshProviders(<progress handle
or null>, true) forces refresh content of all UC. You can use it as workaround for application built on NB6.0.
Comment 2 tomwheeler 2008-01-09 17:59:29 UTC
That will fulfill my needs.  Will these constant values be the only ones allowed, or are they just convenient way to
specify a value.  If the interval was specified as a value in minutes, then maybe EVERY_DAY would be 60 * 24, but
someone could still specify another value; 60 * 12, for example, would check twice a day.  Perhaps EVERY_STARTUP could
be 0 and NEVER could be -1, since they are the only special values.

Thanks also for the info on refreshProviders!
Comment 3 Jiri Rechtacek 2008-01-13 14:15:12 UTC
Was implemented in main trunk, future NB6.1M1 is coming soon. Needed some changes in original content of check interval
handling. Now is possible to set the interval in minutes or use predefined values: EVERY_STARTUP, EVERY_DAY, ..., NEVER.
Better documentation of all options like this is tracked as issue 125167.

Checking in Bundle.properties;
/shared/data/ccvs/repository/autoupdate/ui/src/org/netbeans/modules/autoupdate/ui/Bundle.properties,v  <-- 
Bundle.properties
new revision: 1.65; previous revision: 1.64
done
Checking in Utilities.java;
/shared/data/ccvs/repository/autoupdate/ui/src/org/netbeans/modules/autoupdate/ui/Utilities.java,v  <--  Utilities.java
new revision: 1.28; previous revision: 1.27
done
Checking in SettingsTab.java;
/shared/data/ccvs/repository/autoupdate/ui/src/org/netbeans/modules/autoupdate/ui/SettingsTab.java,v  <--  SettingsTab.java
new revision: 1.32; previous revision: 1.31
done
Checking in actions/AutoupdateSettings.java;
/shared/data/ccvs/repository/autoupdate/ui/src/org/netbeans/modules/autoupdate/ui/actions/AutoupdateSettings.java,v  <--
 AutoupdateSettings.java
new revision: 1.3; previous revision: 1.2
done
Checking in actions/AutoupdateCheckScheduler.java;
/shared/data/ccvs/repository/autoupdate/ui/src/org/netbeans/modules/autoupdate/ui/actions/AutoupdateCheckScheduler.java,v
 <--  AutoupdateCheckScheduler.java
new revision: 1.16; previous revision: 1.15
done