net.sf.vcaperture.services
Interface ILocalStorageService

All Known Implementing Classes:
YamlFilesystemStorageService

public interface ILocalStorageService

Service that provides the functionality for local storage of repositories.

Author:
Jeremy Thomerson (jthomerson@users.sourceforge.net)

Method Summary
 RepoFile getFile(AbstractRepository repo, java.lang.String relativePath)
           
 java.lang.String getLatestStoredRevision(AbstractRepository repo)
           
 java.util.Collection<Revision> getRevisions(AbstractRepository repo, java.lang.String startingRevision, int maxRevisions)
           
 void saveFileRevision(AbstractRepository repo, RepoFileRevision rfr)
          Saves an actual file that was part of the revision.
 void saveRevision(AbstractRepository repo, Revision rev)
          Saves the revision information for this repo / revision combo.
 

Method Detail

getLatestStoredRevision

java.lang.String getLatestStoredRevision(AbstractRepository repo)
                                         throws StorageException
Parameters:
repo - The repo you need the revision for
Returns:
the latest revision that has been locally stored, or AbstractRepository.getNullRevisionDefault() if none has been stored.
Throws:
StorageException - if there is an error retrieving it
See Also:
AbstractRepository.getNullRevisionDefault()

getFile

RepoFile getFile(AbstractRepository repo,
                 java.lang.String relativePath)
                 throws StorageException
Parameters:
repo - The repo you need the revision for
relativePath - The relative path of the file you need
Returns:
the RepoFile at that path
Throws:
StorageException - if there is an error retrieving it

saveRevision

void saveRevision(AbstractRepository repo,
                  Revision rev)
                  throws StorageException
Saves the revision information for this repo / revision combo.

IMPORTANT: This does NOT save the individual files that were part of this revision. You must do that separately.

Parameters:
repo - The repo that the revision applies to
rev - The revision to save
Throws:
StorageException - if there is an error saving it

saveFileRevision

void saveFileRevision(AbstractRepository repo,
                      RepoFileRevision rfr)
                      throws StorageException
Saves an actual file that was part of the revision. The RepoFileRevision passed in should already have it's revisions field updated to reflect that it was part of this revision. This method saves both the RepoFile and the contents of the RepoFileRevision.

Parameters:
repo - The repo that the revision applies to
rfr - The revision to save
Throws:
StorageException - if there is an error saving it

getRevisions

java.util.Collection<Revision> getRevisions(AbstractRepository repo,
                                            java.lang.String startingRevision,
                                            int maxRevisions)


Copyright © 2008. All Rights Reserved.