|
JavaSVN Home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tmatesoft.svn.core.io.SVNRepositoryFactory
SVNRepositoryFactory is an abstract factory that is responsible for creating an appropriate SVNRepository driver specific for the protocol (svn, http) to use.
Depending on what protocol a user exactly would like to use to access the repository he should first of all set up an appropriate extension of this factory. So, if the user is going to work with the repository via the custom svn-protocol (or svn+ssh) he initially calls:
... import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl; ... //do it once in your application prior to using the library //enables working with a repository via the svn-protocol (over svn and svn+ssh) SVNRepositoryFactoryImpl.setup(); ...
registerRepositoryFactory
). From
this point the SVNRepositoryFactory knows how to create
SVNRepository instances specific for the svn-protocol.
And further the user can create an SVNRepository instance:
... //the user gets an SVNRepository not caring //how it's implemented for the svn-protocol SVNRepository repository = SVNRepositoryFactory.create(location); ...
... import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; ... //do it once in your application prior to using the library //enables working with a repository via the DAV-protocol (over http and https) DAVRepositoryFactory.setup(); ...
NOTE: unfortunately, at present the JavaSVN library doesn't provide an implementation for accessing a Subversion repository via the file:/// protocol (on a local machine), but in future it will be certainly realized.
SVNRepository
,
ExamplesConstructor Summary | |
SVNRepositoryFactory()
|
Method Summary | |
static SVNRepository |
create(SVNURL url)
Creates an SVNRepository driver according to the protocol that is to be used to access a repository. |
static SVNRepository |
create(SVNURL url,
ISVNSession options)
Creates an SVNRepository driver according to the protocol that is to be used to access a repository. |
protected abstract SVNRepository |
createRepositoryImpl(SVNURL url,
ISVNSession session)
|
protected static boolean |
hasRepositoryFactory(String protocol)
|
protected static void |
registerRepositoryFactory(String protocol,
SVNRepositoryFactory factory)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SVNRepositoryFactory()
Method Detail |
protected static void registerRepositoryFactory(String protocol, SVNRepositoryFactory factory)
protected static boolean hasRepositoryFactory(String protocol)
public static SVNRepository create(SVNURL url) throws SVNException
The protocol is defined as the beginning part of the URL schema. Currently JavaSVN supports only svn:// (svn+ssh://) and http:// (https://) schemas.
The created SVNRepository driver can later be "reused" for another
location - that is you can switch it to another repository url not to
create yet one more SVNRepository object. Use the SVNRepository.setLocation()
method for this purpose.
An SVNRepository driver created by this method uses a default
session options driver (ISVNSession.DEFAULT
) which does not
allow to keep a single socket connection opened and commit log messages
caching.
url
- a repository location URL
SVNException
- if there's no implementation for the specified protocol
(the user may have forgotten to register a specific
factory that creates SVNRepository
instances for that protocol or the JavaSVN
library does not support that protocol at all)create(SVNURL, ISVNSession)
,
SVNRepository
public static SVNRepository create(SVNURL url, ISVNSession options) throws SVNException
The protocol is defined as the beginning part of the URL schema. Currently JavaSVN supports only svn:// (svn+ssh://) and http:// (https://) schemas.
The created SVNRepository driver can later be "reused" for another
location - that is you can switch it to another repository url not to
create yet one more SVNRepository object. Use the SVNRepository.setLocation()
method for this purpose.
This method allows to customize a session options driver for an SVNRepository driver. A session options driver must implement the ISVNSession interface. It manages socket connections - says whether an SVNRepository driver may use a single socket connection during the runtime, or it should open a new connection per each repository access operation. And also a session options driver may cache and provide commit log messages during the runtime.
url
- a repository location URLoptions
- a session options driver
SVNException
- if there's no implementation for the specified protocol
(the user may have forgotten to register a specific
factory that creates SVNRepository
instances for that protocol or the JavaSVN
library does not support that protocol at all)create(SVNURL)
,
SVNRepository
protected abstract SVNRepository createRepositoryImpl(SVNURL url, ISVNSession session)
|
JavaSVN Home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |