Saving pushed version ID to db.

This commit is contained in:
Winston Li 2014-12-04 23:58:44 +00:00
parent 0ac263ad45
commit 044f67ea49
3 changed files with 4 additions and 2 deletions

View file

@ -39,7 +39,6 @@ public class AttsResourceHandler extends ResourceHandler {
} catch (InvalidPostbackKeyException e) {
throw new ServletException();
}
System.out.println(multimap);
if (false) {
throw new ServletException();

View file

@ -37,7 +37,7 @@ public class PostbackManager {
}
private PostbackContents getPostbackForProject(String projectName) throws UnexpectedPostbackException {
PostbackContents contents = postbackContentsTable.get(projectName);
PostbackContents contents = postbackContentsTable.remove(projectName);
if (contents == null) {
throw new UnexpectedPostbackException();
}

View file

@ -21,6 +21,7 @@ public class WLProject implements PersistentStoreSource {
private final SnapshotFetcher snapshotFetcher;
private int latestSnapshotID;
private PersistentStoreAPI persistentStore;
public WLProject(String name) {
this.name = name;
@ -60,10 +61,12 @@ public class WLProject implements PersistentStoreSource {
snapshots.put(versionID, new Snapshot(versionID));
snapshotFetcher.putLatestVersion(versionID);
latestSnapshotID = versionID;
persistentStore.addSnapshot(name, versionID);
}
@Override
public void initFromPersistentStore(PersistentStoreAPI persistentStore) {
this.persistentStore = persistentStore;
snapshotFetcher.initFromPersistentStore(persistentStore);
updateLatestSnapshot();
}