|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Objectgridsim.datagrid.storage.TapeStorage
An implementation of a tape storage system. It simulates the behaviour of a typical tape storage with the following assumptions:
Storage| Constructor Summary | |
TapeStorage(double capacity)
Constructs a new tape storage with a given capacity. |
|
TapeStorage(String name,
double capacity)
Constructs a new tape storage with a given name and capacity. |
|
| Method Summary | |
double |
addFile(File file)
Adds a file to the storage. |
double |
addFile(List list)
Adds a set of files to the storage. |
double |
addReservedFile(File file)
Adds a file for which the space has already been reserved. |
boolean |
contains(File file)
Checks whether a certain file is on the storage or not. |
boolean |
contains(String fileName)
Checks whether a certain file is on the storage or not. |
double |
deleteFile(File file)
Removes a file from the storage -- NOT SUPPORTED. |
File |
deleteFile(String fileName)
Removes a file from the storage -- NOT SUPPORTED. |
double |
deleteFile(String fileName,
File file)
Removes a file from the storage -- NOT SUPPORTED. |
double |
getAvailableSpace()
Gets the available space on this storage in MB. |
double |
getCapacity()
Gets the total capacity of the storage in MB. |
double |
getCurrentSize()
Gets the current size of the stored files in MB. |
File |
getFile(String fileName)
Gets the file with the specified name. |
List |
getFileNameList()
Gets the list of file names located on this storage. |
double |
getMaxTransferRate()
Gets the maximum transfer rate of the storage in MB/sec. |
String |
getName()
Gets the name of the storage. |
int |
getNumStoredFile()
Gets the number of files stored on this storage. |
int |
getTotalAccessTime()
Gets the total access time of this tape drive in seconds. |
int |
getTotalRewindTime()
Gets the total rewind time of the tape in seconds. |
boolean |
hasPotentialAvailableSpace(int fileSize)
Checks whether there is enough space on the storage for a certain file. |
boolean |
isFull()
Checks if the storage is full or not. |
boolean |
renameFile(File file,
String newName)
Renames a file on the storage. |
boolean |
reserveSpace(int fileSize)
Makes a reservation of the space on the storage to store a file. |
boolean |
setMaxTransferRate(int rate)
Sets the maximum transfer rate of this storage system in MB/sec. |
boolean |
setTotalAccessTime(int time)
Sets the total access time for this tape in seconds. |
boolean |
setTotalRewindTime(int time)
Sets the total rewind time of the tape. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TapeStorage(String name,
double capacity)
throws ParameterException
name - the name of the new tape drivecapacity - the capacity in MB
ParameterException - when the name and the capacity are not valid
public TapeStorage(double capacity)
throws ParameterException
capacity - the capacity in MB
ParameterException - when the capacity is not valid| Method Detail |
public double getAvailableSpace()
getAvailableSpace in interface Storagepublic boolean isFull()
isFull in interface Storagepublic int getNumStoredFile()
getNumStoredFile in interface Storagepublic boolean reserveSpace(int fileSize)
reserveSpace in interface StoragefileSize - the size to be reserved in MB
public double addReservedFile(File file)
File.getTransactionTime().
addReservedFile in interface Storagefile - the file to be added
public boolean hasPotentialAvailableSpace(int fileSize)
hasPotentialAvailableSpace in interface StoragefileSize - a FileAttribute object to compare to
public double getCapacity()
getCapacity in interface Storagepublic double getCurrentSize()
getCurrentSize in interface Storagepublic String getName()
getName in interface Storagepublic int getTotalAccessTime()
public boolean setTotalAccessTime(int time)
time - the total access time in seconds
public double getMaxTransferRate()
getMaxTransferRate in interface Storagepublic boolean setMaxTransferRate(int rate)
setMaxTransferRate in interface Storagerate - the maximum transfer rate in MB/sec
public boolean setTotalRewindTime(int time)
time - the total rewind time in seconds
public int getTotalRewindTime()
public File getFile(String fileName)
File.getTransactionTime().
getFile in interface StoragefileName - the name of the needed file
public List getFileNameList()
getFileNameList in interface Storagepublic double addFile(File file)
File.getTransactionTime().
addFile in interface Storagefile - the file to be added
public double addFile(List list)
File.getTransactionTime().
addFile in interface Storagelist - the files to be added
public File deleteFile(String fileName)
deleteFile in interface StoragefileName - the name of the file to be removed
public double deleteFile(String fileName,
File file)
deleteFile in interface StoragefileName - the name of the file to be removedfile - the file which is removed from the storage is returned
through this parameter
public double deleteFile(File file)
deleteFile in interface Storagefile - the file which is removed from the storage is returned
through this parameter
public boolean contains(String fileName)
contains in interface StoragefileName - the name of the file we are looking for
public boolean contains(File file)
contains in interface Storagefile - the file we are looking for
public boolean renameFile(File file,
String newName)
File.getTransactionTime().
renameFile in interface Storagefile - the file we would like to renamenewName - the new name of the file
|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||