Package com.google.gerrit.server.update
Interface Context
-
- All Known Subinterfaces:
ChangeContext
,RepoContext
public interface Context
Context for performing aBatchUpdate
.A single update may span multiple changes, but they all belong to a single repo.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Account
getAccount()
Get the account of the user performing the update.default Account.Id
getAccountId()
Get the account ID of the user performing the update.ReviewDb
getDb()
Get the ReviewDb database.default IdentifiedUser
getIdentifiedUser()
Get the identified user performing the update.Order
getOrder()
Get the order in which operations are executed in this update.Project.NameKey
getProject()
Get the project name this update operates on.RepoView
getRepoView()
Get a read-only view of the open repository for this project.org.eclipse.jgit.revwalk.RevWalk
getRevWalk()
Get a walk for this project.TimeZone
getTimeZone()
Get the time zone in which this update takes place.CurrentUser
getUser()
Get the user performing the update.Timestamp
getWhen()
Get the timestamp at which this update takes place.
-
-
-
Method Detail
-
getProject
Project.NameKey getProject()
Get the project name this update operates on.- Returns:
- project.
-
getRepoView
RepoView getRepoView() throws IOException
Get a read-only view of the open repository for this project.Will be opened lazily if necessary.
- Returns:
- repository instance.
- Throws:
IOException
- if an error occurred opening the repo.
-
getRevWalk
org.eclipse.jgit.revwalk.RevWalk getRevWalk() throws IOException
Get a walk for this project.The repository will be opened lazily if necessary; callers should not close the walk.
- Returns:
- walk.
- Throws:
IOException
- if an error occurred opening the repo.
-
getWhen
Timestamp getWhen()
Get the timestamp at which this update takes place.- Returns:
- timestamp.
-
getTimeZone
TimeZone getTimeZone()
Get the time zone in which this update takes place.In the current implementation, this is always the time zone of the server.
- Returns:
- time zone.
-
getDb
ReviewDb getDb()
Get the ReviewDb database.Callers should not manage transactions or call mutating methods on the Changes table. Mutations on other tables (including other entities in the change entity group) are fine.
- Returns:
- open database instance.
-
getUser
CurrentUser getUser()
Get the user performing the update.In the current implementation, this is always an
IdentifiedUser
orInternalUser
.- Returns:
- user.
-
getOrder
Order getOrder()
Get the order in which operations are executed in this update.- Returns:
- order of operations.
-
getIdentifiedUser
default IdentifiedUser getIdentifiedUser()
Get the identified user performing the update.Convenience method for
getUser().asIdentifiedUser()
.- Returns:
- user.
- See Also:
CurrentUser.asIdentifiedUser()
-
getAccount
default Account getAccount()
Get the account of the user performing the update.Convenience method for
getIdentifiedUser().getAccount()
.- Returns:
- account.
- See Also:
CurrentUser.asIdentifiedUser()
-
getAccountId
default Account.Id getAccountId()
Get the account ID of the user performing the update.Convenience method for
getUser().getAccountId()
- Returns:
- account ID.
- See Also:
CurrentUser.getAccountId()
-
-