Package com.opencloud.sentinel.util
Class SubscribedEventID
- java.lang.Object
-
- com.opencloud.sentinel.util.SubscribedEventID
-
public final class SubscribedEventID extends java.lang.ObjectA value object representing a subscribed SIP event and optional ID parameter. UseSIPUtil.getSubscribedEventID(org.jainslee.resources.sip.SipMessage)to obtainSubscribedEventIDvalues from SIP SUBSCRIBE, NOTIFY or REFER messages.
-
-
Constructor Summary
Constructors Constructor Description SubscribedEventID(java.io.DataInput in)Constructs a new SubscribedEventID object by deserializing data from a stream that was written bytoStream(java.io.DataOutput).SubscribedEventID(java.lang.String name, java.lang.String id)Create a newSubscribedEventID
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static SubscribedEventIDfromString(java.lang.String s)Get aSubscribedEventIDfrom a string.java.lang.StringgetID()Returns the Subscribed event ID.java.lang.StringgetName()Returns Subscribed event name.java.lang.StringgetTemplatePackageName()Return the name of this event's template-package, if any.inthashCode()booleanisRefer()Returns true if the event is a refer.booleanisUnqualifiedRefer()Returns true if the event is an unqualified refer.voidtoStream(java.io.DataOutput out)Serializes this object to a stream in a form suitable for reading bySubscribedEventID(java.io.DataInput).java.lang.StringtoString()
-
-
-
Constructor Detail
-
SubscribedEventID
public SubscribedEventID(java.lang.String name, @Nullable java.lang.String id)Create a newSubscribedEventID- Parameters:
name- the event nameid- an ID string, may benull
-
SubscribedEventID
public SubscribedEventID(java.io.DataInput in) throws java.io.IOExceptionConstructs a new SubscribedEventID object by deserializing data from a stream that was written bytoStream(java.io.DataOutput).- Parameters:
in- input stream.- Throws:
java.io.IOException
-
-
Method Detail
-
fromString
public static SubscribedEventID fromString(java.lang.String s)
Get aSubscribedEventIDfrom a string.- Parameters:
s- a string in the form<event-name>[;id=<id>]- Returns:
- a new
SubscribedEventIDinstance
-
toStream
public void toStream(java.io.DataOutput out) throws java.io.IOExceptionSerializes this object to a stream in a form suitable for reading bySubscribedEventID(java.io.DataInput).- Parameters:
out- the stream to write to- Throws:
java.io.IOException- if an I/O error occurs
-
getName
public java.lang.String getName()
Returns Subscribed event name.- Returns:
- the event name.
-
getID
@Nullable public java.lang.String getID()
Returns the Subscribed event ID.- Returns:
- an ID string, may be
null
-
getTemplatePackageName
public java.lang.String getTemplatePackageName()
Return the name of this event's template-package, if any. For example, the event "dialog.winfo" has the template-package "winfo".- Returns:
- the template-package name, which is the string after the last "." character in the event name, or null if this event is not from a template-package.
- See Also:
- RFC 6665 §5.2.
-
isRefer
public boolean isRefer()
Returns true if the event is a refer.- Returns:
- true if the event name equals "refer", otherwise returns false.
-
isUnqualifiedRefer
public boolean isUnqualifiedRefer()
Returns true if the event is an unqualified refer.- Returns:
- true true if the event name equals "refer" and the ID is null, otherwise returns false.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-