* was not found
*/
public NodeRevisionDescriptors retrieveRevisionDescriptors(Connection connection,Uri uri)
throws ServiceAccessException, RevisionDescriptorNotFoundException {
NodeRevisionDescriptors revisionDescriptors = null;
PreparedStatement statement = null;
PreparedStatement statement2 = null;
try {
ResultSet res = null;
NodeRevisionNumber initialRevision = new NodeRevisionNumber();
Hashtable workingRevisions = new Hashtable();
Hashtable latestRevisionNumbers = new Hashtable();
Hashtable branches = new Hashtable();
boolean isVersioned = false;
statement = connection.prepareStatement
("select * from revisions where uri= ?");
statement.setString(1, uri.toString());
res = statement.executeQuery();
if (res.next()) {
int isVersionedInt = res.getInt(REVISIONS_ISVERSIONED);
if (isVersionedInt == 1) {
isVersioned = true;
}
} else {
throw new RevisionDescriptorNotFoundException(uri.toString());
}
closeStatement(statement);
statement = connection.prepareStatement
("select * from workingrevision where uri= ?");
statement.setString(1, uri.toString());
res = statement.executeQuery();
while(res.next()) {
// TODO : Parse each working revision definition
}
closeStatement(statement);
statement = connection.prepareStatement
("select * from latestrevisions where uri=?");
statement.setString(1, uri.toString());
res = statement.executeQuery();
while(res.next()) {
latestRevisionNumbers
.put(res.getString(LATESTREVISIONS_BRANCHNAME),
new NodeRevisionNumber
(res.getString(LATESTREVISIONS_NUMBER)));
}
closeStatement(statement);
statement = connection.prepareStatement
("select * from revision where uri= ?");
statement.setString(1, uri.toString());
res = statement.executeQuery();
while(res.next()) {
String currentRevisionNumber = res.getString(REVISION_NUMBER);
// We parse the revision list of the object
if (statement2 == null){
statement2 = connection.prepareStatement
("select * from branches where uri = ? and xnumber = ?");
}
statement2.setString(1, uri.toString());
statement2.setString(2, currentRevisionNumber);
ResultSet res2 = statement2.executeQuery();
Vector childList = new Vector();
while (res2.next()) {
childList.addElement(new NodeRevisionNumber
(res2.getString(BRANCHES_CHILDNUMBER)));
}
branches.put(new NodeRevisionNumber(currentRevisionNumber),
childList);
res2.close();
}
closeStatement(statement2);
revisionDescriptors = new NodeRevisionDescriptors
(uri.toString(), initialRevision, workingRevisions,
latestRevisionNumbers, branches, isVersioned);
} catch (SQLException e) {
throw createException(e,uri);