Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2010-03-07 12:40:48 -0500
committerSusan Franklin2010-03-07 12:40:48 -0500
commitcbac1dc3a189b4a9a73ecca736f3e9dde5d27686 (patch)
tree4e67f046148eb12944f62e5b1fab0807a7aba2c7 /bundles/org.eclipse.equinox.p2.ui.admin
parent9b2d5617f5d98b6456998bf52881cd7a85398d83 (diff)
downloadrt.equinox.p2-cbac1dc3a189b4a9a73ecca736f3e9dde5d27686.tar.gz
rt.equinox.p2-cbac1dc3a189b4a9a73ecca736f3e9dde5d27686.tar.xz
rt.equinox.p2-cbac1dc3a189b4a9a73ecca736f3e9dde5d27686.zip
Bug 302183 - [operations] ProvisioningSession is weirdv20100307-1300
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.admin')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoryTracker.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoryTracker.java16
2 files changed, 22 insertions, 10 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoryTracker.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoryTracker.java
index 32590953f..ba8ce8de6 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoryTracker.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoryTracker.java
@@ -14,11 +14,13 @@ package org.eclipse.equinox.internal.p2.ui.admin;
import java.net.URI;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.equinox.p2.operations.RepositoryTracker;
import org.eclipse.equinox.p2.repository.IRepository;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
public class ArtifactRepositoryTracker extends RepositoryTracker {
@@ -30,15 +32,15 @@ public class ArtifactRepositoryTracker extends RepositoryTracker {
}
public URI[] getKnownRepositories(ProvisioningSession session) {
- return session.getArtifactRepositoryManager().getKnownRepositories(getArtifactRepositoryFlags());
+ return getArtifactRepositoryManager().getKnownRepositories(getArtifactRepositoryFlags());
}
public void addRepository(URI repoLocation, String nickname, ProvisioningSession session) {
ui.signalRepositoryOperationStart();
try {
- session.getArtifactRepositoryManager().addRepository(repoLocation);
+ getArtifactRepositoryManager().addRepository(repoLocation);
if (nickname != null)
- session.getArtifactRepositoryManager().setRepositoryProperty(repoLocation, IRepository.PROP_NICKNAME, nickname);
+ getArtifactRepositoryManager().setRepositoryProperty(repoLocation, IRepository.PROP_NICKNAME, nickname);
} finally {
ui.signalRepositoryOperationComplete(new RepositoryEvent(repoLocation, IRepository.TYPE_ARTIFACT, RepositoryEvent.ADDED, true), true);
}
@@ -51,7 +53,7 @@ public class ArtifactRepositoryTracker extends RepositoryTracker {
ui.signalRepositoryOperationStart();
try {
for (int i = 0; i < repoLocations.length; i++) {
- session.getArtifactRepositoryManager().removeRepository(repoLocations[i]);
+ getArtifactRepositoryManager().removeRepository(repoLocations[i]);
}
} finally {
ui.signalRepositoryOperationComplete(null, true);
@@ -67,7 +69,7 @@ public class ArtifactRepositoryTracker extends RepositoryTracker {
SubMonitor mon = SubMonitor.convert(monitor, locations.length * 100);
for (int i = 0; i < locations.length; i++) {
try {
- session.getArtifactRepositoryManager().refreshRepository(locations[i], mon.newChild(100));
+ getArtifactRepositoryManager().refreshRepository(locations[i], mon.newChild(100));
} catch (ProvisionException e) {
//ignore problematic repositories when refreshing
}
@@ -76,4 +78,8 @@ public class ArtifactRepositoryTracker extends RepositoryTracker {
// refreshing these, this one, so we do not use a specific repository event to represent it.
ui.signalRepositoryOperationComplete(null, true);
}
+
+ IArtifactRepositoryManager getArtifactRepositoryManager() {
+ return ProvUI.getArtifactRepositoryManager(ui.getSession());
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoryTracker.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoryTracker.java
index 7c95ee6eb..107a53152 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoryTracker.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoryTracker.java
@@ -14,11 +14,13 @@ package org.eclipse.equinox.internal.p2.ui.admin;
import java.net.URI;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.equinox.p2.operations.RepositoryTracker;
import org.eclipse.equinox.p2.repository.IRepository;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
public class MetadataRepositoryTracker extends RepositoryTracker {
@@ -30,15 +32,15 @@ public class MetadataRepositoryTracker extends RepositoryTracker {
}
public URI[] getKnownRepositories(ProvisioningSession session) {
- return session.getMetadataRepositoryManager().getKnownRepositories(getArtifactRepositoryFlags());
+ return getMetadataRepositoryManager().getKnownRepositories(getArtifactRepositoryFlags());
}
public void addRepository(URI repoLocation, String nickname, ProvisioningSession session) {
ui.signalRepositoryOperationStart();
try {
- session.getMetadataRepositoryManager().addRepository(repoLocation);
+ getMetadataRepositoryManager().addRepository(repoLocation);
if (nickname != null)
- session.getMetadataRepositoryManager().setRepositoryProperty(repoLocation, IRepository.PROP_NICKNAME, nickname);
+ getMetadataRepositoryManager().setRepositoryProperty(repoLocation, IRepository.PROP_NICKNAME, nickname);
} finally {
ui.signalRepositoryOperationComplete(new RepositoryEvent(repoLocation, IRepository.TYPE_METADATA, RepositoryEvent.ADDED, true), true);
@@ -52,7 +54,7 @@ public class MetadataRepositoryTracker extends RepositoryTracker {
ui.signalRepositoryOperationStart();
try {
for (int i = 0; i < repoLocations.length; i++) {
- session.getMetadataRepositoryManager().removeRepository(repoLocations[i]);
+ getMetadataRepositoryManager().removeRepository(repoLocations[i]);
}
} finally {
ui.signalRepositoryOperationComplete(null, true);
@@ -68,7 +70,7 @@ public class MetadataRepositoryTracker extends RepositoryTracker {
SubMonitor mon = SubMonitor.convert(monitor, locations.length * 100);
for (int i = 0; i < locations.length; i++) {
try {
- session.getArtifactRepositoryManager().refreshRepository(locations[i], mon.newChild(100));
+ getMetadataRepositoryManager().refreshRepository(locations[i], mon.newChild(100));
} catch (ProvisionException e) {
//ignore problematic repositories when refreshing
}
@@ -77,4 +79,8 @@ public class MetadataRepositoryTracker extends RepositoryTracker {
// refreshing these, this one, so we do not use a specific repository event to represent it.
ui.signalRepositoryOperationComplete(null, true);
}
+
+ IMetadataRepositoryManager getMetadataRepositoryManager() {
+ return ProvUI.getMetadataRepositoryManager(ui.getSession());
+ }
} \ No newline at end of file

Back to the top