|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.gjsa.ServerEnvelope
message object for GJSA communication. ServerEnvelope is the "master" object that is sent between server and client (in both directions). Its most important parts are the two lists of requests and replies. Normally, a ServerEnvelope is sent from client to server with only the quest list set appropriately. The same envelope is sent back again from server to client with the replies set (and the queries deleted to save space and time).
ServerEnvelope has some additional fields and methods for certain usages. First, it always is in one of two states: part of a synchronous or free floating communication. It has a target and a sequence field for connectionless communication and knows about a source address for the same reason.
A ServerEnvelope can have an InformableSender reference. Through its informSender() method, the sender can be informed that the envelope has been sent over the network connection. This is extremly useful for asynchronous or free floating communication where it must be avoided that the server sends the data blocks too fast.
Field Summary | |
static int |
FREEFLOATING
possible type: free floating information sent by server |
private InformableSender |
is
|
private SessionConnector |
newsessionconnector
|
private java.util.List |
quests
|
private java.util.List |
replies
|
private int |
seq
The sequence count |
private int |
session
session number |
private java.net.InetAddress |
source
The address of the client. |
static int |
SYNCHRONIZED
possible type: part of a synchonized connection |
int |
target
target handle for connectionless connections |
int |
type
envelope type |
static int |
UNINITIALIZED
possible type: not initialized yet. |
Constructor Summary | |
ServerEnvelope()
creates a synchronized envelope with no real content |
|
ServerEnvelope(int tx,
int sx,
ServerReply sr)
creates a replying envelope with type and sequence number |
|
ServerEnvelope(int tx,
ServerReply sr)
creates an envelope with type tx and one reply |
|
ServerEnvelope(int t,
ServerRequest quest)
creates an envelope with (connectionless) target t and one request. |
|
ServerEnvelope(ServerRequest quest)
creates a synchronized envelope with one request as content |
|
ServerEnvelope(ServerRequest[] questsx)
creates a synchronized envelope with several requests in an Array as content |
|
ServerEnvelope(ServerRequest[] questsx,
int sessionx)
creates a synchronized envelope with several requests in an Array in a certain session as content |
|
ServerEnvelope(ServerRequest quest,
int sessionx)
creates a synchronized envelope with one request in a certain session as content |
Method Summary | |
void |
addFirstReply(ServerReply repl)
adds a reply to the beginning of the list. |
void |
addReply(ServerReply repl)
adds a reply to the reply vector. |
void |
addRequest(int rn)
adds a request consisting of the command rn. |
void |
addRequest(int rn,
java.lang.Object p1)
adds a request consisting of the command rn and one parameter. |
void |
addRequest(int rn,
java.lang.Object[] p)
adds a request consisting of the command rn and a parameter array. |
void |
addRequest(int rn,
java.lang.Object p1,
java.lang.Object p2)
adds a request consisting of the command rn and two parameters. |
void |
addRequest(int rn,
java.lang.Object p1,
java.lang.Object p2,
java.lang.Object p3)
adds a request consisting of the command rn and three parameters. |
void |
addRequest(int rn,
java.lang.Object p1,
java.lang.Object p2,
java.lang.Object p3,
java.lang.Object p4)
adds a request consisting of the command rn and four parameters. |
void |
addRequest(ServerRequest req)
adds a request by adding the passed parameter to the request vector. |
java.lang.Object |
clone()
Clones this ServerEnvelope. |
ServerReply |
getFirstReply()
Returns the first reply of the reply vector. |
ServerRequest |
getFirstRequest()
return the first request |
ServerReply |
getLastReply()
Returns the last reply of the reply vector. |
SessionConnector |
getNewSessionConnector()
Returns a SessionConnector object which is useable for querying a new session. |
java.util.List |
getReplies()
gets replies as a list. |
ServerReply[] |
getReplyArray()
gets the replies an an array |
java.util.List |
getRequests()
returns the complete request vector. |
int |
getSequence()
returns the sequence field. |
int |
getSession()
Returns the session. |
java.net.InetAddress |
getSource()
returns the stored source of this envelope. |
int |
getTarget()
returns the target field |
void |
informSender()
informs the sender that the envelope has been sent. |
boolean |
isClosingReply()
Returns whether this reply is closing the connection |
boolean |
isClosingRequest()
Returns whether this reply will close the connection intentionally (by issuing QUIT) |
ServerRequest |
removeFirstRequest()
Remove the first request from the request list and return it |
void |
removeReplies()
removes the reply vector. |
void |
removeRequests()
remove the complete request vector. |
void |
setInformableSender(InformableSender isx)
sets an informable sender for this envelope |
void |
setReplies(java.util.List repl)
sets an arbitrary reply vector |
void |
setReply(ServerReply repl)
sets a reply vector consisting of exactly one reply object. |
void |
setRequests(java.util.List q)
sets the requests. |
void |
setSequence(int s)
set the sequence field (only used for connectionless connections) |
void |
setSession(int session)
Sets the session. |
void |
setSource(java.net.InetAddress src)
sets the source of this envelope. |
void |
setTarget(int t)
set the target field (only used for connectionless connections) |
java.lang.String |
toString()
converts the object to a String. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int UNINITIALIZED
public static final int SYNCHRONIZED
public static final int FREEFLOATING
public int type
public int target
private int session
private int seq
private java.net.InetAddress source
private transient InformableSender is
private transient SessionConnector newsessionconnector
private java.util.List quests
private java.util.List replies
Constructor Detail |
public ServerEnvelope()
public ServerEnvelope(ServerRequest quest)
public ServerEnvelope(ServerRequest[] questsx)
public ServerEnvelope(ServerRequest quest, int sessionx)
public ServerEnvelope(ServerRequest[] questsx, int sessionx)
public ServerEnvelope(int t, ServerRequest quest)
public ServerEnvelope(int tx, ServerReply sr)
public ServerEnvelope(int tx, int sx, ServerReply sr)
Method Detail |
public java.lang.Object clone()
public SessionConnector getNewSessionConnector()
public void setInformableSender(InformableSender isx)
public void informSender()
The reference to sender object is deleted immideately after this information. Therefore, a sender can and will be informed only _once_!
public void setReplies(java.util.List repl)
public void addReply(ServerReply repl)
public void setReply(ServerReply repl)
public void addFirstReply(ServerReply repl)
public java.util.List getReplies()
public ServerReply[] getReplyArray()
public ServerReply getFirstReply()
public ServerReply getLastReply()
public boolean isClosingRequest()
public boolean isClosingReply()
public void setRequests(java.util.List q)
public void addRequest(ServerRequest req)
public void addRequest(int rn)
public void addRequest(int rn, java.lang.Object p1)
public void addRequest(int rn, java.lang.Object p1, java.lang.Object p2)
public void addRequest(int rn, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
public void addRequest(int rn, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4)
public void addRequest(int rn, java.lang.Object[] p)
public java.util.List getRequests()
public ServerRequest getFirstRequest()
public ServerRequest removeFirstRequest()
public void setTarget(int t)
public int getTarget()
public void setSequence(int s)
public int getSequence()
public void setSource(java.net.InetAddress src)
public java.net.InetAddress getSource()
public void removeRequests()
public void removeReplies()
public java.lang.String toString()
public int getSession()
public void setSession(int session)
session
- The session to set
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |