diff src/org/tmatesoft/hg/core/SessionContext.java @ 699:a483b2b68a2e

Provisional APIs and respective implementation for http, https and ssh remote repositories
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 08 Aug 2013 19:18:50 +0200
parents 822f3a83ff57
children
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/SessionContext.java	Tue Aug 06 21:18:33 2013 +0200
+++ b/src/org/tmatesoft/hg/core/SessionContext.java	Thu Aug 08 19:18:50 2013 +0200
@@ -18,10 +18,12 @@
 
 import java.net.URI;
 
+import org.tmatesoft.hg.auth.HgAuthenticator;
 import org.tmatesoft.hg.internal.BasicSessionContext;
 import org.tmatesoft.hg.internal.Experimental;
+import org.tmatesoft.hg.internal.remote.BasicAuthenticator;
 import org.tmatesoft.hg.internal.remote.RemoteConnectorDescriptor;
-import org.tmatesoft.hg.repo.HgLookup.RemoteDescriptor;
+import org.tmatesoft.hg.repo.HgRemoteRepository;
 import org.tmatesoft.hg.util.LogFacility;
 import org.tmatesoft.hg.util.Path;
 
@@ -84,10 +86,19 @@
 	 *  
 	 * @return <code>null</code> if supplied URI doesn't point to a remote repository or repositories of that kind are not supported
 	 */
-	@Experimental(reason="Work in progress, provisional API")
-	public RemoteDescriptor getRemoteDescriptor(URI uri) {
+	@Experimental(reason="Provisional API. Work in progress")
+	public HgRemoteRepository.RemoteDescriptor getRemoteDescriptor(URI uri) {
 		return new RemoteConnectorDescriptor.Provider().get(this, uri);
 	}
+	
+	/**
+	 * Facility to perform authentication for a given remote connection
+	 * @return never <code>null</code>
+	 */
+	@Experimental(reason="Provisional API. Work in progress")
+	public HgAuthenticator getAuthenticator(HgRemoteRepository.RemoteDescriptor rd) {
+		return new BasicAuthenticator(getLog());
+	}
 
 	/**
 	 * Providers of the context may implement