public class FileAttribute
extends java.lang.Object
gridsim.datagrid.File entity.| Constructor and Description |
|---|
FileAttribute(java.lang.String fileName,
int fileSize)
Allocates a new FileAttribute class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
copyValue(FileAttribute attr)
Copy the values of this object into another FileAttribute class
|
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)
|
int |
getFileSize()
Gets the file size (in MBytes)
|
int |
getFileSizeInByte()
Gets the file size (in bytes)
|
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 |
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
|
boolean |
setChecksum(int checksum)
Sets the checksum of this file
|
boolean |
setCost(double cost)
Sets the cost associated with this file
|
boolean |
setCreationTime(long creationTime)
Sets the file creation time (in millisecond)
|
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 |
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 FileAttribute(java.lang.String fileName,
int fileSize)
throws ParameterException
fileName - file namefileSize - size of this file (in bytes)ParameterException - This happens when one of the following scenarios occur:
public boolean copyValue(FileAttribute attr)
attr - a FileAttribute object (the destination)public boolean setCreationTime(long creationTime)
creationTime - the file creation time (in millisecond)public long getCreationTime()
public boolean setResourceID(int resourceID)
resourceID - a resource IDpublic int getResourceID()
public boolean setOwnerName(java.lang.String name)
name - the owner namepublic java.lang.String getOwnerName()
public int getAttributeSize()
public boolean setFileSize(int fileSize)
fileSize - the file size (in MBytes)public int getFileSize()
public int getFileSizeInByte()
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 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 void setName(java.lang.String name)
name - the file namepublic java.lang.String getName()