public class InMemoryProctorStore extends Object implements ProctorStore
| Modifier and Type | Field and Description |
|---|---|
static String |
REVISION_PREFIX |
| Constructor and Description |
|---|
InMemoryProctorStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTestDefinition(String username,
String password,
String author,
String testName,
TestDefinition testDefinition,
Map<String,String> metadata,
String comment) |
void |
addTestDefinition(String username,
String password,
String testName,
TestDefinition testDefinition,
Map<String,String> metadata,
String comment) |
boolean |
cleanUserWorkspace(String username) |
void |
close() |
void |
deleteTestDefinition(String username,
String password,
String author,
String previousVersion,
String testName,
TestDefinition testDefinition,
String comment) |
void |
deleteTestDefinition(String username,
String password,
String previousVersion,
String testName,
TestDefinition testDefinition,
String comment) |
Map<String,List<Revision>> |
getAllHistories()
Returns a list of revisions grouped by a test.
|
TestDefinition |
getCurrentTestDefinition(String test)
Returns a current test definition of a test in the database.
|
TestMatrixVersion |
getCurrentTestMatrix()
Returns the current test matrix in the database.
|
List<Revision> |
getHistory(String test,
int start,
int limit)
Returns a list of revisions for a test ordered by recency.
|
List<Revision> |
getHistory(String test,
String revision,
int start,
int limit)
Returns a list of revisions for a test when test revision was made ordered by recency.
|
String |
getLatestVersion()
Returns the latest revision id.
|
List<Revision> |
getMatrixHistory(int start,
int limit)
Returns a list of revisions for all tests ordered by recency.
|
String |
getName()
This method returns a name of the ProctorStore instance for logging purpose.
|
RevisionDetails |
getRevisionDetails(String revisionId)
Returns a details of a single revision.
|
TestDefinition |
getTestDefinition(String test,
String fetchRevision)
Returns a test definition of a test when the revision was made.
|
TestMatrixVersion |
getTestMatrix(String fetchRevision)
Returns a test matrix when the revision was made.
|
void |
refresh()
Update the local state with the remote database.
|
void |
updateTestDefinition(String username,
String password,
String author,
String previousVersion,
String testName,
TestDefinition testDefinition,
Map<String,String> metadata,
String comment) |
void |
updateTestDefinition(String username,
String password,
String previousVersion,
String testName,
TestDefinition testDefinition,
Map<String,String> metadata,
String comment)
This is the normal operation that I expect to happen
|
void |
verifySetup()
Verifies the data store object is ready to operate.
|
public static final String REVISION_PREFIX
public String getName()
ProctorStoregetName in interface ProctorStorepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic TestMatrixVersion getCurrentTestMatrix() throws StoreException
ProctorReadergetCurrentTestMatrix in interface ProctorReaderStoreExceptionpublic TestDefinition getCurrentTestDefinition(String test) throws StoreException
ProctorReadergetCurrentTestDefinition in interface ProctorReadertest - name of the testStoreExceptionpublic void verifySetup()
throws StoreException
ProctorReaderverifySetup in interface ProctorReaderverifySetup in interface ProctorWriterStoreException - if it's not ready to operate.public boolean cleanUserWorkspace(String username)
cleanUserWorkspace in interface ProctorWriterpublic void updateTestDefinition(String username, String password, String author, String previousVersion, String testName, TestDefinition testDefinition, Map<String,String> metadata, String comment) throws StoreException.TestUpdateException
updateTestDefinition in interface ProctorWriterStoreException.TestUpdateExceptionpublic void updateTestDefinition(String username, String password, String previousVersion, String testName, TestDefinition testDefinition, Map<String,String> metadata, String comment) throws StoreException.TestUpdateException
ProctorWriterupdateTestDefinition in interface ProctorWriterStoreException.TestUpdateExceptionpublic void deleteTestDefinition(String username, String password, String author, String previousVersion, String testName, TestDefinition testDefinition, String comment) throws StoreException.TestUpdateException
deleteTestDefinition in interface ProctorWriterStoreException.TestUpdateExceptionpublic void deleteTestDefinition(String username, String password, String previousVersion, String testName, TestDefinition testDefinition, String comment) throws StoreException.TestUpdateException
deleteTestDefinition in interface ProctorWriterStoreException.TestUpdateExceptionpublic void addTestDefinition(String username, String password, String author, String testName, TestDefinition testDefinition, Map<String,String> metadata, String comment) throws StoreException.TestUpdateException
addTestDefinition in interface ProctorWriterStoreException.TestUpdateExceptionpublic void addTestDefinition(String username, String password, String testName, TestDefinition testDefinition, Map<String,String> metadata, String comment) throws StoreException.TestUpdateException
addTestDefinition in interface ProctorWriterStoreException.TestUpdateException@Nonnull public String getLatestVersion() throws StoreException
ProctorReadergetLatestVersion in interface ProctorReaderStoreExceptionpublic TestMatrixVersion getTestMatrix(String fetchRevision) throws StoreException
ProctorReadergetTestMatrix in interface ProctorReaderfetchRevision - id of the revisionStoreExceptionpublic TestDefinition getTestDefinition(String test, String fetchRevision) throws StoreException
ProctorReadergetTestDefinition in interface ProctorReadertest - name of the testfetchRevision - id of the revisionStoreException@Nonnull public List<Revision> getMatrixHistory(int start, int limit) throws StoreException
ProctorReadergetMatrixHistory in interface ProctorReaderstart - offset of the first revision (0-indexed)limit - limit of the number of revisionsStoreException@Nonnull public List<Revision> getHistory(String test, int start, int limit) throws StoreException
ProctorReadergetHistory in interface ProctorReadertest - name of the teststart - offset of the first revision (0-indexed)limit - limit of the number of revisionsStoreException@Nonnull public List<Revision> getHistory(String test, String revision, int start, int limit) throws StoreException
ProctorReadergetHistory in interface ProctorReadertest - name of the teststart - offset of the first revision (0-indexed)limit - limit of the number of revisionsStoreException@CheckForNull public RevisionDetails getRevisionDetails(String revisionId) throws StoreException
ProctorReadergetRevisionDetails in interface ProctorReaderrevisionId - id of the revisionStoreException@Nonnull public Map<String,List<Revision>> getAllHistories() throws StoreException
ProctorReadergetAllHistories in interface ProctorReaderStoreExceptionpublic void refresh()
throws StoreException
ProctorReaderrefresh in interface ProctorReaderStoreExceptionCopyright © 2019. All rights reserved.