|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Objectgridsim.datagrid.File
A class for representing a physical file in a DataGrid environment
| Field Summary | |
static int |
NOT_REGISTERED
Denotes that this file has not been registered to a Replica Catalogue |
static int |
TYPE_RAW_DATA
Denotes that the type of this file is a raw data |
static int |
TYPE_RECONSTRUCTED_DATA
Denotes that the type of this file is a reconstructed data |
static int |
TYPE_TAG_DATA
Denotes that the type of this file is a tag data |
static int |
TYPE_UNKOWN
Denotes that the type of this file is unknown |
| Constructor Summary | |
File(File file)
Copy constructor, i.e. cloning from a source file into this object, but this object is set to a replica |
|
File(String fileName,
int fileSize)
Creates a new DataGrid file with a given size (in MBytes). |
|
| Method Summary | |
int |
getAttributeSize()
Gets the size of this object (in byte). |
int |
getChecksum()
Gets the file checksum |
double |
getCost()
Gets the cost associated with this file |
long |
getCreationTime()
Gets the file creation time (in millisecond) |
FileAttribute |
getFileAttribute()
Gets an attribute of this file |
double |
getLastUpdateTime()
Gets the last update time (in seconds) |
String |
getName()
Returns the file name |
String |
getOwnerName()
Gets the owner name of this file |
int |
getRegistrationID()
Gets the file registration ID |
int |
getResourceID()
Gets the resource ID that stores this file |
int |
getSize()
Gets the file size (in MBytes) |
int |
getSizeInByte()
Gets the file size (in bytes) |
double |
getTransactionTime()
Gets the last transaction time of this file (in second). |
int |
getType()
Gets this file type |
boolean |
isMasterCopy()
Checks whether this file is a master copy or replica |
boolean |
isReadOnly()
Checks whether this file is a read only or not |
boolean |
isRegistered()
Checks if this file already registered to a Replica Catalogue |
File |
makeMasterCopy()
Clone this file and make the new file as a master copy as well |
File |
makeReplica()
Clone this file but the clone file is set to a replica |
boolean |
setChecksum(int checksum)
Sets the checksum of this file |
boolean |
setCost(double cost)
Sets the cost associated with this file |
boolean |
setFileSize(int fileSize)
Sets the file size (in MBytes) |
void |
setMasterCopy(boolean masterCopy)
Marks this file as a master copy or replica |
void |
setName(String name)
Sets the file name |
boolean |
setOwnerName(String name)
Sets the owner name of this file |
void |
setReadOnly(boolean readOnly)
Marks this file as a read only or not |
boolean |
setRegistrationID(int id)
Sets the file registration ID (published by a Replica Catalogue entity) |
boolean |
setResourceID(int resourceID)
Sets the resource ID that stores this file |
boolean |
setTransactionTime(double time)
Sets the current transaction time (in second) of this file. |
boolean |
setType(int type)
Sets the file type (e.g. raw, tag, etc) |
boolean |
setUpdateTime(double time)
Sets the last update time of this file (in seconds) NOTE: This time is relative to the start time. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int NOT_REGISTERED
public static final int TYPE_UNKOWN
public static final int TYPE_RAW_DATA
public static final int TYPE_RECONSTRUCTED_DATA
public static final int TYPE_TAG_DATA
| Constructor Detail |
public File(String fileName,
int fileSize)
throws ParameterException
fileName - file namefileSize - file size is in MBytes
ParameterException - This happens when one of the following
scenarios occur:
public File(File file)
throws ParameterException
file - the source of a File object to copy
ParameterException - This happens when the source file is
null| Method Detail |
public File makeReplica()
public File makeMasterCopy()
public FileAttribute getFileAttribute()
public int getAttributeSize()
public boolean setResourceID(int resourceID)
resourceID - a resource ID
public int getResourceID()
public String getName()
public void setName(String name)
name - the file name
public boolean setOwnerName(String name)
name - the owner name
public String getOwnerName()
public int getSize()
public int getSizeInByte()
public boolean setFileSize(int fileSize)
fileSize - the file size (in MBytes)
public boolean setUpdateTime(double time)
GridSim.clock() method.
time - the last update time (in seconds)
public double getLastUpdateTime()
public boolean setRegistrationID(int id)
id - registration ID
public int getRegistrationID()
public boolean setType(int type)
type - a file type
public int getType()
public boolean setChecksum(int checksum)
checksum - the checksum of this file
public int getChecksum()
public boolean setCost(double cost)
cost - cost of this file
public double getCost()
public long getCreationTime()
public boolean isRegistered()
public void setMasterCopy(boolean masterCopy)
masterCopy - a flag denotes true for master copy or
false for a replicapublic boolean isMasterCopy()
public void setReadOnly(boolean readOnly)
readOnly - a flag denotes true for read only or
false for re-writeablepublic boolean isReadOnly()
public boolean setTransactionTime(double time)
time - the transaction time (in second)
Storage.addFile(File),
Storage.addFile(List),
Storage.addReservedFile(File),
Storage.deleteFile(File),
Storage.deleteFile(String),
Storage.deleteFile(String, File),
Storage.getFile(String),
Storage.renameFile(File, String)public double getTransactionTime()
|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||