* under the License.
*/
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* The repository session provides a single interface to accessing Archiva repositories. It provides access to three
* resources:
private boolean dirty;
+ private Logger log = LoggerFactory.getLogger( getClass() );
+
// FIXME: include storage here too - perhaps a factory based on repository ID, or one per type to retrieve and
// operate on a given repo within the storage API
}
public void save()
+ throws MetadataRepositoryException
{
- try
- {
- repository.save();
- }
- catch ( MetadataRepositoryException e )
- {
- // FIXME
- throw new RuntimeException( e );
- }
+ repository.save();
dirty = false;
}
public void revert()
+ throws MetadataRepositoryException
{
- try
- {
- repository.revert();
- }
- catch ( MetadataRepositoryException e )
- {
- // FIXME
- throw new RuntimeException( e );
- }
-
+ repository.revert();
dirty = false;
}
* exception occurs.
*/
public void close()
+ throws MetadataRepositoryException
{
- if ( dirty )
+ try
{
- save();
+ if ( dirty )
+ {
+ save();
+ }
+ }
+ catch ( MetadataRepositoryException e )
+ {
+ // olamy use revert here ?
+ throw e;
+ }
+ finally
+ {
+ repository.close();
}
-
- repository.close();
}
public void markDirty()