Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2010-03-03 20:00:39 -0500
committerSusan Franklin2010-03-03 20:00:39 -0500
commitb0a21385ce06e9b8f1cc8b2061b74751faf80590 (patch)
tree73ea01576fbeeccc043736dfbb1c8f3720c5a753 /bundles/org.eclipse.equinox.p2.repository
parentc3b24cfd425d2f8933a5a2f8d9fe4ff10b43bfc8 (diff)
downloadrt.equinox.p2-b0a21385ce06e9b8f1cc8b2061b74751faf80590.tar.gz
rt.equinox.p2-b0a21385ce06e9b8f1cc8b2061b74751faf80590.tar.xz
rt.equinox.p2-b0a21385ce06e9b8f1cc8b2061b74751faf80590.zip
Bug 295399 - [ui] [api] IServiceUI API cleanup
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Credentials.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/RepositoryTransport.java5
3 files changed, 16 insertions, 16 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.repository/META-INF/MANIFEST.MF
index 4ec65b7f0..3a9941058 100644
--- a/bundles/org.eclipse.equinox.p2.repository/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.repository/META-INF/MANIFEST.MF
@@ -41,7 +41,6 @@ Import-Package: javax.xml.parsers,
org.eclipse.equinox.internal.p2.metadata,
org.eclipse.equinox.internal.p2.metadata.index,
org.eclipse.equinox.internal.p2.repository.helpers,
- org.eclipse.equinox.internal.provisional.p2.core,
org.eclipse.equinox.internal.provisional.p2.core.eventbus,
org.eclipse.equinox.p2.core;version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.core.spi;version="[2.0.0,3.0.0)",
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Credentials.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Credentials.java
index 09500c2db..d45e858e3 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Credentials.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Credentials.java
@@ -20,8 +20,8 @@ import org.eclipse.core.runtime.*;
import org.eclipse.ecf.filetransfer.UserCancelledException;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.repository.helpers.DebugHelper;
-import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI;
-import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI.AuthenticationInfo;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
+import org.eclipse.equinox.p2.core.UIServices;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.security.storage.*;
@@ -39,7 +39,7 @@ public class Credentials {
/**
* Cache of auth information that is not persisted, and modified auth info.
*/
- private static final Map<String, AuthenticationInfo> savedAuthInfo = Collections.synchronizedMap(new HashMap<String, AuthenticationInfo>());
+ private static final Map<String, UIServices.AuthenticationInfo> savedAuthInfo = Collections.synchronizedMap(new HashMap<String, UIServices.AuthenticationInfo>());
/**
* Information about retry counts, and prompts canceled by user. The SoftReference is
@@ -68,7 +68,7 @@ public class Credentials {
* @throws CoreException if the password cannot be read or saved
* @return The authentication info.
*/
- public static AuthenticationInfo forLocation(URI location, boolean prompt) throws LoginCanceledException, CoreException {
+ public static UIServices.AuthenticationInfo forLocation(URI location, boolean prompt) throws LoginCanceledException, CoreException {
return forLocation(location, prompt, null);
}
@@ -90,7 +90,7 @@ public class Credentials {
* @throws UserCancelledException - user canceled the prompt for name/password
* @throws CoreException if there is an error
*/
- public static AuthenticationInfo forLocation(URI location, boolean prompt, AuthenticationInfo lastUsed) throws LoginCanceledException, CoreException {
+ public static UIServices.AuthenticationInfo forLocation(URI location, boolean prompt, UIServices.AuthenticationInfo lastUsed) throws LoginCanceledException, CoreException {
String host = uriToHost(location);
String nodeKey;
try {
@@ -125,7 +125,7 @@ public class Credentials {
r.put(host, hostLock);
}
}
- AuthenticationInfo loginDetails = null;
+ UIServices.AuthenticationInfo loginDetails = null;
ISecurePreferences securePreferences = null;
// synchronize getting secure store with prompting user, as it may prompt.
synchronized (promptLock) {
@@ -166,7 +166,7 @@ public class Credentials {
// if we don't have stored connection data just return a null auth info
if (username != null && password != null)
- return new IServiceUI.AuthenticationInfo(username, password, true);
+ return new UIServices.AuthenticationInfo(username, password, true);
}
if (DebugHelper.DEBUG_REPOSITORY_CREDENTIALS) {
DebugHelper.debug("Credentials", "forLocation:PREFNODE NOT FOUND - RETURN FROM MEMORY", // //$NON-NLS-1$ //$NON-NLS-2$
@@ -184,7 +184,7 @@ public class Credentials {
// check if another thread has modified the credentials since last attempt
// made by current thread - if so, try with latest without prompting
if (DebugHelper.DEBUG_REPOSITORY_CREDENTIALS) {
- AuthenticationInfo latest = restoreFromMemory(nodeName);
+ UIServices.AuthenticationInfo latest = restoreFromMemory(nodeName);
boolean useLatest = false;
if (latest != null && lastUsed != null)
if (!(latest.getUserName().equals(lastUsed.getUserName()) && latest.getPassword().equals(lastUsed.getPassword())))
@@ -194,7 +194,7 @@ public class Credentials {
new Object[] {"host", location, "prompt", Boolean.toString(prompt)}); //$NON-NLS-1$ //$NON-NLS-2$
}
- AuthenticationInfo latest = restoreFromMemory(nodeName);
+ UIServices.AuthenticationInfo latest = restoreFromMemory(nodeName);
if (latest != null && lastUsed != null)
if (!(latest.getUserName().equals(lastUsed.getUserName()) && latest.getPassword().equals(lastUsed.getPassword())))
return latest;
@@ -219,7 +219,9 @@ public class Credentials {
throw new LoginCanceledException();
return latest == null ? lastUsed : latest; // keep client failing on the latest known
}
- IServiceUI adminUIService = (IServiceUI) ServiceHelper.getService(Activator.getContext(), IServiceUI.class.getName());
+ IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(Activator.getContext(), IProvisioningAgent.SERVICE_NAME);
+ UIServices adminUIService = (UIServices) agent.getService(UIServices.SERVICE_NAME);
+
if (adminUIService != null)
synchronized (promptLock) {
try {
@@ -320,14 +322,14 @@ public class Credentials {
* Returns authentication details stored in memory for the given node name,
* or <code>null</code> if no information is stored.
*/
- private static AuthenticationInfo restoreFromMemory(String nodeName) {
+ private static UIServices.AuthenticationInfo restoreFromMemory(String nodeName) {
return savedAuthInfo.get(nodeName);
}
/**
* Saves authentication details in memory so user is only prompted once per (SDK) session
*/
- private static void saveInMemory(String nodeName, AuthenticationInfo loginDetails) {
+ private static void saveInMemory(String nodeName, UIServices.AuthenticationInfo loginDetails) {
savedAuthInfo.put(nodeName, loginDetails);
}
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/RepositoryTransport.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/RepositoryTransport.java
index 717920796..3ab7b7ade 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/RepositoryTransport.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/RepositoryTransport.java
@@ -12,8 +12,6 @@
package org.eclipse.equinox.internal.p2.repository;
-import org.eclipse.equinox.p2.core.ProvisionException;
-
import java.io.*;
import java.net.URI;
import org.eclipse.core.runtime.*;
@@ -21,8 +19,9 @@ import org.eclipse.ecf.core.security.ConnectContextFactory;
import org.eclipse.ecf.core.security.IConnectContext;
import org.eclipse.ecf.filetransfer.UserCancelledException;
import org.eclipse.equinox.internal.p2.repository.Credentials.LoginCanceledException;
-import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI.AuthenticationInfo;
import org.eclipse.equinox.internal.provisional.p2.repository.IStateful;
+import org.eclipse.equinox.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.core.UIServices.AuthenticationInfo;
import org.eclipse.osgi.util.NLS;
/**

Back to the top