Top Description Fields Constructors Methods
org.eclipse.jgit.internal.storage.file

pack-priv Class RefDirectoryUpdate

extends RefUpdate
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.internal.storage.file.SnapshottingRefDirectory.SnapshotRefDirectoryUpdate
Static Imports
org.eclipse.jgit.lib.Constants.encode

Updates any reference stored by RefDirectory.

Field Summary

Modifier and TypeField and Description
private final RefDirectory
private LockFile
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
doAfterLocking(String
the name of the reference.
name
)

Do any actions needed immediately after a lock on the ref is acquired

protected RefUpdate.Result
protected RefUpdate.Result
protected RefDirectory
getRefDatabase()

Implements abstract org.eclipse.jgit.lib.RefUpdate.getRefDatabase.

Get the reference database this update modifies.

protected Repository
getRepository()

Implements abstract org.eclipse.jgit.lib.RefUpdate.getRepository.

Get the repository storing the database's objects.

private String
protected boolean
tryLock(boolean
true if the lock should be taken against the leaf level reference; false if it should be taken exactly against the current reference.
deref
)

Implements abstract org.eclipse.jgit.lib.RefUpdate.tryLock.

Try to acquire the lock on the reference.

protected void
unlock()

Implements abstract org.eclipse.jgit.lib.RefUpdate.unlock.

Releases the lock taken by tryLock if it succeeded.

Inherited from org.eclipse.jgit.lib.RefUpdate:
deletedeletedisableRefLogforceUpdategetExpectedOldObjectIdgetNamegetNewObjectIdgetOldObjectIdgetPushCertificategetRefgetRefLogIdentgetRefLogMessagegetResultisDetachingSymbolicRefisForceRefLogisForceUpdateisRefLogIncludingResultlinksetCheckConflictingsetDetachingSymbolicRefsetExpectedOldObjectIdsetForceRefLogsetForceUpdatesetNewObjectIdsetOldObjectIdsetPushCertificatesetRefLogIdentsetRefLogMessageupdateupdate

Field Detail

databaseback to summary
private final RefDirectory database
lockback to summary
private LockFile lock
shouldDerefback to summary
private boolean shouldDeref

Constructor Detail

RefDirectoryUpdateback to summary
pack-priv RefDirectoryUpdate(RefDirectory r, Ref ref)

Method Detail

doAfterLockingback to summary
protected void doAfterLocking(String name)

Do any actions needed immediately after a lock on the ref is acquired

Parameters
name:String

the name of the reference.

doDeleteback to summary
protected RefUpdate.Result doDelete(RefUpdate.Result status) throws IOException

Implements abstract org.eclipse.jgit.lib.RefUpdate.doDelete.

Doc from org.eclipse.jgit.lib.RefUpdate.doDelete.

Do delete

Parameters
status:RefUpdate.Result

a org.eclipse.jgit.lib.RefUpdate.Result object.

Returns:RefUpdate.Result

result

Annotations
@Override
Exceptions
IOException:
if an IO error occurred
doUpdateback to summary
protected RefUpdate.Result doUpdate(RefUpdate.Result status) throws IOException

Implements abstract org.eclipse.jgit.lib.RefUpdate.doUpdate.

Doc from org.eclipse.jgit.lib.RefUpdate.doUpdate.

Do update

Parameters
status:RefUpdate.Result

a org.eclipse.jgit.lib.RefUpdate.Result object.

Returns:RefUpdate.Result

result

Annotations
@Override
Exceptions
IOException:
if an IO error occurred
getRefDatabaseback to summary
protected RefDirectory getRefDatabase()

Implements abstract org.eclipse.jgit.lib.RefUpdate.getRefDatabase.

Doc from org.eclipse.jgit.lib.RefUpdate.getRefDatabase.

Get the reference database this update modifies.

Returns:RefDirectory

the reference database this update modifies.

Annotations
@Override
getRepositoryback to summary
protected Repository getRepository()

Implements abstract org.eclipse.jgit.lib.RefUpdate.getRepository.

Doc from org.eclipse.jgit.lib.RefUpdate.getRepository.

Get the repository storing the database's objects.

Returns:Repository

the repository storing the database's objects.

Annotations
@Override
toResultStringback to summary
private String toResultString(RefUpdate.Result status)
tryLockback to summary
protected boolean tryLock(boolean deref) throws IOException

Implements abstract org.eclipse.jgit.lib.RefUpdate.tryLock.

Doc from org.eclipse.jgit.lib.RefUpdate.tryLock.

Try to acquire the lock on the reference.

If the locking was successful the implementor must set the current identity value by calling setOldObjectId(ObjectId).

Parameters
deref:boolean

true if the lock should be taken against the leaf level reference; false if it should be taken exactly against the current reference.

Returns:boolean

true if the lock was acquired and the reference is likely protected from concurrent modification; false if it failed.

Annotations
@Override
Exceptions
IOException:
the lock couldn't be taken due to an unexpected storage failure, and not because of a concurrent update.
unlockback to summary
protected void unlock()

Implements abstract org.eclipse.jgit.lib.RefUpdate.unlock.

Doc from org.eclipse.jgit.lib.RefUpdate.unlock.

Releases the lock taken by tryLock if it succeeded.

Annotations
@Override