public class H2AccountPatchReviewStore extends Object implements AccountPatchReviewStore, LifecycleListener
Modifier and Type | Class and Description |
---|---|
static class |
H2AccountPatchReviewStore.InMemoryModule |
static class |
H2AccountPatchReviewStore.Module |
Modifier and Type | Method and Description |
---|---|
void |
clearReviewed(PatchSet.Id psId)
Clears the reviewed flags for all files in the given patch set for all users.
|
void |
clearReviewed(PatchSet.Id psId,
Account.Id accountId,
String path)
Clears the reviewed flag for the given file in the given patch set for the given user.
|
static com.google.gwtorm.server.OrmException |
convertError(String op,
SQLException err) |
static void |
createTableIfNotExists(String url) |
static void |
dropTableIfExists(String url) |
Collection<String> |
findReviewed(PatchSet.Id psId,
Account.Id accountId)
Returns the paths of all files in the given patch set the have been reviewed by the given user.
|
static String |
getUrl(SitePaths sitePaths) |
void |
markReviewed(PatchSet.Id psId,
Account.Id accountId,
Collection<String> paths)
Marks the given files in the given patch set as reviewed by the given user.
|
boolean |
markReviewed(PatchSet.Id psId,
Account.Id accountId,
String path)
Marks the given file in the given patch set as reviewed by the given user.
|
void |
start()
Invoked when the server is starting.
|
void |
stop()
Invoked when the server is stopping.
|
public void start()
LifecycleListener
start
in interface LifecycleListener
public static void createTableIfNotExists(String url) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public static void dropTableIfExists(String url) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public void stop()
LifecycleListener
stop
in interface LifecycleListener
public boolean markReviewed(PatchSet.Id psId, Account.Id accountId, 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(PatchSet.Id psId, Account.Id accountId, Collection<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(PatchSet.Id psId, Account.Id accountId, 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(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 Collection<String> findReviewed(PatchSet.Id psId, 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 static com.google.gwtorm.server.OrmException convertError(String op, SQLException err)