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 211406 Details for
Bug 368854
[operations] - "auth fail" task stay on the operations view after being removed
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 generated from Orion
clipboard.txt (text/plain), 8.98 KB, created by
Malgorzata Janczarska
on 2012-02-22 09:47:36 EST
(
hide
)
Description:
patch generated from Orion
Filename:
MIME Type:
Creator:
Malgorzata Janczarska
Created:
2012-02-22 09:47:36 EST
Size:
8.98 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.server.core/src/org/eclipse/orion/internal/server/core/tasks/TaskService.java b/bundles/org.eclipse.orion.server.core/src/org/eclipse/orion/internal/server/core/tasks/TaskService.java >index 07e1017..e5a45c7 100644 >--- a/bundles/org.eclipse.orion.server.core/src/org/eclipse/orion/internal/server/core/tasks/TaskService.java >+++ b/bundles/org.eclipse.orion.server.core/src/org/eclipse/orion/internal/server/core/tasks/TaskService.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2011 IBM Corporation and others. >+ * Copyright (c) 2011, 2012 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -85,20 +85,18 @@ > > private String userId; > private Date deletionDate; >- private Collection<String> tasks; > >- public DeletedTasksNotificationJob(String userId, Date deletionDate, Collection<String> tasks) { >+ public DeletedTasksNotificationJob(String userId, Date deletionDate) { > super("Notyfing task listeners"); > this.userId = userId; > this.deletionDate = deletionDate; >- this.tasks = tasks; > } > > @Override > protected IStatus run(IProgressMonitor monitor) { > synchronized (taskListeners) { > for (TaskModificationListener listener : taskListeners) { >- listener.tasksDeleted(userId, tasks, deletionDate); >+ listener.tasksDeleted(userId, deletionDate); > } > } > return Status.OK_STATUS; >@@ -137,7 +135,7 @@ > return createTask(taskName, userId, null, isIdempotent); > } > >- private TaskInfo internalRemoveTask(String userId, String id) throws TaskOperationException { >+ private TaskInfo internalRemoveTask(String userId, String id, Date dateRemoved) throws TaskOperationException { > TaskInfo task = getTask(userId, id); > if (task == null) > throw new TaskDoesNotExistException(id); >@@ -149,30 +147,32 @@ > if (!taskDeletions.containsKey(userId)) { > taskDeletions.put(userId, new ArrayList<TaskService.TaskDeletion>()); > } >- taskDeletions.get(userId).add(new TaskDeletion(new Date(), id)); >+ int i = taskDeletions.get(userId).size(); >+ while(i>0 && taskDeletions.get(userId).get(i-1).deletionDate.after(dateRemoved)){ >+ i--; >+ } >+ taskDeletions.get(userId).add(i, new TaskDeletion(dateRemoved, id)); > return task; > } > > public void removeTask(String userId, String id) throws TaskOperationException { >- internalRemoveTask(userId, id); >- Set<String> tasks = new HashSet<String>(); >- tasks.add(id); >- notifyDeletionListeners(userId, new Date(), tasks); >+ Date date = new Date(); >+ internalRemoveTask(userId, id, date); >+ notifyDeletionListeners(userId, date); > } > > public void removeCompletedTasks(String userId) { >- Set<String> tasks = new HashSet<String>(); >+ Date date = new Date(); > for (TaskInfo task : getTasks(userId)) { > if (!task.isRunning()) { > try { >- internalRemoveTask(userId, task.getTaskId()); >- tasks.add(task.getTaskId()); >+ internalRemoveTask(userId, task.getTaskId(), date); > } catch (TaskOperationException e) { > LogHelper.log(e); > } > } > } >- notifyDeletionListeners(userId, new Date(), tasks); >+ notifyDeletionListeners(userId, date); > } > > public TaskInfo createTask(String taskName, String userId, ITaskCanceler taskCanceler, boolean isIdempotent) { >@@ -191,8 +191,8 @@ > new TasksNotificationJob(userId, modificationDate).schedule(); > } > >- private void notifyDeletionListeners(String userId, Date deletionDate, Collection<String> tasks) { >- new DeletedTasksNotificationJob(userId, deletionDate, tasks).schedule(); >+ private void notifyDeletionListeners(String userId, Date deletionDate) { >+ new DeletedTasksNotificationJob(userId, deletionDate).schedule(); > } > > public TaskInfo getTask(String userId, String id) { >@@ -256,10 +256,10 @@ > } > } > >- public Collection<String> getTasksDeletedSince(String userId, Date deletedSince) { >+ public synchronized Collection<String> getTasksDeletedSince(String userId, Date deletedSince) { > Set<String> deletedTasks = new HashSet<String>(); > List<TaskDeletion> taskDeletionsList = taskDeletions.get(userId); >- if (taskDeletionsList == null) { >+ if (taskDeletionsList == null || deletedSince==null) { > return deletedTasks; > } > for (int i = taskDeletionsList.size() - 1; i > 0; i--) { >diff --git a/bundles/org.eclipse.orion.server.core/src/org/eclipse/orion/server/core/tasks/TaskModificationListener.java b/bundles/org.eclipse.orion.server.core/src/org/eclipse/orion/server/core/tasks/TaskModificationListener.java >index 23a8da6..1c6c519 100644 >--- a/bundles/org.eclipse.orion.server.core/src/org/eclipse/orion/server/core/tasks/TaskModificationListener.java >+++ b/bundles/org.eclipse.orion.server.core/src/org/eclipse/orion/server/core/tasks/TaskModificationListener.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2011 IBM Corporation and others. >+ * Copyright (c) 2011, 2012 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -10,7 +10,6 @@ > *******************************************************************************/ > package org.eclipse.orion.server.core.tasks; > >-import java.util.Collection; > import java.util.Date; > > /** >@@ -30,6 +29,6 @@ > * Called {@link ITaskService} when tasks are deleted. > * @param tasks a list of tasks that where deleted > */ >- public void tasksDeleted(String userId, Collection<String> taskIds, Date deletedDate); >+ public void tasksDeleted(String userId, Date deletedDate); > > } >diff --git a/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/internal/server/servlets/task/TaskNonotificationRegistry.java b/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/internal/server/servlets/task/TaskNonotificationRegistry.java >index 2805e1e..5024558 100644 >--- a/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/internal/server/servlets/task/TaskNonotificationRegistry.java >+++ b/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/internal/server/servlets/task/TaskNonotificationRegistry.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2011 IBM Corporation and others. >+ * Copyright (c) 2011, 2012 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -94,26 +94,17 @@ > return; > if (!this.userId.equals(userId)) > return; >- notify(modificationDate, service.getTasks(userId, lastNodifications.get(getName()), false), new HashSet<String>()); >+ Date lastNotification = lastNodifications.get(getName()); >+ notify(modificationDate, service.getTasks(userId, lastNotification, false), service.getTasksDeletedSince(userId, lastNotification)); > > } > >- public synchronized void tasksDeleted(String userId, Collection<String> taskIds, Date timestamp) { >+ public synchronized void tasksDeleted(String userId, Date timestamp) { > if (wasNotified) > return; > if (!this.userId.equals(userId)) > return; >- wasNotified = true; >- listeners.remove(getName()); >- try { >- TaskServlet.writeJSONResponse(req, resp, servlet.getTasksList(new ArrayList<TaskInfo>(), taskIds, timestamp, req, resp)); >- lastNodifications.put(getName(), timestamp); >- } catch (Exception e) { >- this.done(new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage(), e)); >- return; >- } >- >- this.done(Status.OK_STATUS); >+ notify(timestamp, new ArrayList<TaskInfo>(), service.getTasksDeletedSince(userId, lastNodifications.get(getName()))); > } > } > >@@ -158,17 +149,11 @@ > if (notifyNow) { > Date timestamp = new Date(); > List<TaskInfo> tasks = service.getTasks(userId, lastNodifications.get(longpollingId) == null ? null : lastNodifications.get(longpollingId), false); >- if (!tasks.isEmpty()) { >- listenerJob.notify(timestamp, tasks, new HashSet<String>()); >+ Collection<String> tasksDeleted = service.getTasksDeletedSince(userId, lastNodifications.get(longpollingId)); >+ if (!tasks.isEmpty() || !tasksDeleted.isEmpty()) { >+ listenerJob.notify(timestamp, tasks, tasksDeleted); > listenerJob.schedule(); > return listenerJob; >- } >- } >- >- if (lastNodifications.get(longpollingId) != null) { >- Collection<String> tasksDeleted = service.getTasksDeletedSince(userId, lastNodifications.get(longpollingId)); >- if (tasksDeleted.size() > 0) { >- listenerJob.notify(new Date(), new ArrayList<TaskInfo>(), tasksDeleted); > } > } >
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 Raw
Actions:
View
Attachments on
bug 368854
:
209634
|
211392
| 211406