Methods Summary |
---|
public java.lang.Object | clone()Copies the current instance.
RAckHeader retval = new RAckHeader();
if (this.responseNum != null)
retval.responseNum = new Integer(this.responseNum.intValue());
if (this.cseqNum != null)
retval.cseqNum = new Integer(this.cseqNum.intValue());
retval.method = this.method;
return retval;
|
public java.lang.String | encodeBody()Return canonical header content. (encoded header except headerName:)
return responseNum + Separators.SP +
cseqNum + Separators.SP + method.toUpperCase();
|
public boolean | equals(java.lang.Object other)Compare two RAck headers for equality. Equality of RAck headers means
that the class, method, response number and cseq number are same for
both the headers
if (! other.getClass().equals(this.getClass())) {
return false;
}
RAckHeader that = (RAckHeader) other;
if (! this.responseNum.equals(that.responseNum)) {
return false;
}
if (! this.cseqNum.equals(that.cseqNum)) {
return false;
}
if (! equalsIgnoreCase(this.method, that.method)) {
return false;
}
return true;
|
public java.lang.String | getMethod()Get the method.
return method.toUpperCase();
|
public int | getResponseNumber()Gets the response number of this RAckHeaderHeader.
if (this.responseNum == null)
return 0;
else return this.responseNum.intValue();
|
public int | getSequenceNumber()Gets the sequence number of this RAckHeaderHeader.
if (this.cseqNum == null)
return 0;
else return this.cseqNum.intValue();
|
public java.lang.Object | getValue()Gets the header value.
return responseNum + Separators.SP +
cseqNum + Separators.SP + method.toUpperCase();
|
public void | setHeaderValue(java.lang.String value)Sets the header value field.
int newResponseNo;
int newSeqNo;
String newMethod;
String strCseqMethod;
value = value.trim();
// Check if the sequence number presents
int delimIndex1 = value.indexOf(' ");
if (delimIndex1 == -1) {
throw new IllegalArgumentException("Invalid value");
}
try {
String strResponse = value.substring(0, delimIndex1).trim();
newResponseNo = Integer.parseInt(strResponse);
setResponseNumber(newResponseNo);
} catch (IllegalArgumentException iae) {
throw iae;
}
strCseqMethod = value.substring(delimIndex1, value.length()).trim();
int delimIndex2 = strCseqMethod.indexOf(' ");
if (delimIndex2 == -1) {
throw new IllegalArgumentException("Invalid value");
}
try {
String strCseq = strCseqMethod.substring(0, delimIndex2).trim();
newSeqNo = Integer.parseInt(strCseq);
setSequenceNumber(newSeqNo);
} catch (IllegalArgumentException iae) {
throw iae;
}
newMethod = strCseqMethod.substring(delimIndex2,
strCseqMethod.length()).trim();
setMethod(newMethod);
|
public void | setMethod(java.lang.String newMethod)Set the method member
if (newMethod == null)
throw new NullPointerException("parameter is null");
method = newMethod;
|
public void | setResponseNumber(int responseNumber)Sets the response number of this RAckHeaderHeader.
if (responseNumber < 0)
throw new IllegalArgumentException
("the sequence number parameter is < 0");
responseNum = new Integer(responseNumber);
|
public void | setSequenceNumber(int sequenceNumber)Sets the sequence number of this RAckHeaderHeader. The sequence number
MUST be expressible as a 32-bit unsigned integer and MUST be less than
2**31.
if (sequenceNumber < 0)
throw new IllegalArgumentException
("the sequence number parameter is < 0");
cseqNum = new Integer(sequenceNumber);
|