|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.SessionName
public final class SessionName
Handles unified naming convention of login names and user sessions. Instances are immutable.
SessionNameTest
,
The
client.failsafe requirement,
Serialized FormField Summary | |
---|---|
private java.lang.String |
absoluteName
The absolute name |
private Global |
glob
|
private static java.lang.String |
ME
Name for logging output |
private NodeId |
nodeId
|
private boolean |
nodeIdExplicitlyGiven
|
private long |
pubSessionId
|
private java.lang.String |
relativeName
|
static java.lang.String |
ROOT_MARKER_TAG
|
static java.lang.String |
SEPERATOR
|
private static long |
serialVersionUID
|
static java.lang.String |
SUBJECT_MARKER_TAG
|
private java.lang.String |
subjectId
|
private static boolean |
useSessionMarker
|
Constructor Summary | |
---|---|
SessionName(Global glob,
NodeId nodeId,
java.lang.String name)
|
|
SessionName(Global glob,
NodeId nodeId,
java.lang.String subjectId,
long pubSessionId)
|
|
SessionName(Global glob,
SessionName sessionName,
long pubSessionId)
Create a new instance based on the given sessionName but with added/changed pubSessionId |
|
SessionName(Global glob,
java.lang.String name)
Create and parse a unified name. |
Method Summary | |
---|---|
boolean |
equalsAbsolute(SessionName sessionName)
|
boolean |
equalsRelative(SessionName sessionName)
|
java.lang.String |
getAbsoluteName()
|
java.lang.String |
getAbsoluteName(boolean forceSessionMarker)
If the nodeId is not known, the relative name is returned |
java.lang.String |
getAbsoluteSubjectName()
If the nodeId is not known, the relative name is returned a possible session is ommitted |
java.lang.String |
getLoginName()
|
NodeId |
getNodeId()
|
java.lang.String |
getNodeIdStr()
|
long |
getPublicSessionId()
|
java.lang.String |
getRelativeName()
|
java.lang.String |
getRelativeName(boolean forceSessionMarker)
|
java.lang.String |
getRelativeNameWithoutSessionMarker()
|
java.lang.String |
getRelativePubSessionIdWildcard()
Note: no blanks in the example below are allowed, we need to write it like this to distinguish it from a java comment |
java.lang.String |
getRelativeSubjectIdWildcard()
Note: no blanks in the example below are allowed, we need to write it like this to distinguish it from a java comment |
java.lang.String |
getRelativeWildcard()
Note: no blanks in the example below are allowed, we need to write it like this to distinguish it from a java comment |
static SessionName |
guessSessionName(Global glob,
java.lang.String nodeId,
java.lang.String queueName)
Guess a SessionName from given callback queueName of old xb_entries (was created from Global.getStrippedId) |
static SessionName |
guessSessionName(Global glob,
java.lang.String nodeId,
java.lang.String queueName,
boolean limitPositivePubToOneDigit)
Not reliable. |
boolean |
isCoreInternalLoginName()
|
boolean |
isInternalLoginName()
|
boolean |
isNodeIdExplicitlyGiven()
Check if the address string given to our constructor had an explicit specified nodeId |
boolean |
isPluginInternalLoginName()
|
boolean |
isPubSessionIdInternal()
|
boolean |
isPubSessionIdUser()
|
boolean |
isSession()
Check if we hold a session or a subject |
static void |
main(java.lang.String[] args)
Method for testing only. |
boolean |
matchRelativeName(java.lang.String pattern)
Check matching name, the subjectId or pubSessionId can be a wildcard "*" (note: no blanks in the example below are allowed, we need to write it like this to distinguish it from a java comment) |
java.lang.String |
toString()
|
java.lang.String |
toXml()
Dump state of this object into a XML ASCII string. |
java.lang.String |
toXml(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string. |
static boolean |
useSessionMarker()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static java.lang.String ME
private final transient Global glob
public static final java.lang.String SEPERATOR
public static final java.lang.String ROOT_MARKER_TAG
public static final java.lang.String SUBJECT_MARKER_TAG
private java.lang.String absoluteName
private NodeId nodeId
private java.lang.String relativeName
private final java.lang.String subjectId
private long pubSessionId
private boolean nodeIdExplicitlyGiven
private static boolean useSessionMarker
Constructor Detail |
---|
public SessionName(Global glob, java.lang.String name)
name
- Examples:
/node/heron/client/joe/2 client/joe/2 joe/2 joe /node/heron/client/joe/session/2 client/joe/session/2 joe/session/2
java.lang.IllegalArgumentException
- if your name can't be parsedpublic SessionName(Global glob, NodeId nodeId, java.lang.String subjectId, long pubSessionId)
public SessionName(Global glob, NodeId nodeId, java.lang.String name)
nodeId
- if not null it has precedence to the nodeId which is probably
found in namename
- Examples:
/node/heron/client/joe/2 client/joe/2 joe/2 joeThe EventPlugin supports wildcard '*' as sessionNumber, to be able to use this parser we map it to Long.MIN_VALUE
java.lang.IllegalArgumentException
- if your name can't be parsedpublic SessionName(Global glob, SessionName sessionName, long pubSessionId)
Method Detail |
---|
public static boolean useSessionMarker()
public java.lang.String getAbsoluteName()
public java.lang.String getAbsoluteName(boolean forceSessionMarker)
public java.lang.String getAbsoluteSubjectName()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRelativeName()
public java.lang.String getRelativeName(boolean forceSessionMarker)
forceSessionMarker
- If false the configured syntax is chosen, if true wie force the
/session/ markup
public java.lang.String getRelativeNameWithoutSessionMarker()
public boolean isNodeIdExplicitlyGiven()
public NodeId getNodeId()
public java.lang.String getNodeIdStr()
public java.lang.String getLoginName()
public final boolean isInternalLoginName()
public final boolean isPluginInternalLoginName()
public final boolean isCoreInternalLoginName()
public long getPublicSessionId()
public boolean isSession()
public boolean isPubSessionIdInternal()
public boolean isPubSessionIdUser()
public boolean equalsRelative(SessionName sessionName)
public boolean equalsAbsolute(SessionName sessionName)
public static SessionName guessSessionName(Global glob, java.lang.String nodeId, java.lang.String queueName)
callback_nodeheronclientjack1 /node/frodo/client/jack/session/1 clientsubscriber71 /node/frodo/client/subscriber/session/71 clientsubscriber7-1 /node/frodo/client/subscriber7/session/-1With limitPositivePubToOneDigit==true:
clientsubscriber71 / node / heron / client / subscriber7 / session / -1Is not bullet proof:
clientpublisher-222 Could be publisher-22/session/2 clientsubscriber7777 Could be subscriber77/session/77
glob
- nodeId
- The Node to usequeueName
- Only for client names, can fail if subjectId ends with number
and has positive session id!
public static SessionName guessSessionName(Global glob, java.lang.String nodeId, java.lang.String queueName, boolean limitPositivePubToOneDigit)
glob
- nodeId
- If null is extracted from queueNamequeueName
- e.g. "connection_nodefrodoclientjack1" or
"connection_clientjack1"limitPositivePubToOneDigit
-
public boolean matchRelativeName(java.lang.String pattern)
pattern
- for example "client/ * /session/ *", ""client/ *
/session/1", "client/joe/session/ *", "client/joe/session/1"
public java.lang.String getRelativeSubjectIdWildcard()
public java.lang.String getRelativePubSessionIdWildcard()
public java.lang.String getRelativeWildcard()
public final java.lang.String toXml()
public final java.lang.String toXml(java.lang.String extraOffset)
extraOffset
- indenting of tags for nice output
public static void main(java.lang.String[] args)
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |