Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 82502 Details for
Bug 207498
stop automatic configuration retrieval if already done
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Merged patch
configupdate.txt (text/plain), 22.22 KB, created by
maarten meijer
on 2007-11-08 17:55:54 EST
(
hide
)
Description:
Merged patch
Filename:
MIME Type:
Creator:
maarten meijer
Created:
2007-11-08 17:55:54 EST
Size:
22.22 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.tests >Index: src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java,v >retrieving revision 1.7 >diff -u -r1.7 TaskRepositoryTest.java >--- src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java 5 Nov 2007 18:59:57 -0000 1.7 >+++ src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java 8 Nov 2007 22:40:33 -0000 >@@ -9,6 +9,7 @@ > package org.eclipse.mylyn.tasks.tests; > > import java.net.URL; >+import java.util.Date; > import java.util.Map; > > import junit.framework.TestCase; >@@ -117,4 +118,19 @@ > assertEquals("pwd2", credentials.getPassword()); > } > >+ public void testConfigUpdateStoring() throws Exception { >+ URL url = new URL("http://url"); >+ TaskRepository taskRepository = new TaskRepository("kind", url.toString()); >+ >+ Date stamp = taskRepository.getConfigurationDate(); >+ assertTrue("unset stap returns long ago", stamp.before(new Date())); >+ >+ stamp = taskRepository.updateConfigurationDate(); >+ assertEquals("Time stamp touched", stamp.getTime(), taskRepository.getConfigurationDate().getTime()); >+ >+ stamp.setTime(stamp.getTime() - 1000000L); >+ taskRepository.setConfigurationDate(stamp); >+ assertEquals("Time stamp set", stamp.getTime(), taskRepository.getConfigurationDate().getTime()); >+ } >+ > } >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/internal/tasks/ui/ScheduledTaskListSynchJob.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduledTaskListSynchJob.java,v >retrieving revision 1.28 >diff -u -r1.28 ScheduledTaskListSynchJob.java >--- src/org/eclipse/mylyn/internal/tasks/ui/ScheduledTaskListSynchJob.java 6 Nov 2007 04:23:44 -0000 1.28 >+++ src/org/eclipse/mylyn/internal/tasks/ui/ScheduledTaskListSynchJob.java 8 Nov 2007 22:40:34 -0000 >@@ -8,16 +8,18 @@ > > package org.eclipse.mylyn.internal.tasks.ui; > >-import java.util.Calendar; > import java.util.List; > import java.util.Set; > >+import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.OperationCanceledException; >+import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; > import org.eclipse.core.runtime.SubProgressMonitor; > import org.eclipse.core.runtime.jobs.Job; >+import org.eclipse.mylyn.monitor.core.StatusHandler; > import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; > import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; > import org.eclipse.mylyn.tasks.core.TaskList; >@@ -28,10 +30,12 @@ > > /** > * @author Rob Elves >- * >+ * > * API-3.0 rename to TaskRepositorySynchronizationJob (?) > */ > public class ScheduledTaskListSynchJob extends Job { >+ static private boolean DEBUGCONFIGUPDATE = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.mylyn.tasks.ui/debug/config-update")); >+ > > private static final int UPDATE_ATTRIBUTES_FREQUENCY = 10; > >@@ -43,10 +47,11 @@ > > private TaskList taskList = null; > >+ /** >+ * for testing ONLY! >+ */ > private static long count = 0; > >- private static Calendar lastRepositoryRefresh; >- > private TaskListManager taskListManager; > > private List<TaskRepository> repositories = null; >@@ -112,31 +117,13 @@ > Set<AbstractRepositoryQuery> queries = taskList.getRepositoryQueries(repository.getUrl()); > > // Occasionally request update of repository configuration attributes >- if ((lastRepositoryRefresh == null || lastRepositoryRefresh.get(Calendar.DAY_OF_MONTH) != Calendar.getInstance() >- .get(Calendar.DAY_OF_MONTH)) >- && queries != null && queries.size() > 0) { >- Job updateJob = new Job("Updating attributes for " + repository.getUrl()) { >- >- @Override >- protected IStatus run(IProgressMonitor monitor) { >- try { >- if (connector.isRepositoryConfigurationStale(repository)) { >- connector.updateAttributes(repository, new SubProgressMonitor(monitor, 1)); >- // HACK: A configuration update occurred. Save on behalf of connector which >- // currently can't access the repository manager itself >- TasksUiPlugin.getRepositoryManager().saveRepositories( >- TasksUiPlugin.getDefault().getRepositoriesFilePath()); >- } >- } catch (Exception e) { >- // ignore, since we might not be connected >- } >- return Status.OK_STATUS; >- } >- }; >- //updateJob.setSystem(true); >- updateJob.setPriority(Job.LONG); >- updateJob.schedule(); >- lastRepositoryRefresh = null; >+ try { >+ if (queries != null && queries.size() > 0 && connector.isRepositoryConfigurationStale(repository)) { >+ updateConfigurationWithJob(repository, connector); >+ if(DEBUGCONFIGUPDATE) System.out.println("Performing Scheduled config update for: " + repository.toString()); >+ } >+ } catch (CoreException e) { >+ StatusHandler.fail(e, "Error retrieving configuration status for " + repository.getUrl(), false); > } > > synchronizationManager.synchronize(connector, repository, queries, null, Job.DECORATE, 0, false, >@@ -146,9 +133,6 @@ > } > } finally { > count = count >= UPDATE_ATTRIBUTES_FREQUENCY ? 0 : count + 1; >- if (lastRepositoryRefresh == null) { >- lastRepositoryRefresh = Calendar.getInstance(); >- } > if (monitor != null) { > monitor.done(); > } >@@ -156,6 +140,36 @@ > return Status.OK_STATUS; > } > >+ /** >+ * Update the configuration file for the repository. >+ * >+ * @param repository >+ * @param connector >+ */ >+ private void updateConfigurationWithJob(final TaskRepository repository, final AbstractRepositoryConnector connector) { >+ Job updateJob = new Job("Updating attributes for " + repository.getUrl()) { >+ >+ @Override >+ protected IStatus run(IProgressMonitor monitor) { >+ try { >+ connector.updateAttributes(repository, new SubProgressMonitor(monitor, 1)); >+ // HACK: A configuration update occurred. Save on behalf of connector which >+ // currently can't access the repository manager itself >+ repository.updateConfigurationDate(); >+ TasksUiPlugin.getRepositoryManager().saveRepositories( >+ // ignore, since we might not be connected >+ TasksUiPlugin.getDefault().getRepositoriesFilePath()); >+ } catch (Exception e) { >+ // ignore, since we might not be connected >+ } >+ return Status.OK_STATUS; >+ } >+ }; >+ //updateJob.setSystem(true); >+ updateJob.setPriority(Job.LONG); >+ updateJob.schedule(); >+ } >+ > public void setSchedule(long schedule) { > this.scheduleDelay = schedule; > } >@@ -165,13 +179,15 @@ > } > > /** >- * for testing purposes >+ * for testing purposes ONLY! > */ > public static long getCount() { > return count; > } > >- /** for testing */ >+ /** >+ * for testing purposes ONLY! >+ */ > public static void resetCount() { > try { > if (TasksUiPlugin.getSynchronizationScheduler().getRefreshJob() != null) { >Index: .options >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/.options,v >retrieving revision 1.1 >diff -u -r1.1 .options >--- .options 24 Oct 2007 19:16:14 -0000 1.1 >+++ .options 8 Nov 2007 22:40:34 -0000 >@@ -1 +1,4 @@ >-org.eclipse.mylyn.tasks.ui/debug/httpclient=true >\ No newline at end of file >+org.eclipse.mylyn.tasks.ui/debug/httpclient=true >+org.eclipse.mylyn.tasks.ui/debug/gzip-get=true >+org.eclipse.mylyn.tasks.ui/debug/gzip-post=true >+org.eclipse.mylyn.tasks.ui/debug/config-update=true >\ No newline at end of file >#P org.eclipse.mylyn.bugzilla.core >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java,v >retrieving revision 1.84 >diff -u -r1.84 BugzillaRepositoryConnector.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 11 Oct 2007 21:01:35 -0000 1.84 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 8 Nov 2007 22:40:36 -0000 >@@ -464,25 +464,34 @@ > } > } > >+ /** >+ * BugzillaReplositoryConnector also tests the configuration date on the server using a HEAD request and Last-Modified header. >+ * @param repository >+ * @throws CoreException >+ * @return true when the configuration needs updating >+ */ >+ @Override > public boolean isRepositoryConfigurationStale(TaskRepository repository) throws CoreException { >- >- boolean result = true; >- try { >- BugzillaClient client = getClientManager().getClient(repository); >- if (client != null) { >- String timestamp = client.getConfigurationTimestamp(); >- if (timestamp != null) { >- String oldTimestamp = repository.getProperty(IBugzillaConstants.PROPERTY_CONFIGTIMESTAMP); >- if (oldTimestamp != null) { >- result = !timestamp.equals(oldTimestamp); >+ if (super.isRepositoryConfigurationStale(repository)) { >+ boolean result = true; >+ try { >+ BugzillaClient client = getClientManager().getClient(repository); >+ if (client != null) { >+ String timestamp = client.getConfigurationTimestamp(); >+ if (timestamp != null) { >+ String oldTimestamp = repository.getProperty(IBugzillaConstants.PROPERTY_CONFIGTIMESTAMP); >+ if (oldTimestamp != null) { >+ result = !timestamp.equals(oldTimestamp); >+ } >+ repository.setProperty(IBugzillaConstants.PROPERTY_CONFIGTIMESTAMP, timestamp); > } >- repository.setProperty(IBugzillaConstants.PROPERTY_CONFIGTIMESTAMP, timestamp); > } >+ } catch (MalformedURLException e) { >+ StatusHandler.fail(e, "Error retrieving configuration timestamp for " + repository.getUrl(), false); > } >- } catch (MalformedURLException e) { >- StatusHandler.fail(e, "Error retrieving configuration timestamp for " + repository.getUrl(), false); >+ return result; > } >- return result; >+ return false; > } > > public void updateAttributeOptions(TaskRepository taskRepository, RepositoryTaskData existingReport) >@@ -522,12 +531,12 @@ > > /** > * Adds bug attributes to new bug model and sets defaults >- * >+ * > * @param proxySettings > * TODO > * @param characterEncoding > * TODO >- * >+ * > */ > public static void setupNewBugAttributes(TaskRepository taskRepository, RepositoryTaskData newTaskData) > throws CoreException { >#P org.eclipse.mylyn.tasks.core >Index: src/org/eclipse/mylyn/tasks/core/TaskRepository.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java,v >retrieving revision 1.43 >diff -u -r1.43 TaskRepository.java >--- src/org/eclipse/mylyn/tasks/core/TaskRepository.java 5 Nov 2007 18:59:57 -0000 1.43 >+++ src/org/eclipse/mylyn/tasks/core/TaskRepository.java 8 Nov 2007 22:40:38 -0000 >@@ -11,6 +11,7 @@ > import java.net.MalformedURLException; > import java.net.Proxy; > import java.net.URL; >+import java.util.Date; > import java.util.HashMap; > import java.util.LinkedHashMap; > import java.util.Map; >@@ -20,6 +21,7 @@ > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.PlatformObject; > import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants; >+import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil; > import org.eclipse.mylyn.monitor.core.StatusHandler; > import org.eclipse.mylyn.web.core.WebClientUtil; > import org.eclipse.mylyn.web.core.WebCredentials; >@@ -36,7 +38,7 @@ > * <li>The solution we have come up with thus far is not to interpret the date as a DATE object but rather simply use > * the date string given to us by the repository itself.</li> > * </ul> >- * >+ * > * @author Mik Kersten > * @author Rob Elves > * @author Eugene Kuleshov >@@ -139,10 +141,14 @@ > private Map<String, String> transientProperties = new HashMap<String, String>(); > > /* >- * TODO: should be externalized and added to extension point, see bug 183606 >+ * TODO: should be externalized and added to extension point, see bug 183606 > */ > private boolean isBugRepository = false; > >+ public static final String LAST_CONFIG_REFRESH = "config.lastupdate"; >+ >+ private static final long LONG_AGO = 1000L * 3600L * 48L; // 48 hrs ago >+ > /** > * for testing purposes > */ >@@ -194,7 +200,7 @@ > > /** > * <b>Note: </b> This method will be deprecated in 2.3. >- * >+ * > * @see #getCredentials(Type) > */ > public boolean hasCredentials() { >@@ -221,7 +227,7 @@ > > /** > * <b>Note: </b> This method will be deprecated in 2.3. >- * >+ * > * @see #getCredentials(Type) > */ > public String getProxyUsername() { >@@ -230,7 +236,7 @@ > > /** > * <b>Note: </b> This method will be deprecated in 2.3. >- * >+ * > * @see #getCredentials(Type) > */ > public String getProxyPassword() { >@@ -239,7 +245,7 @@ > > /** > * <b>Note: </b> This method will be deprecated in 2.3. >- * >+ * > * @see #getCredentials(Type) > */ > public String getHttpUser() { >@@ -248,7 +254,7 @@ > > /** > * <b>Note: </b> This method will be deprecated in 2.3. >- * >+ * > * @see #getCredentials(Type) > */ > public String getHttpPassword() { >@@ -257,7 +263,7 @@ > > /** > * <b>Note: </b> This method will be deprecated in 2.3. >- * >+ * > * @see #setCredentials(Type, WebCredentials, boolean) > */ > public void setAuthenticationCredentials(String username, String password) { >@@ -266,7 +272,7 @@ > > /** > * <b>Note: </b> This method will be deprecated in 2.3. >- * >+ * > * @see #setCredentials(Type, WebCredentials, boolean) > */ > public void setProxyAuthenticationCredentials(String username, String password) { >@@ -275,7 +281,7 @@ > > /** > * <b>Note: </b> This method will be deprecated in 2.3. >- * >+ * > * @see #setCredentials(Type, WebCredentials, boolean) > */ > public void setHttpAuthenticationCredentials(String username, String password) { >@@ -300,7 +306,7 @@ > public void flushAuthenticationCredentials() { > synchronized (LOCK) { > isCachedUserName = false; >- >+ > transientProperties.clear(); > > // API30: legacy support for versions prior to 2.2 that did not set the enable flag, remove for 3.0 >@@ -533,7 +539,7 @@ > > /** > * <b>Note: </b> This method will be deprecated in 2.3. >- * >+ * > * @see #setCredentials(Type, WebCredentials, boolean) > */ > public void setAnonymous(boolean b) { >@@ -542,7 +548,7 @@ > > /** > * <b>Note: </b> This method will be deprecated in 2.3. >- * >+ * > * @see #getCredentials(Type) > */ > public boolean isAnonymous() { >@@ -571,7 +577,7 @@ > public boolean getSavePassword(Type authType) { > String value = getProperty(getKeyPrefix(authType) + SAVE_PASSWORD); > return value != null && "true".equals(value); >- } >+ } > > private static String getKeyPrefix(Type type) { > switch (type) { >@@ -587,7 +593,7 @@ > > /** > * Returns the credentials for an authentication type. >- * >+ * > * @param authType > * the type of authentication > * @return null, if no credentials are set for <code>authType</code> >@@ -628,7 +634,7 @@ > > /** > * Sets the credentials for <code>authType</code>. >- * >+ * > * @param authType > * the type of authentication > * @param credentials >@@ -688,7 +694,8 @@ > private String getUserName(WebCredentials.Type authType) { > WebCredentials credentials = getCredentials(authType); > return (credentials != null) ? credentials.getUserName() : null; >- } >+ } >+ > > /** > * Legacy support for < 2.2. Remove in 2.3. >@@ -698,4 +705,52 @@ > return (credentials != null) ? credentials.getPassword() : null; > } > >+ >+ /** >+ * Get the last <em>successful</em> refresh date as initialized {@link Date} object.<br /> >+ * Internal representation is {@link String} determined by {@link TaskActivityUtil}.<br /> >+ * See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=207660">bug >+ * 207660: do not update repository configuration on every startup</a> >+ * @return {@link Date} set to last config update OR LONG_AGO if not found >+ * >+ * @since 2.2 >+ */ >+ final public Date getConfigurationDate() { >+ String value = this.getProperty(LAST_CONFIG_REFRESH); >+ Date stamp = null; >+ if(null != value) { >+ stamp = TaskActivityUtil.stringToDate(value); >+ } else { >+ stamp = new Date((new Date()).getTime() - LONG_AGO); >+ } >+ return stamp; >+ } >+ >+ /** >+ * Utility method, set the Configuration Timestamp to now AND return it. Use to set >+ * date when <em>successful</em> update occurred. >+ * >+ * @since 2.2 >+ */ >+ final public Date updateConfigurationDate() { >+ Date now = new Date(); >+ this.setConfigurationDate(now); >+ return now; >+ } >+ >+ /** >+ * set the Configuration Timestamp to the {@link Date} indicated after a succesful update. >+ * >+ * The last <em>successful</em> configuration update day is persisted as {@link String} determined in {@link TaskActivityUtil}.<br /> >+ * See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=207660">bug >+ * 207660: do not update repository configuration on every startup</a> >+ * @param {@link Date} setting the day >+ * >+ * @since 2.2 >+ */ >+ final public void setConfigurationDate(final Date timeStamp) { >+ this.setProperty(LAST_CONFIG_REFRESH, TaskActivityUtil.dateToString(timeStamp)); >+ // should persist here, but that can only be done by the TaskRepositoryManager >+ // However this is also included when persisting ordinary sync time >+ } > } >Index: src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java,v >retrieving revision 1.59 >diff -u -r1.59 AbstractRepositoryConnector.java >--- src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java 1 Nov 2007 22:38:38 -0000 1.59 >+++ src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java 8 Nov 2007 22:40:38 -0000 >@@ -24,7 +24,7 @@ > /** > * Encapsulates common operations that can be performed on a task repository. Extend to connect with a Java API or WS > * API for accessing the repository. >- * >+ * > * @author Mik Kersten > * @author Rob Elves > * @since 2.0 >@@ -33,6 +33,10 @@ > > protected Set<RepositoryTemplate> templates = new LinkedHashSet<RepositoryTemplate>(); > >+ private static final long HOUR = 1000L * 3600L; >+ >+ private static final long DAY = HOUR * 24L; >+ > protected TaskList taskList; > > private boolean userManaged = true; >@@ -148,14 +152,14 @@ > > /** > * Utility method for construction of connector specific task object TODO: Move to 'task' factory >- * >+ * > * @return instance of AbstractTask > */ > public abstract AbstractTask createTask(String repositoryUrl, String id, String summary); > > /** > * Implementors must execute query synchronously. >- * >+ * > * @param query > * @param repository > * TODO >@@ -180,10 +184,10 @@ > * Updates the properties of <code>repositoryTask</code>. Invoked when on task synchronization if > * {@link #getTaskDataHandler()} returns <code>null</code> or > * {@link AbstractTaskDataHandler#getTaskData(TaskRepository, String)} returns <code>null</code>. >- * >+ * > * <p> > * Connectors that provide {@link RepositoryTaskData} objects for all tasks do not need to implement this method. >- * >+ * > * @param repository > * the repository > * @param repositoryTask >@@ -197,7 +201,7 @@ > > /** > * Updates task with latest information from {@code taskData} >- * >+ * > * @since 2.0 > */ > public abstract void updateTaskFromTaskData(TaskRepository repository, AbstractTask repositoryTask, >@@ -205,7 +209,7 @@ > > /** > * Updates <code>existingTask</code> with latest information from <code>queryHit</code>. >- * >+ * > * @return true, if properties of <code>existingTask</code> were changed > * @since 2.0 > */ >@@ -255,20 +259,20 @@ > /** > * Of <code>tasks</code> provided, return all that have changed since last synchronization of > * <code>repository</code>. >- * >+ * > * Tasks that need to be synchronized (i.e. task data updated) should be passed to > * <code>collector.accept(Task)</code> method, or if repository connector can update task data, it can use > * <code>collector.accept(RepositoryTaskData)</code> call. >- * >+ * > * All errors should be thrown as <code>CoreException</code> for the framework to handle, since background > * synchronizations fail silently when disconnected. >- * >+ * > * @param tasks > * TODO >- * >+ * > * @return null if there was no tasks changed in the repository, otherwise collection of updated tasks (within > * <code>tasks</code> collection), so empty collection means that there are some other tasks changed >- * >+ * > * @throws CoreException > */ > public abstract boolean markStaleTasks(TaskRepository repository, Set<AbstractTask> tasks, IProgressMonitor monitor) >@@ -298,7 +302,7 @@ > > /** > * Used for referring to the task in the UI. >- * >+ * > * @return > */ > public String getTaskIdPrefix() { >@@ -307,17 +311,35 @@ > > /** > * Reset and update the repository attributes from the server (e.g. products, components) >- * >+ * > * API-3.0: Rename to updateRepositoryConfiguration() > */ > public abstract void updateAttributes(TaskRepository repository, IProgressMonitor monitor) throws CoreException; > > /** >+ * Default implementation returns true every 24hrs (since 2.2). Before 2.2 returned true always. >+ * Override this in implementations and check to see whether repository is online (return >+ * false if off-line), and add connector specific tests: query the repository using head requests, etc.<br /> >+ * <em>Repository configurations are usually quite large, and Mylyn must try to be well-behaved.</em> >+ * > * @return true to indicate that the repository configuration is stale and requires update > * @throws CoreException >+ * >+ * @since 2.2 > */ > public boolean isRepositoryConfigurationStale(TaskRepository repository) throws CoreException { >- return true; >+ boolean isStale = true; >+ Date configDate = repository.getConfigurationDate(); >+ if (configDate != null) { >+ isStale = (new Date().getTime() - configDate.getTime()) > DAY; >+ } >+ >+// do not set, as we don't know whether it was susccesfully update yet. >+// if (isStale) { >+// repository.setConfigurationDate(new Date()); >+// } >+ >+ return isStale; > } > > public void setUserManaged(boolean userManaged) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 207498
:
81642
|
81643
|
81647
|
81890
|
82010
|
82011
|
82012
|
82280
|
82281
|
82408
|
82409
| 82502 |
82503