org.apache.ace.repository
Interface Repository


public interface Repository

Providing full access to a repository, which includes read and write access.


Method Summary
 InputStream checkout(long version)
          Checks out the version of the repository that have been passed to this method as parameter.
 boolean commit(InputStream data, long fromVersion)
          Commits data into the repository.
 org.apache.ace.range.SortedRangeSet getRange()
          Determines the versions inside the repository.
 

Method Detail

getRange

org.apache.ace.range.SortedRangeSet getRange()
                                             throws IOException
Determines the versions inside the repository.

Throws:
IOException - If there is an error determining the current versions.

commit

boolean commit(InputStream data,
               long fromVersion)
               throws IOException,
                      IllegalArgumentException
Commits data into the repository.

Parameters:
data - The data to be committed.
fromVersion - The version the data is based upon.
Returns:
True if the commit succeeded, false otherwise if the fromVersion is not the latest version.
Throws:
IOException - If there was a problem reading or writing the data.
IllegalArgumentException - If the version is not greater than 0.
IllegalStateException - If an attempt to commit was made on a non-master repository.

checkout

InputStream checkout(long version)
                     throws IOException,
                            IllegalArgumentException
Checks out the version of the repository that have been passed to this method as parameter.

Returns:
a stream containing a checkout of the passed in version of the repository, or null if the version does not exist
Throws:
IOException - if there is an error reading the version
IllegalArgumentException - if the version is invalid.


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.