public class File
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
File(File file)
Copy constructor, i.e.
|
File(java.lang.String fileName,
int fileSize)
Creates a new DataCloud file with a given size (in MBytes).
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAttributeSize()
Gets the size of this object (in byte).
NOTE: This object size is NOT the actual file size. |
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)
|
java.lang.String |
getName()
Returns the file name
|
java.lang.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(java.lang.String name)
Sets the file name
|
boolean |
setOwnerName(java.lang.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.
|
boolean |
setUpdateTime(double time)
Sets the last update time of this file (in seconds)
NOTE: This time is relative to the start time. |
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
public File(java.lang.String fileName,
int fileSize)
throws ParameterException
fileName - file namefileSize - file size is in MBytesParameterException - This happens when one of the following scenarios occur:
public File(File file) throws ParameterException
file - the source of a File object to copyParameterException - This happens when the source file is nullpublic File makeReplica()
public File makeMasterCopy()
public FileAttribute getFileAttribute()
public int getAttributeSize()
public boolean setResourceID(int resourceID)
resourceID - a resource IDpublic int getResourceID()
public java.lang.String getName()
public void setName(java.lang.String name)
name - the file namepublic boolean setOwnerName(java.lang.String name)
name - the owner namepublic java.lang.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.CloudSim#clock() method.time - the last update time (in seconds)public double getLastUpdateTime()
public boolean setRegistrationID(int id)
id - registration IDpublic int getRegistrationID()
public boolean setType(int type)
type - a file typepublic int getType()
public boolean setChecksum(int checksum)
checksum - the checksum of this filepublic int getChecksum()
public boolean setCost(double cost)
cost - cost of this filepublic 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)gridsim.datagrid.storage.Storage#addFile(File),
gridsim.datagrid.storage.Storage#addFile(List),
gridsim.datagrid.storage.Storage#addReservedFile(File),
gridsim.datagrid.storage.Storage#deleteFile(File),
gridsim.datagrid.storage.Storage#deleteFile(String),
gridsim.datagrid.storage.Storage#deleteFile(String, File),
gridsim.datagrid.storage.Storage#getFile(String),
gridsim.datagrid.storage.Storage#renameFile(File, String)public double getTransactionTime()