Package com.opencloud.sentinel.multileg
Class ReliableResponseID
- java.lang.Object
-
- com.opencloud.sentinel.multileg.ReliableResponseID
-
- All Implemented Interfaces:
com.opencloud.rhino.cmp.Encodable
public class ReliableResponseID extends java.lang.Object implements com.opencloud.rhino.cmp.Encodable
Represents the components that uniquely identify a reliable provisional SIP response. Those being the RSeq number, the CSeq number, and the CSeq method.
-
-
Constructor Summary
Constructors Constructor Description ReliableResponseID(long rSeq, long cSeqNum, java.lang.String method)
ReliableResponseID(java.io.DataInput in, java.lang.ClassLoader cl, com.opencloud.rhino.cmp.codecs.DecoderUtils utils)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
encode(java.io.DataOutput out, com.opencloud.rhino.cmp.codecs.EncoderUtils utils)
boolean
equals(java.lang.Object o)
static ReliableResponseID
fromRequest(org.jainslee.resources.sip.SipRequest request)
Extracts a ReliableResponseID from a SipRequest.static ReliableResponseID
fromResponse(org.jainslee.resources.sip.SipResponse response)
Extracts a ReliableResponseID from a SipResponse.long
getCSeqNum()
java.lang.String
getMethod()
long
getRSeq()
int
hashCode()
java.lang.String
toRAck()
Get this reliable response ID formatted to go in a RAck header.java.lang.String
toString()
-
-
-
Constructor Detail
-
ReliableResponseID
public ReliableResponseID(long rSeq, long cSeqNum, java.lang.String method)
-
ReliableResponseID
public ReliableResponseID(java.io.DataInput in, java.lang.ClassLoader cl, com.opencloud.rhino.cmp.codecs.DecoderUtils utils) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
fromRequest
public static ReliableResponseID fromRequest(org.jainslee.resources.sip.SipRequest request)
Extracts a ReliableResponseID from a SipRequest. Will return null if the response does not have a valid RAck header.- Parameters:
request
- The request to derive the ID from.- Returns:
- A ReliableResponseID with data from the request's RAck header.
-
fromResponse
public static ReliableResponseID fromResponse(org.jainslee.resources.sip.SipResponse response)
Extracts a ReliableResponseID from a SipResponse. Will return null if the response does not have a valid RSeq header.- Parameters:
response
- The response to derive the ID from.- Returns:
- A ReliableResponseID with data from the response's CSeq and RSeq headers.
-
toRAck
public java.lang.String toRAck()
Get this reliable response ID formatted to go in a RAck header.- Returns:
- The response ID as a RAck header value.
-
getRSeq
public long getRSeq()
-
getCSeqNum
public long getCSeqNum()
-
getMethod
public java.lang.String getMethod()
-
encode
public void encode(java.io.DataOutput out, com.opencloud.rhino.cmp.codecs.EncoderUtils utils) throws java.io.IOException
- Specified by:
encode
in interfacecom.opencloud.rhino.cmp.Encodable
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-