Class StreamingSessionIdentifier
- java.lang.Object
-
- org.eclipse.ditto.services.gateway.streaming.StreamingSessionIdentifier
-
- All Implemented Interfaces:
CharSequence
public final class StreamingSessionIdentifier extends Object implements CharSequence
Represents the identifier of a streaming session combined of a client session identifier and a server session identifier.- Since:
- 1.1.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description charcharAt(int index)booleanequals(Object o)StringgetClientSessionId()Returns the client session identifier potentially passed by the client itself.StringgetServerSessionId()Returns the server session identifier which was created by the server.inthashCode()intlength()static StreamingSessionIdentifierof(CharSequence streamingSessionIdentifier)Creates a new StreamingSessionIdentifier of the passed CharSequence already containing the delimiter "_-_" delimiting clientSessionId and serverSessionId.static StreamingSessionIdentifierof(CharSequence clientSessionId, CharSequence serverSessionId)Creates a new StreamingSessionIdentifier of the passedclientSessionIdandserverSessionId.CharSequencesubSequence(int start, int end)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Method Detail
-
of
public static StreamingSessionIdentifier of(CharSequence streamingSessionIdentifier)
Creates a new StreamingSessionIdentifier of the passed CharSequence already containing the delimiter "_-_" delimiting clientSessionId and serverSessionId.- Parameters:
streamingSessionIdentifier- the combined session identifier containing clientSessionId and serverSessionId.- Returns:
- the instance.
- Throws:
IllegalArgumentException- if the passedstreamingSessionIdentifierdid not contain a "_-_".NullPointerException- ifstreamingSessionIdentifierisnull.
-
of
public static StreamingSessionIdentifier of(CharSequence clientSessionId, CharSequence serverSessionId)
Creates a new StreamingSessionIdentifier of the passedclientSessionIdandserverSessionId.- Parameters:
clientSessionId- the client session identifier potentially passed by the client itself.serverSessionId- the server session identifier which was created by the server.- Returns:
- the instance.
- Throws:
NullPointerException- if any argument isnull.
-
getClientSessionId
public String getClientSessionId()
Returns the client session identifier potentially passed by the client itself.- Returns:
- the client session identifier potentially passed by the client itself.
-
getServerSessionId
public String getServerSessionId()
Returns the server session identifier which was created by the server.- Returns:
- the server session identifier which was created by the server.
-
length
public int length()
- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAtin interfaceCharSequence
-
subSequence
public CharSequence subSequence(int start, int end)
- Specified by:
subSequencein interfaceCharSequence
-
toString
public String toString()
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-
-