ome.api
Interface IRepositoryInfo

All Superinterfaces:
ServiceInterface
All Known Implementing Classes:
RepositoryInfoImpl

public interface IRepositoryInfo
extends ServiceInterface

Provides methods for obtaining information for server repository disk space allocation. Could be used generically to obtain usage information for any mount point, however, this interface is prepared for the API to provide methods to obtain usage info for the server filesystem containing the image uploads. For the OMERO server base this is /OMERO. For this implementation it could be anything e.g. /Data1.

Methods that fail or cannot execute on the server will throw an InternalException. This would not be normal and would indicate some server or disk failure.

Copyright 2007 Glencoe Software Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt

Since:
3.0
Version:
$Revision$
Author:
David L. Whitehurst      david@glencoesoftware.com

Method Summary
 long getFreeSpaceInKilobytes()
          This method returns the free or available space on this file system including nested subdirectories.
 double getUsageFraction()
          This method returns a double of the used space divided by the free space.
 long getUsedSpaceInKilobytes()
          This method returns the total space in bytes for this file system including nested subdirectories.
 void removeUnusedFiles()
          Removes all files from the server that do not have an OriginalFile complement in the database, all the Pixels that do not have a complement in the database and all the Thumbnail's that do not have a complement in the database.
 void sanityCheckRepository()
          Checks that image data repository has not exceeded 95% disk space use level.
 

Method Detail

getUsedSpaceInKilobytes

long getUsedSpaceInKilobytes()
This method returns the total space in bytes for this file system including nested subdirectories. The Java 6 J2SE provides this functionality now using similar methods in the class java.io.File. A refactoring of related classes should be performed when the later SDK is adopted.

Returns:
Total space used on this file system.
Throws:
ResourceError - If there is a problem retrieving disk space used.

getFreeSpaceInKilobytes

long getFreeSpaceInKilobytes()
This method returns the free or available space on this file system including nested subdirectories. The Java 6 J2SE provides this functionality now using similar methods in the class java.io.File. A refactoring of related classes should be performed when the later SDK is adopted.

Returns:
Free space on this file system in KB.
Throws:
ResourceError - If there is a problem retrieving disk space free.

getUsageFraction

double getUsageFraction()
This method returns a double of the used space divided by the free space. This method will be called by a client to watch the repository filesystem so that it doesn't exceed 95% full.

Returns:
Fraction of used/free.
Throws:
ResourceError - If there is a problem calculating the usage fraction.

sanityCheckRepository

void sanityCheckRepository()
Checks that image data repository has not exceeded 95% disk space use level.

Throws:
ResourceError - If the repository usage has exceeded 95%.
ome.conditions.InternalException - If there is a critical failure while sanity checking the repository.

removeUnusedFiles

void removeUnusedFiles()
Removes all files from the server that do not have an OriginalFile complement in the database, all the Pixels that do not have a complement in the database and all the Thumbnail's that do not have a complement in the database.

Throws:
ResourceError - If deletion fails.


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

Copyright © 2009 The University of Dundee. All Rights Reserved.