|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object TapeStorage
public class 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. NOTE: a tape is supposed to be for backup purposes, once it is full, individual files can't be deleted unless the tape is cleared. |
File |
deleteFile(String fileName)
Removes a file from the storage -- NOT SUPPORTED. NOTE: a tape is supposed to be for backup purposes, once it is full, individual files can't be deleted unless the tape is cleared. |
double |
deleteFile(String fileName,
File file)
Removes a file from the storage -- NOT SUPPORTED. NOTE: a tape is supposed to be for backup purposes, once it is full, individual files can't be deleted unless the tape is cleared. |
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 validpublic TapeStorage(double capacity) throws ParameterException
capacity
- the capacity in MB
ParameterException
- when the capacity is not validMethod Detail |
---|
public double getAvailableSpace()
getAvailableSpace
in interface Storage
public boolean isFull()
isFull
in interface Storage
public int getNumStoredFile()
getNumStoredFile
in interface Storage
public boolean reserveSpace(int fileSize)
reserveSpace
in interface Storage
fileSize
- the size to be reserved in MB
public double addReservedFile(File file)
File.getTransactionTime()
.
addReservedFile
in interface Storage
file
- the file to be added
public boolean hasPotentialAvailableSpace(int fileSize)
hasPotentialAvailableSpace
in interface Storage
fileSize
- a FileAttribute object to compare to
public double getCapacity()
getCapacity
in interface Storage
public double getCurrentSize()
getCurrentSize
in interface Storage
public String getName()
getName
in interface Storage
public int getTotalAccessTime()
public boolean setTotalAccessTime(int time)
time
- the total access time in seconds
public double getMaxTransferRate()
getMaxTransferRate
in interface Storage
public boolean setMaxTransferRate(int rate)
setMaxTransferRate
in interface Storage
rate
- 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 Storage
fileName
- the name of the needed file
public List getFileNameList()
getFileNameList
in interface Storage
public double addFile(File file)
File.getTransactionTime()
.
addFile
in interface Storage
file
- the file to be added
public double addFile(List list)
File.getTransactionTime()
.
addFile
in interface Storage
list
- the files to be added
public File deleteFile(String fileName)
deleteFile
in interface Storage
fileName
- the name of the file to be removed
public double deleteFile(String fileName, File file)
deleteFile
in interface Storage
fileName
- 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 Storage
file
- the file which is removed from the storage is returned
through this parameter
public boolean contains(String fileName)
contains
in interface Storage
fileName
- the name of the file we are looking for
public boolean contains(File file)
contains
in interface Storage
file
- the file we are looking for
public boolean renameFile(File file, String newName)
File.getTransactionTime()
.
renameFile
in interface Storage
file
- the file we would like to renamenewName
- the new name of the file
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |