|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.metamatrix.dqp.message.RequestID
public class RequestID
This class represents an identifier for a request. However, there are some differences in what constitutes "uniqueness" for a given RequestID that is based on context (where the id is used). The RequestID has 2 parts: connectionID, and executionIDFor the purposes of the RequestID, the combined representation is "connectionID.executionID" - this implies a scoping for the name parts. The connectionID specifies a particular connection that is making requests. Each connection generates a unique executionID for each request execution, so the executionID is only unique in the context of a connectionID.
When this class is used between client and server, the connectionID is implied and thus only the executionID part will be used. The server will qualify the executionID with a connectionID when it reaches the server.
RequestIDs are immutable so no setters exist. This allows hashcodes to be pre-computed for faster comparison in equals.
Field Summary | |
---|---|
static java.lang.String |
NO_CONNECTION_STR
|
Constructor Summary | |
---|---|
RequestID()
Necessary for implementing Externalizable |
|
RequestID(long executionID)
Create a RequestID for an execution where the connection is not specified. |
|
RequestID(java.lang.String connectionID,
long executionID)
Create a RequestID using all of the ID parts. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getConnectionID()
Return connectionID, may be null if connection has not been specified. |
long |
getExecutionID()
Return executionID, which identifies a per-connection execution. |
int |
hashCode()
|
void |
readExternal(java.io.ObjectInput in)
|
java.lang.String |
toString()
Return a combined string for the ID. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NO_CONNECTION_STR
Constructor Detail |
---|
public RequestID()
public RequestID(java.lang.String connectionID, long executionID)
connectionID
- Identifies a connection, may be nullexecutionID
- Identifies an execution, cannot be nullpublic RequestID(long executionID)
executionID
- Identifies an execution, cannot be nullMethod Detail |
---|
public java.lang.String getConnectionID()
public long getExecutionID()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
Externalizable.readExternal(java.io.ObjectInput)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
Externalizable.writeExternal(java.io.ObjectOutput)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |