|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.lib.ObjectDatabase
org.eclipse.jgit.lib.AlternateRepositoryDatabase
public final class AlternateRepositoryDatabase
An ObjectDatabase of another Repository.
This ObjectDatabase wraps around another Repository's object
database, providing its contents to the caller, and closing the Repository
when this database is closed. The primary user of this class is
ObjectDirectory, when the info/alternates file points at the
objects/ directory of another repository.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jgit.lib.ObjectDatabase |
|---|
NO_ALTERNATES |
| Constructor Summary | |
|---|---|
AlternateRepositoryDatabase(Repository alt)
|
|
| Method Summary | |
|---|---|
protected void |
closeAlternates(ObjectDatabase[] alt)
Close the list of alternates returned by ObjectDatabase.loadAlternates(). |
void |
closeSelf()
Close any resources held by this database only; ignoring alternates. |
void |
create()
Initialize a new object database at this location. |
boolean |
exists()
Does this database exist yet? |
Repository |
getRepository()
|
protected boolean |
hasObject1(AnyObjectId objectId)
Fast half of ObjectDatabase.hasObject(AnyObjectId). |
protected boolean |
hasObject2(java.lang.String objectName)
Slow half of ObjectDatabase.hasObject(AnyObjectId). |
protected ObjectDatabase[] |
loadAlternates()
Load the list of alternate databases into memory. |
protected ObjectLoader |
openObject1(WindowCursor curs,
AnyObjectId objectId)
Fast half of ObjectDatabase.openObject(WindowCursor, AnyObjectId). |
protected ObjectLoader |
openObject2(WindowCursor curs,
java.lang.String objectName,
AnyObjectId objectId)
Slow half of ObjectDatabase.openObject(WindowCursor, AnyObjectId). |
protected boolean |
tryAgain1()
|
| Methods inherited from class org.eclipse.jgit.lib.ObjectDatabase |
|---|
close, closeAlternates, getAlternates, hasObject, openObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AlternateRepositoryDatabase(Repository alt)
alt - the alternate repository to wrap and export.| Method Detail |
|---|
public Repository getRepository()
public void closeSelf()
ObjectDatabase
To fully close this database and its referenced alternates, the caller
should instead invoke ObjectDatabase.close().
closeSelf in class ObjectDatabase
public void create()
throws java.io.IOException
ObjectDatabase
create in class ObjectDatabasejava.io.IOException - the database could not be created.public boolean exists()
ObjectDatabase
exists in class ObjectDatabaseObjectDatabase.create() to create this database location.protected boolean hasObject1(AnyObjectId objectId)
ObjectDatabaseObjectDatabase.hasObject(AnyObjectId).
hasObject1 in class ObjectDatabaseobjectId - identity of the object to test for existence of.
protected boolean tryAgain1()
tryAgain1 in class ObjectDatabaseprotected boolean hasObject2(java.lang.String objectName)
ObjectDatabaseObjectDatabase.hasObject(AnyObjectId).
hasObject2 in class ObjectDatabaseobjectName - identity of the object to test for existence of.
protected ObjectLoader openObject1(WindowCursor curs,
AnyObjectId objectId)
throws java.io.IOException
ObjectDatabaseObjectDatabase.openObject(WindowCursor, AnyObjectId).
openObject1 in class ObjectDatabasecurs - temporary working space associated with the calling thread.objectId - identity of the object to open.
ObjectLoader for accessing the data of the named
object, or null if the object does not exist.
java.io.IOException
protected ObjectLoader openObject2(WindowCursor curs,
java.lang.String objectName,
AnyObjectId objectId)
throws java.io.IOException
ObjectDatabaseObjectDatabase.openObject(WindowCursor, AnyObjectId).
openObject2 in class ObjectDatabasecurs - temporary working space associated with the calling thread.objectName - name of the object to open.objectId - identity of the object to open.
ObjectLoader for accessing the data of the named
object, or null if the object does not exist.
java.io.IOException
protected ObjectDatabase[] loadAlternates()
throws java.io.IOException
ObjectDatabase
This method is invoked by ObjectDatabase.getAlternates() if the alternate list
has not yet been populated, or if ObjectDatabase.closeAlternates() has been
called on this instance and the alternate list is needed again.
If the alternate array is empty, implementors should consider using the
constant ObjectDatabase.NO_ALTERNATES.
loadAlternates in class ObjectDatabasejava.io.IOException - the alternate list could not be accessed. The empty alternate
array ObjectDatabase.NO_ALTERNATES will be assumed by the caller.protected void closeAlternates(ObjectDatabase[] alt)
ObjectDatabaseObjectDatabase.loadAlternates().
closeAlternates in class ObjectDatabasealt - the alternate list, from ObjectDatabase.loadAlternates().
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||