Mercurial > hg4j
comparison 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 |
comparison
equal
deleted
inserted
replaced
698:822f3a83ff57 | 699:a483b2b68a2e |
---|---|
16 */ | 16 */ |
17 package org.tmatesoft.hg.core; | 17 package org.tmatesoft.hg.core; |
18 | 18 |
19 import java.net.URI; | 19 import java.net.URI; |
20 | 20 |
21 import org.tmatesoft.hg.auth.HgAuthenticator; | |
21 import org.tmatesoft.hg.internal.BasicSessionContext; | 22 import org.tmatesoft.hg.internal.BasicSessionContext; |
22 import org.tmatesoft.hg.internal.Experimental; | 23 import org.tmatesoft.hg.internal.Experimental; |
24 import org.tmatesoft.hg.internal.remote.BasicAuthenticator; | |
23 import org.tmatesoft.hg.internal.remote.RemoteConnectorDescriptor; | 25 import org.tmatesoft.hg.internal.remote.RemoteConnectorDescriptor; |
24 import org.tmatesoft.hg.repo.HgLookup.RemoteDescriptor; | 26 import org.tmatesoft.hg.repo.HgRemoteRepository; |
25 import org.tmatesoft.hg.util.LogFacility; | 27 import org.tmatesoft.hg.util.LogFacility; |
26 import org.tmatesoft.hg.util.Path; | 28 import org.tmatesoft.hg.util.Path; |
27 | 29 |
28 /** | 30 /** |
29 * Access to objects that might need to be shared between various distinct operations ran during the same working session | 31 * Access to objects that might need to be shared between various distinct operations ran during the same working session |
82 * present implementation provides support for uris handled in the library itself, and likely | 84 * present implementation provides support for uris handled in the library itself, and likely |
83 * most clients need this, even if they supply own SessionContext | 85 * most clients need this, even if they supply own SessionContext |
84 * | 86 * |
85 * @return <code>null</code> if supplied URI doesn't point to a remote repository or repositories of that kind are not supported | 87 * @return <code>null</code> if supplied URI doesn't point to a remote repository or repositories of that kind are not supported |
86 */ | 88 */ |
87 @Experimental(reason="Work in progress, provisional API") | 89 @Experimental(reason="Provisional API. Work in progress") |
88 public RemoteDescriptor getRemoteDescriptor(URI uri) { | 90 public HgRemoteRepository.RemoteDescriptor getRemoteDescriptor(URI uri) { |
89 return new RemoteConnectorDescriptor.Provider().get(this, uri); | 91 return new RemoteConnectorDescriptor.Provider().get(this, uri); |
92 } | |
93 | |
94 /** | |
95 * Facility to perform authentication for a given remote connection | |
96 * @return never <code>null</code> | |
97 */ | |
98 @Experimental(reason="Provisional API. Work in progress") | |
99 public HgAuthenticator getAuthenticator(HgRemoteRepository.RemoteDescriptor rd) { | |
100 return new BasicAuthenticator(getLog()); | |
90 } | 101 } |
91 | 102 |
92 /** | 103 /** |
93 * Providers of the context may implement | 104 * Providers of the context may implement |
94 */ | 105 */ |