Brought javadocs up to date with current api behavior in AVMService.

Got rid of a redundant and mostly unused method, the createSnapshot()
that takes a List of names.  Adjusted to fit.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4453 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-11-29 03:04:53 +00:00
parent 99e428afaa
commit 23a1a5657d
6 changed files with 189 additions and 227 deletions

View File

@@ -207,13 +207,6 @@ public interface AVMRemote
*/
public int getLatestSnapshotID(String storeName);
/**
* Snapshot the given AVMStores.
* @param stores A List of the names of the stores to snapshot.
* @return A List of the version ids of the newly created snapshots.
*/
public List<Integer> createSnapshot(List<String> stores);
/**
* Snapshot an AVMStore.
* @param store The name of the AVMStore to snapshot.

View File

@@ -573,7 +573,7 @@ public class AVMRemoteImpl implements AVMRemote, Runnable
*/
public int getLatestVersionID(String storeName)
{
return fAVMService.getLatestVersionID(storeName);
return fAVMService.getNextVersionID(storeName);
}
/**
@@ -586,16 +586,6 @@ public class AVMRemoteImpl implements AVMRemote, Runnable
return fAVMService.getLatestSnapshotID(storeName);
}
/**
* Snapshot the given AVMStores.
* @param stores A List of the names of the stores to snapshot.
* @return A List of the version ids of the newly created snapshots.
*/
public List<Integer> createSnapshot(List<String> stores)
{
return fAVMService.createSnapshot(stores);
}
// TODO update this if it's ever needed.
/**
* Snapshot an AVMStore.

View File

@@ -557,7 +557,7 @@ public class AVMServiceImpl implements AVMService
* @param repName The name of the AVMStore.
* @return The Latest Version ID.
*/
public int getLatestVersionID(String repName)
public int getNextVersionID(String repName)
{
if (repName == null)
{
@@ -581,21 +581,7 @@ public class AVMServiceImpl implements AVMService
return fAVMRepository.getLatestSnapshotID(storeName);
}
/**
* Create snapshots of a group of AVMStores.
* @param stores A List of AVMStore names.
* @return A List of the new version ids.
*/
public List<Integer> createSnapshot(List<String> stores)
{
if (stores == null)
{
throw new AVMBadArgumentException("Stores is null.");
}
return fAVMRepository.createSnapshot(stores);
}
/**
/*
* Snapshot an AVMRepository.
* @param store The name of the AVMStore.
* @param tag The short description.

View File

@@ -1375,7 +1375,7 @@ public class AVMServiceTest extends AVMServiceTestBase
checkHistory(history, "main");
// Everything under /abranch should be identical in this version
// and the previous.
int version = fService.getLatestVersionID("main");
int version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/abranch", version - 1, true),
recursiveContents("main:/abranch", version - 2, true));
// Make a branch within a branch.
@@ -1384,7 +1384,7 @@ public class AVMServiceTest extends AVMServiceTestBase
// History unchanged
checkHistory(history, "main");
// Everything under /a should be unchanged between this version and the last.
version = fService.getLatestVersionID("main");
version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/a", version - 1, true),
recursiveContents("main:/a", version - 2, true));
// Make a branch to something outside of a branch inside a branch.
@@ -1398,7 +1398,7 @@ public class AVMServiceTest extends AVMServiceTestBase
// History unchanged.
checkHistory(history, "main");
// d should not have changed since the previous version.
version = fService.getLatestVersionID("main");
version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/d", version - 1, true),
recursiveContents("main:/d", version - 2, true));
for (String val : history.values())
@@ -1472,7 +1472,7 @@ public class AVMServiceTest extends AVMServiceTestBase
checkHistory(history, "main");
// /d should be unchanged before this version and the last
// and /g should be unchanged between this version and the last.
int version = fService.getLatestVersionID("main");
int version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/d", version - 1, true),
recursiveContents("main:/d", version - 2, true));
assertEquals(recursiveContents("main:/g", version - 1, true),
@@ -1483,7 +1483,7 @@ public class AVMServiceTest extends AVMServiceTestBase
// History unchanged.
checkHistory(history, "main");
// /g should not have changed since its last version.
version = fService.getLatestVersionID("main");
version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/g", version - 1, true),
recursiveContents("main:/g", version - 2, true));
// /layer/under/gover/h/i shows both moo and cow.
@@ -1569,7 +1569,7 @@ public class AVMServiceTest extends AVMServiceTestBase
// History unchanged.
checkHistory(history, "main");
// /layer should not have changed.
int version = fService.getLatestVersionID("main");
int version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/layer", version - 1, true),
recursiveContents("main:/layer", version - 2, true));
// Change something in /layer
@@ -1578,7 +1578,7 @@ public class AVMServiceTest extends AVMServiceTestBase
// History unchanged.
checkHistory(history, "main");
// /branch should not have changed.
version = fService.getLatestVersionID("main");
version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/branch", version - 1, true),
recursiveContents("main:/branch", version - 2, true));
// Create another layer on /a
@@ -1597,7 +1597,7 @@ public class AVMServiceTest extends AVMServiceTestBase
// History unchanged.
checkHistory(history, "main");
// /layer2 should be unchanged.
version = fService.getLatestVersionID("main");
version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/layer2", version - 1, true),
recursiveContents("main:/layer2", version - 2, true));
// Remove something from /layer2
@@ -1606,7 +1606,7 @@ public class AVMServiceTest extends AVMServiceTestBase
// History unchanged.
checkHistory(history, "main");
// /branch2 is unchanged.
version = fService.getLatestVersionID("main");
version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/branch2", version - 1, true),
recursiveContents("main:/branch2", version - 2, true));
// /a is unchanged.
@@ -2427,7 +2427,7 @@ public class AVMServiceTest extends AVMServiceTestBase
// History unchanged.
checkHistory(history, "main");
// Confirm that /a and /d are unchanged.
int version = fService.getLatestVersionID("main");
int version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/a", version - 1, true),
recursiveContents("main:/a", version - 2, true));
assertEquals(recursiveContents("main:/d", version - 1, true),
@@ -2436,7 +2436,7 @@ public class AVMServiceTest extends AVMServiceTestBase
fService.rename("main:/dbranch", "f", "main:/abranch/c", "f");
fService.createSnapshot("main", null, null);
// Confirm that /a and /d are unchanged.
version = fService.getLatestVersionID("main");
version = fService.getNextVersionID("main");
assertEquals(recursiveContents("main:/a", version - 1, true),
recursiveContents("main:/a", version - 2, true));
assertEquals(recursiveContents("main:/d", version - 1, true),

View File

@@ -19,7 +19,6 @@ package org.alfresco.repo.avm;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@@ -177,9 +176,7 @@ public class AVMServiceTestBase extends TestCase
out.println("I am main:/a/b/c/bar");
out.flush();
out.close();
ArrayList<String> toSnapshot = new ArrayList<String>();
toSnapshot.add("main");
fService.createSnapshot(toSnapshot);
fService.createSnapshot("main", null, null);
}
/**
@@ -191,7 +188,7 @@ public class AVMServiceTestBase extends TestCase
{
assertEquals(history.get(i), recursiveList(repName, i, false));
}
int latest = fService.getLatestVersionID(repName);
int latest = fService.getNextVersionID(repName);
history.put(latest - 1, recursiveList(repName, -1, false));
}
}