public class CachingProctorStore extends Object implements ProctorStore
| Constructor and Description |
|---|
CachingProctorStore(ProctorStore delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTestDefinition(ChangeMetadata changeMetadata,
String testName,
TestDefinition testDefinition,
Map<String,String> metadata)
Add new test definition to this store.
|
boolean |
cleanUserWorkspace(String username) |
void |
close() |
void |
deleteTestDefinition(ChangeMetadata changeMetadata,
String previousVersion,
String testName,
TestDefinition testDefinition) |
Map<String,List<Revision>> |
getAllHistories()
Get all the revisions for all tests in history
Same revision may appear in two or more lists if multiple tests are modified in the revision.
|
TestDefinition |
getCurrentTestDefinition(String test) |
TestMatrixVersion |
getCurrentTestMatrix() |
List<Revision> |
getHistory(String test,
int start,
int limit) |
List<Revision> |
getHistory(String test,
String revision,
int start,
int limit) |
String |
getLatestVersion() |
List<Revision> |
getMatrixHistory(Instant start,
Instant limit) |
List<Revision> |
getMatrixHistory(int start,
int limit)
caching is not supported for this method
|
String |
getName()
This method returns a name of the ProctorStore instance for logging purpose.
|
RevisionDetails |
getRevisionDetails(String revisionId) |
TestDefinition |
getTestDefinition(String test,
String fetchRevision) |
List<TestEdit> |
getTestEdits(String testName,
int start,
int limit) |
List<TestEdit> |
getTestEdits(String testName,
String revision,
int start,
int limit) |
TestMatrixVersion |
getTestMatrix(String fetchRevision) |
void |
refresh()
Update the local state with the remote database.
|
static <T> List<T> |
selectHistorySet(List<T> histories,
int start,
int limit)
Deprecated.
Please use
HistoryUtil.selectHistorySet(List, int, int) |
static List<Revision> |
selectRevisionHistorySetFrom(List<Revision> history,
String from,
int start,
int limit)
Deprecated.
|
void |
updateTestDefinition(ChangeMetadata changeMetadata,
String previousVersion,
String testName,
TestDefinition testDefinition,
Map<String,String> metadata)
Following three methods make side-effect and it would trigger cache refreshing at once
|
void |
verifySetup()
Verifies the data store object is ready to operate.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddTestDefinition, addTestDefinition, deleteTestDefinition, deleteTestDefinition, updateTestDefinition, updateTestDefinitionpublic CachingProctorStore(ProctorStore delegate)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic TestMatrixVersion getCurrentTestMatrix() throws StoreException
getCurrentTestMatrix in interface ProctorReaderStoreExceptionpublic TestDefinition getCurrentTestDefinition(String test) throws StoreException
getCurrentTestDefinition in interface ProctorReadertest - name of the test.StoreExceptionpublic void verifySetup()
throws StoreException
ProctorReaderverifySetup in interface ProctorReaderverifySetup in interface ProctorWriterStoreException - if it's not ready to operate.@Nonnull public String getLatestVersion() throws StoreException
getLatestVersion in interface ProctorReaderStoreExceptionpublic TestMatrixVersion getTestMatrix(String fetchRevision) throws StoreException
getTestMatrix in interface ProctorReaderfetchRevision - id of the revisionStoreException - if the revision is not found.public TestDefinition getTestDefinition(String test, String fetchRevision) throws StoreException
getTestDefinition in interface ProctorReadertest - name of the testfetchRevision - id of the revisionStoreException - if the revision is not found.@Nonnull public List<Revision> getMatrixHistory(int start, int limit) throws StoreException
getMatrixHistory in interface ProctorReaderstart - offset of the first revision (0-indexed)limit - limit of the number of revisions, -1 might be usable for unlimited (depending on implementation)StoreException@Nonnull public List<Revision> getMatrixHistory(Instant start, Instant limit) throws StoreException
getMatrixHistory in interface ProctorReaderstart - earliest datelimit - latest dateStoreException - if the revision is not found, or date range is bigger than the implementation allows@Nonnull public List<Revision> getHistory(String test, int start, int limit) throws StoreException
getHistory in interface ProctorReadertest - name of the teststart - offset of the first revision (0-indexed)limit - limit of the number of revisions, -1 might be usable for unlimited (depending on implementation)StoreException@Nonnull public List<Revision> getHistory(String test, String revision, int start, int limit) throws StoreException
getHistory in interface ProctorReadertest - name of the teststart - offset of the first revision (0-indexed)limit - limit of the number of revisions, -1 might be usable for unlimited (depending on implementation)StoreException - if the revision is not found.@CheckForNull public RevisionDetails getRevisionDetails(String revisionId) throws StoreException
getRevisionDetails in interface ProctorReaderrevisionId - id of the revisionStoreException@Nonnull public List<TestEdit> getTestEdits(String testName, int start, int limit) throws StoreException
getTestEdits in interface ProctorReadertestName - to get test editsstart - offset of the first revision (0-indexed)limit - limit of the number of test editsStoreException - if the revision is not found@Nonnull public List<TestEdit> getTestEdits(String testName, String revision, int start, int limit) throws StoreException
getTestEdits in interface ProctorReadertestName - to get test editsrevision - from which the search of test edit is initiatedstart - offset of the first revision (0-indexed)limit - limit of the number of test editsStoreException - if the revision is not found@Nonnull public Map<String,List<Revision>> getAllHistories() throws StoreException
ProctorReadergetAllHistories in interface ProctorReaderStoreExceptionpublic void refresh()
throws StoreException
ProctorReaderrefresh in interface ProctorReaderStoreException@Deprecated public static <T> List<T> selectHistorySet(List<T> histories, int start, int limit)
HistoryUtil.selectHistorySet(List, int, int)@Deprecated public static List<Revision> selectRevisionHistorySetFrom(List<Revision> history, String from, int start, int limit)
HistoryUtil.selectRevisionHistorySetFrom(List, String, int, int)public boolean cleanUserWorkspace(String username)
cleanUserWorkspace in interface ProctorWriterpublic void updateTestDefinition(ChangeMetadata changeMetadata, String previousVersion, String testName, TestDefinition testDefinition, Map<String,String> metadata) throws StoreException.TestUpdateException
updateTestDefinition in interface ProctorWriterStoreException.TestUpdateExceptionpublic void deleteTestDefinition(ChangeMetadata changeMetadata, String previousVersion, String testName, TestDefinition testDefinition) throws StoreException.TestUpdateException
deleteTestDefinition in interface ProctorWriterStoreException.TestUpdateException - whenpublic void addTestDefinition(ChangeMetadata changeMetadata, String testName, TestDefinition testDefinition, Map<String,String> metadata) throws StoreException.TestUpdateException
ProctorWriteraddTestDefinition in interface ProctorWriterStoreException.TestUpdateException - on invalid inputspublic String getName()
ProctorStoregetName in interface ProctorStoreCopyright © 2022. All rights reserved.