|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnachos.kernel.filesys.Message
public class Message
Class for messages representing a request to or a reply from a distributed filesystem (DFS) server.
Field Summary | |
---|---|
static int |
BlockSize
The size of data blocks used in the distributed filesystem. |
static int |
CloseReq
A type of DFS message, used as a value of field msgType. |
static int |
CreateReq
A type of DFS message, used as a value of field msgType. |
byte[] |
data
The file data to write or read. |
int |
fileDesc
The file descriptor. |
java.lang.String |
filename
The file name. |
static int |
headerLength
Length of the message header, in bytes. |
int |
msgType
type of message. |
static java.lang.String[] |
msgTypeNames
Names of the types of DFS messages (useful for debugging). |
int |
numBytes
The number of bytes to be read, or the number of bytes successfully written. |
static int |
OpenReply
A type of DFS message, used as a value of field msgType. |
static int |
OpenReq
A type of DFS message, used as a value of field msgType. |
int |
position
The starting position within the file. |
static int |
ReadReply
A type of DFS message, used as a value of field msgType. |
static int |
ReadReq
A type of DFS message, used as a value of field msgType. |
static int |
RemoveReq
A type of DFS message, used as a value of field msgType. |
static int |
WriteReply
A type of DFS message, used as a value of field msgType. |
static int |
WriteReq
A type of DFS message, used as a value of field msgType. |
Constructor Summary | |
---|---|
Message(byte[] msgAsBytes)
Create a new message, and initialize it using the specified array of bytes, which should have been produced by Message.toByteArray. |
|
Message(int msgType,
int fileDesc,
int position,
int numBytes,
java.lang.String filename,
byte[] data)
Allocate a new message, using the specified parameters, which have the same meaning as the fields with the same names. |
Method Summary | |
---|---|
byte[] |
toByteArray()
Returns this message represented as an array of bytes. |
java.lang.String |
toString()
Returns this message represented as a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int OpenReq
public static final int CloseReq
public static final int ReadReq
public static final int WriteReq
public static final int CreateReq
public static final int RemoveReq
public static final int OpenReply
public static final int ReadReply
public static final int WriteReply
public static final java.lang.String[] msgTypeNames
public int msgType
public int fileDesc
public int position
public int numBytes
public java.lang.String filename
public byte[] data
public static final int headerLength
public static final int BlockSize
Constructor Detail |
---|
public Message(int msgType, int fileDesc, int position, int numBytes, java.lang.String filename, byte[] data)
public Message(byte[] msgAsBytes)
msgAsBytes
- the message, represented as an array of bytes.Method Detail |
---|
public byte[] toByteArray()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |