|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ISVNSession
The ISVNSession interface provides some extra handling operations over SVNRepository objects.
For remote accessing a repository (via svn:// and
http://) SVNRepository drivers open socket connections to
write and read data from. Session objects (implementing ISVNSession) may
enable an SVNRepository object to use a single socket connection during the
whole runtime, or, as an alternative, to use a new socket connection per each
repository access operation (this slows the speed of operation execution since
the operation needs some extra time for opening and closing a socket).
Also ISVNSession allows to cache and retrieve commit messages during runtime.
How to set a session object for an SVNRepository driver:
import org.tmatesoft.svn.core.io.ISVNSession; import org.tmatesoft.svn.core.io.SVNRepositoryFactory; import org.tmatesoft.svn.core.io.SVNRepository; import org.tmatesoft.svn.core.SVNURL; ... ISVNSession session; ... SVNURL url = SVNURL.parseURIEncoded("svn://host/path/to/repos"); try{ SVNRepository repository = SVNRepositoryFactory.create(url, session); ... }catch(SVNException svne){ ... }
SVNRepository,
SVNRepositoryFactory| Field Summary | |
|---|---|
static ISVNSession |
DEFAULT
The same as KEEP_ALIVE. |
static ISVNSession |
KEEP_ALIVE
A session options implementation that simply allows to keep a single connection alive for all data i/o. |
| Method Summary | |
|---|---|
java.lang.String |
getCommitMessage(SVNRepository repository,
long revision)
Retrieves the cached commit message for a particular revision. |
boolean |
hasCommitMessage(SVNRepository repository,
long revision)
Checks if there's a commit message in cache for a particular repository and revision. |
boolean |
keepConnection(SVNRepository repository)
Says if the given SVNRepository object should use a single socket connection (not to open/close a new one for each operation). |
void |
saveCommitMessage(SVNRepository repository,
long revision,
java.lang.String message)
Caches a commit message for the given revision. |
| Field Detail |
|---|
static final ISVNSession KEEP_ALIVE
static final ISVNSession DEFAULT
KEEP_ALIVE. Left for backward
compatibility.
| Method Detail |
|---|
boolean keepConnection(SVNRepository repository)
For examlpe, a session object may hold a number of SVNRepository object references knowing for everyone of them if it should keep a single connection or not.
repository - an SVNRepository driver
repository
should use a single socket connection during the whole runtime,
false - to open/close a new
connection for each repository access operation
void saveCommitMessage(SVNRepository repository,
long revision,
java.lang.String message)
repository - an SVNRepository driver (to distinguish
that repository for which this message is actual)revision - a revision numbermessage - the commit message for revisiongetCommitMessage(SVNRepository, long)
java.lang.String getCommitMessage(SVNRepository repository,
long revision)
getCommitMessage() to
check if there's a message in cache.
repository - an SVNRepository driver (to distinguish
that repository for which a commit message is requested)revision - a revision number
revisionsaveCommitMessage(SVNRepository, long, String)
boolean hasCommitMessage(SVNRepository repository,
long revision)
repository - an SVNRepository driver (to distinguish
that repository for which a commit message is requested)revision - a revision number
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||