Package com.opencloud.sentinel.util
Class SipStatusUtil
- java.lang.Object
-
- com.opencloud.sentinel.util.SipStatusUtil
-
public final class SipStatusUtil extends java.lang.ObjectUtility class for SIP response status codes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSipStatusUtil.SipStatusTypeRepresents the Response SipStatusType.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SipStatusUtil.SipStatusTypeclassifyStatusCode(int statusCode)Classifies SIP response status codes into one of the following categories: Provisional, Success, Failure, Invalid.static java.lang.StringgetReasonPhrase(int statusCode)Get the standard reason phrase for a SIP status code, or "Unknown" if the status code is not recognised.static booleanisFailureStatusCode(int statusCode)Convenience method for returning if status code falls between allowable values forSipStatusType.Failure.static booleanisProvisionalStatusCode(int statusCode)Convenience method for returning if status code falls between allowable values forSipStatusType.Provisional.static booleanisSubscriptionTerminatingCode(int statusCode)Convenience method for returning if status code should terminate the subscriptionstatic booleanisSuccessfulStatusCode(int statusCode)Convenience method for returning if status code falls between allowable values forSipStatusType.Success.
-
-
-
Method Detail
-
classifyStatusCode
public static SipStatusUtil.SipStatusType classifyStatusCode(int statusCode)
Classifies SIP response status codes into one of the following categories: Provisional, Success, Failure, Invalid.
-
isSuccessfulStatusCode
public static boolean isSuccessfulStatusCode(int statusCode)
Convenience method for returning if status code falls between allowable values forSipStatusType.Success.- Returns:
- true if status code falls between allowable
values for
SipStatusType.Success.
-
isProvisionalStatusCode
public static boolean isProvisionalStatusCode(int statusCode)
Convenience method for returning if status code falls between allowable values forSipStatusType.Provisional.- Returns:
- true if status code falls between allowable
values for
SipStatusType.Provisional.
-
isFailureStatusCode
public static boolean isFailureStatusCode(int statusCode)
Convenience method for returning if status code falls between allowable values forSipStatusType.Failure.- Returns:
- true if status code falls between allowable
values for
SipStatusType.Failure.
-
isSubscriptionTerminatingCode
public static boolean isSubscriptionTerminatingCode(int statusCode)
Convenience method for returning if status code should terminate the subscription- Returns:
- true if status code should terminate the subscription outlined in RFC 6665.
-
getReasonPhrase
public static java.lang.String getReasonPhrase(int statusCode)
Get the standard reason phrase for a SIP status code, or "Unknown" if the status code is not recognised.
-
-