public abstract class JdbcAccountPatchReviewStore extends java.lang.Object implements AccountPatchReviewStore, com.google.gerrit.extensions.events.LifecycleListener
Modifier and Type | Class and Description |
---|---|
static class |
JdbcAccountPatchReviewStore.Module |
AccountPatchReviewStore.PatchSetWithReviewedFiles
Modifier | Constructor and Description |
---|---|
protected |
JdbcAccountPatchReviewStore(org.eclipse.jgit.lib.Config cfg,
SitePaths sitePaths) |
protected |
JdbcAccountPatchReviewStore(javax.sql.DataSource ds) |
Modifier and Type | Method and Description |
---|---|
void |
clearReviewed(com.google.gerrit.reviewdb.client.PatchSet.Id psId)
Clears the reviewed flags for all files in the given patch set for all
users.
|
void |
clearReviewed(com.google.gerrit.reviewdb.client.PatchSet.Id psId,
com.google.gerrit.reviewdb.client.Account.Id accountId,
java.lang.String path)
Clears the reviewed flag for the given file in the given patch set for the
given user.
|
com.google.gwtorm.server.OrmException |
convertError(java.lang.String op,
java.sql.SQLException err) |
static JdbcAccountPatchReviewStore |
createAccountPatchReviewStore(org.eclipse.jgit.lib.Config cfg,
SitePaths sitePaths) |
protected static javax.sql.DataSource |
createDataSource(java.lang.String url) |
void |
createTableIfNotExists() |
void |
dropTableIfExists() |
com.google.common.base.Optional<AccountPatchReviewStore.PatchSetWithReviewedFiles> |
findReviewed(com.google.gerrit.reviewdb.client.PatchSet.Id psId,
com.google.gerrit.reviewdb.client.Account.Id accountId)
Find the latest patch set, that is smaller or equals to the given patch set,
where at least, one file has been reviewed by the given user.
|
java.sql.Connection |
getConnection() |
protected static int |
getSQLStateInt(java.sql.SQLException err) |
void |
markReviewed(com.google.gerrit.reviewdb.client.PatchSet.Id psId,
com.google.gerrit.reviewdb.client.Account.Id accountId,
java.util.Collection<java.lang.String> paths)
Marks the given files in the given patch set as reviewed by the given user.
|
boolean |
markReviewed(com.google.gerrit.reviewdb.client.PatchSet.Id psId,
com.google.gerrit.reviewdb.client.Account.Id accountId,
java.lang.String path)
Marks the given file in the given patch set as reviewed by the given user.
|
void |
start() |
void |
stop() |
protected JdbcAccountPatchReviewStore(org.eclipse.jgit.lib.Config cfg, SitePaths sitePaths)
protected JdbcAccountPatchReviewStore(javax.sql.DataSource ds)
public static JdbcAccountPatchReviewStore createAccountPatchReviewStore(org.eclipse.jgit.lib.Config cfg, SitePaths sitePaths)
protected static javax.sql.DataSource createDataSource(java.lang.String url)
public void start()
start
in interface com.google.gerrit.extensions.events.LifecycleListener
public java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
public void createTableIfNotExists() throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public void dropTableIfExists() throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public void stop()
stop
in interface com.google.gerrit.extensions.events.LifecycleListener
public boolean markReviewed(com.google.gerrit.reviewdb.client.PatchSet.Id psId, com.google.gerrit.reviewdb.client.Account.Id accountId, java.lang.String path) throws com.google.gwtorm.server.OrmException
AccountPatchReviewStore
markReviewed
in interface AccountPatchReviewStore
psId
- patch set IDaccountId
- account ID of the userpath
- file pathtrue
if the reviewed flag was updated, false
if the
reviewed flag was already setcom.google.gwtorm.server.OrmException
- thrown if updating the reviewed flag failedpublic void markReviewed(com.google.gerrit.reviewdb.client.PatchSet.Id psId, com.google.gerrit.reviewdb.client.Account.Id accountId, java.util.Collection<java.lang.String> paths) throws com.google.gwtorm.server.OrmException
AccountPatchReviewStore
markReviewed
in interface AccountPatchReviewStore
psId
- patch set IDaccountId
- account ID of the userpaths
- file pathscom.google.gwtorm.server.OrmException
- thrown if updating the reviewed flag failedpublic void clearReviewed(com.google.gerrit.reviewdb.client.PatchSet.Id psId, com.google.gerrit.reviewdb.client.Account.Id accountId, java.lang.String path) throws com.google.gwtorm.server.OrmException
AccountPatchReviewStore
clearReviewed
in interface AccountPatchReviewStore
psId
- patch set IDaccountId
- account ID of the userpath
- file pathcom.google.gwtorm.server.OrmException
- thrown if clearing the reviewed flag failedpublic void clearReviewed(com.google.gerrit.reviewdb.client.PatchSet.Id psId) throws com.google.gwtorm.server.OrmException
AccountPatchReviewStore
clearReviewed
in interface AccountPatchReviewStore
psId
- patch set IDcom.google.gwtorm.server.OrmException
- thrown if clearing the reviewed flags failedpublic com.google.common.base.Optional<AccountPatchReviewStore.PatchSetWithReviewedFiles> findReviewed(com.google.gerrit.reviewdb.client.PatchSet.Id psId, com.google.gerrit.reviewdb.client.Account.Id accountId) throws com.google.gwtorm.server.OrmException
AccountPatchReviewStore
findReviewed
in interface AccountPatchReviewStore
psId
- patch set IDaccountId
- account ID of the usercom.google.gwtorm.server.OrmException
- thrown if accessing the reviewed flags failedpublic com.google.gwtorm.server.OrmException convertError(java.lang.String op, java.sql.SQLException err)
protected static int getSQLStateInt(java.sql.SQLException err)