|
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.authentication.SessionInfo
public final class SessionInfo
SessionInfo stores all known session data about a client.
One client (SubjectInfo) may have multiple login sessions. Each session has its callback queue to deliver subscribed messages to the client. We distinguish two different unique ID for each login session:
Field Summary | |
---|---|
private boolean |
acceptWrongSenderAddress
|
private java.lang.Object |
authorizationCache
Can be optionally used by authorization frameworks |
private boolean |
blockClientSessionLogin
|
private ConnectQosServer |
connectQos
The current connection address from the protocol plugin |
private ContextNode |
contextNode
|
private ServerDispatchManager |
dispatchManager
manager for sending callback messages |
private java.lang.Object |
EXPIRY_TIMER_MONITOR
Protects timerKey refresh |
private Timeout |
expiryTimer
|
private ServerScope |
glob
|
private boolean |
initialized
|
private static long |
instanceCounter
|
private long |
instanceId
|
private boolean |
isShutdown
|
private long |
lastNumEntries
|
private java.util.concurrent.locks.ReentrantLock |
lock
|
private static java.util.logging.Logger |
log
|
private JmxMBeanHandle |
mbeanHandle
My JMX registration |
private java.lang.String |
ME
|
private MsgErrorHandler |
msgErrorHandler
Do error recovery if message can't be delivered and we give it up |
private QueueQueryPlugin |
queueQueryPlugin
this is used for administrative gets (queries on callback queue) |
private ClientPropertiesInfo |
remoteProperties
Holding properties send by our remote client via the topic __sys__sessionProperties |
private I_Session |
securityCtx
|
private SessionInfoProtector |
sessionInfoProtector
|
private SessionName |
sessionName
The cluster wide unique identifier of the session e.g. |
private I_Queue |
sessionQueue
All MsgUnit which shall be delivered to the current session of the client are queued here to be ready to deliver. |
private long |
startupTime
Incarnation time of this object instance in millis |
private DispatchStatistic |
statistic
Statistic about send/received messages, can be null if there is a DispatchManager around |
private SubjectInfo |
subjectInfo
|
private Timestamp |
timerKey
|
private boolean |
transientWarn
To prevent noisy warnings |
private XmlBlasterException |
transportConnectFail
|
private java.util.Map<java.lang.String,java.lang.Object> |
userMap
Map to store arbitrary info for this client, is cleaned up automatically when session dies Useful for example for plugins |
Constructor Summary | |
---|---|
SessionInfo(ServerScope glob,
SessionName sessionName)
Create this instance when a client did a login. |
Method Summary | |
---|---|
ClientProperty |
addRemoteProperty(java.lang.String key,
java.lang.String value)
Add a remote property. |
void |
changed(I_Storage storage,
long numEntries,
long numBytes,
boolean isShutdown)
We register for queue size changes and notify the subject queue if we are willing to accept messages again. |
long |
clearCallbackQueue()
|
void |
clearLastCallbackException()
|
int |
clearRemoteProperties(java.lang.String prefix)
Clear remote properties. |
java.lang.String |
disconnectClientKeepSession()
|
void |
finalize()
|
AddressServer |
getAddressServer()
The address information got from the protocol plugin. |
java.lang.String |
getAliveSinceDate()
|
java.lang.Object |
getAuthorizationCache()
Can be optionally used by the current authorization plugin. |
MsgUnit[] |
getCallbackQueueEntries(java.lang.String query)
|
long |
getCbQueueBytes()
|
long |
getCbQueueBytesCache()
|
long |
getCbQueueMaxMsgs()
|
long |
getCbQueueMaxMsgsCache()
|
long |
getCbQueueNumMsgs()
|
long |
getCbQueueNumMsgsCache()
|
java.lang.String |
getConnectionState()
|
ConnectQosServer |
getConnectQos()
|
ContextNode |
getContextNode()
The unique name of this session instance. |
boolean |
getDispatcherActive()
|
ServerDispatchManager |
getDispatchManager()
|
DispatchStatistic |
getDispatchStatistic()
|
java.lang.String |
getId()
Cluster wide unique identifier: /node/heron/client/ |
long |
getInstanceId()
This is a unique instance id per JVM (it is the pubSessionId if the client hasn't specified its own). |
java.lang.String |
getLastCallbackException()
|
java.util.concurrent.locks.ReentrantLock |
getLock()
Access the synchronization object of this SessionInfo instance. |
java.lang.String |
getLoginDate()
|
java.lang.String |
getLoginName()
Access the unique login name of a client. |
I_MsgErrorHandler |
getMsgErrorHandler()
|
int |
getNumCallbackExceptions()
|
long |
getNumErase()
|
long |
getNumGet()
|
long |
getNumPublish()
|
long |
getNumSubscribe()
|
long |
getNumUnSubscribe()
|
long |
getNumUpdate()
|
long |
getNumUpdateOneway()
|
long |
getPersistenceUniqueId()
Gets the uniqueId for the persistence of this session. |
long |
getPingRoundTripDelay()
|
java.lang.String |
getPollingSinceDate()
|
long |
getPublicSessionId()
This is the publicSessionId which is unique in the subject scope. |
java.lang.String |
getQos()
|
ClientPropertiesInfo |
getRemoteProperties()
|
java.util.Map<java.lang.String,ClientProperty> |
getRemotePropertiesMap()
|
ClientProperty[] |
getRemotePropertyArr()
|
java.lang.String[] |
getRootSubscriptions()
|
long |
getRoundTripDelay()
|
java.lang.String |
getSecretSessionId()
|
I_Session |
getSecuritySession()
|
SessionInfoProtector |
getSessionInfoProtector()
The protector prevents direct access to this sessionInfo instance. |
SessionName |
getSessionName()
|
I_Queue |
getSessionQueue()
This queue holds all messages which where addressed to this session |
java.lang.String |
getSessionTimeoutExpireDate()
|
SubjectInfo |
getSubjectInfo()
Accessing the SubjectInfo object |
java.lang.String[] |
getSubscribedTopics()
|
java.lang.String |
getSubscriptionDump()
|
java.lang.String[] |
getSubscriptions()
|
XmlBlasterException |
getTransportConnectFail()
If the connection failed the reason is stored here, like this cleanup code knows what happened. |
long |
getUptime()
|
java.lang.String |
getUsageUrl()
JMX |
java.lang.Object |
getUserObject(java.lang.String key,
java.lang.Object defaultValue)
Map to store arbitrary info for this client, is cleaned up automatically when session dies Useful for example for plugins |
java.util.Map<java.lang.String,java.lang.Object> |
getUserObjectMap()
Use carefully to not harm other plugins. |
boolean |
hasAddress(AddressBase addr)
Is the given address the same as our? |
boolean |
hasCallback()
Check if a callback was configured (if client has passed a callback address on connect). |
boolean |
hasUserObject(java.lang.String key)
|
(package private) void |
init(SubjectInfo subjectInfo,
I_Session securityCtx,
ConnectQosServer connectQos)
|
boolean |
isAcceptWrongSenderAddress()
Configure server with '-xmlBlaster/acceptWrongSenderAddress true' or "-xmlBlaster/acceptWrongSenderAddress/joe true". |
boolean |
isAlive()
|
boolean |
isBlockClientSessionLogin()
|
boolean |
isCallbackConfigured()
|
(package private) boolean |
isInitialized()
|
boolean |
isSameSession(SessionInfo sessionInfo)
Check cluster wide if the sessions are identical |
boolean |
isShutdown()
|
boolean |
isStalled()
|
java.lang.String |
killSession()
|
void |
lostClientConnection()
Can be called when client connection is lost (NOT the callback connection). |
void |
mergeRemoteProperties(java.util.Map map)
Update properties send by our client. |
java.lang.String[] |
peekCallbackMessages(int numOfEntries)
|
java.lang.String[] |
peekCallbackMessagesToFile(int numOfEntries,
java.lang.String path)
Peek messages from callback queue and dump them to a file, they are not removed. |
java.lang.String |
pingClientCallbackServer()
|
void |
queueMessage(MsgQueueEntry entry)
Put the given message entry into the queue |
java.lang.String |
reactivateDispatcherThread(boolean force)
|
void |
refreshSession()
Call this to reactivate the session expiry to full value |
long |
releaseLockAssertOne(java.lang.String errorInfo)
Freeing sessionInfo lock with test/assert code. |
void |
removeExpiryTimer()
|
long |
removeFromCallbackQueue(long numOfEntries)
|
void |
setAcceptWrongSenderAddress(boolean acceptWrongSenderAddress)
|
void |
setAuthorizationCache(java.lang.Object authorizationCache)
|
java.lang.String |
setBlockClientSessionLogin(boolean blockClient)
|
void |
setDispatcherActive(boolean dispatcherActive)
Sets the DispachManager belonging to this session to active or inactive. |
void |
setPersistenceUniqueId(long persistenceId)
Sets the uniqueId used to retrieve this session from the persistence |
void |
setRemoteProperties(java.util.Map map)
Set properties send by our client. |
void |
setSecuritySession(I_Session ctx)
|
void |
setSessionTimeout(long timeout)
JMX Enforced by ConnectQosDataMBean interface. |
void |
setTransportConnectFail(XmlBlasterException transportConnectFail)
|
void |
setUsageUrl(java.lang.String url)
|
java.lang.Object |
setUserObject(java.lang.String key,
java.lang.Object value)
The key should use a prefix to not collide with other users / plugins. |
void |
shutdown()
|
java.lang.String |
subscribe(java.lang.String url,
java.lang.String qos)
|
void |
timeout(java.lang.Object userData)
We are notified when this session expires. |
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,
java.util.Properties props)
Dump state of this object into a XML ASCII string. |
java.lang.String[] |
unSubscribe(java.lang.String url,
java.lang.String qos)
|
java.lang.String[] |
unSubscribeByIndex(int index,
java.lang.String qos)
|
void |
updateConnectQos(ConnectQosServer newConnectQos)
|
java.lang.String |
usage()
JMX |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String ME
private ContextNode contextNode
private final SessionName sessionName
private SubjectInfo subjectInfo
private I_Session securityCtx
private static long instanceCounter
private long instanceId
private ConnectQosServer connectQos
private Timeout expiryTimer
private Timestamp timerKey
private ServerScope glob
private static java.util.logging.Logger log
private MsgErrorHandler msgErrorHandler
private ServerDispatchManager dispatchManager
private volatile DispatchStatistic statistic
private boolean isShutdown
private final java.lang.Object EXPIRY_TIMER_MONITOR
private SessionInfoProtector sessionInfoProtector
private JmxMBeanHandle mbeanHandle
private boolean transientWarn
private java.lang.Object authorizationCache
private boolean blockClientSessionLogin
private XmlBlasterException transportConnectFail
private ClientPropertiesInfo remoteProperties
private boolean acceptWrongSenderAddress
private I_Queue sessionQueue
private long lastNumEntries
private long startupTime
private java.util.concurrent.locks.ReentrantLock lock
private volatile QueueQueryPlugin queueQueryPlugin
private boolean initialized
private java.util.Map<java.lang.String,java.lang.Object> userMap
Constructor Detail |
---|
SessionInfo(ServerScope glob, SessionName sessionName)
Method Detail |
---|
void init(SubjectInfo subjectInfo, I_Session securityCtx, ConnectQosServer connectQos) throws XmlBlasterException
subjectInfo
- the SubjectInfo with the login informations for this client
XmlBlasterException
final boolean isInitialized()
public final boolean isAlive()
public final ContextNode getContextNode()
public boolean isAcceptWrongSenderAddress()
public void setAcceptWrongSenderAddress(boolean acceptWrongSenderAddress)
acceptWrongSenderAddress
- the acceptWrongSenderAddress to setpublic AddressServer getAddressServer()
public final SessionInfoProtector getSessionInfoProtector()
public final long getInstanceId()
It is NOT the secret sessionId and may be published with PtP messages without security danger
public java.util.concurrent.locks.ReentrantLock getLock()
public long releaseLockAssertOne(java.lang.String errorInfo)
errorInfo
-
public final boolean hasCallback()
public final I_MsgErrorHandler getMsgErrorHandler()
public final long getPublicSessionId()
getInstanceId()
public void finalize()
finalize
in class java.lang.Object
public boolean isShutdown()
public void removeExpiryTimer()
public void shutdown()
public final ServerDispatchManager getDispatchManager()
public final DispatchStatistic getDispatchStatistic()
public final void refreshSession() throws XmlBlasterException
XmlBlasterException
public final void timeout(java.lang.Object userData)
timeout
in interface I_Timeout
userData
- You get bounced back your userData which you passed
with Timeout.addTimeoutListener()public final boolean hasAddress(AddressBase addr)
public final void queueMessage(MsgQueueEntry entry) throws XmlBlasterException
XmlBlasterException
public final ConnectQosServer getConnectQos()
public final void updateConnectQos(ConnectQosServer newConnectQos) throws XmlBlasterException
XmlBlasterException
public final java.lang.String getLoginName()
public final SubjectInfo getSubjectInfo()
public java.lang.String getSecretSessionId()
public I_Session getSecuritySession()
public void setSecuritySession(I_Session ctx)
public I_Queue getSessionQueue()
public final java.lang.String getId()
public final SessionName getSessionName()
public boolean isSameSession(SessionInfo sessionInfo)
public void changed(I_Storage storage, long numEntries, long numBytes, boolean isShutdown)
changed
in interface I_StorageSizeListener
storage
- The queue which fires the change eventnumEntries
- the number of entries in the queue after the
change has taken placenumBytes
- number of bytes in the queue after the change
has taken change.isShutdown
- Is set to true if queue.shutdown() was executedpublic final java.lang.String toString()
toString
in class java.lang.Object
getId()
public final java.lang.String toXml()
public final java.lang.String toXml(java.lang.String extraOffset, java.util.Properties props)
extraOffset
- indenting of tags for nice output
public java.lang.String getQos()
public final boolean isCallbackConfigured()
public final long getUptime()
public final java.lang.String getConnectionState()
public final java.lang.String getLoginDate()
public final java.lang.String getSessionTimeoutExpireDate()
public final java.lang.String getAliveSinceDate()
public final java.lang.String getPollingSinceDate()
public final java.lang.String getLastCallbackException()
public final void clearLastCallbackException()
public final int getNumCallbackExceptions()
public final long getNumPublish()
public final long getNumSubscribe()
public final long getNumUnSubscribe()
public final long getNumGet()
public final long getNumErase()
public final long getNumUpdateOneway()
public final long getNumUpdate()
public final long getCbQueueNumMsgs()
public final long getCbQueueBytes()
public final long getCbQueueBytesCache()
public final long getCbQueueNumMsgsCache()
public final long getCbQueueMaxMsgs()
public final long getCbQueueMaxMsgsCache()
public java.lang.String pingClientCallbackServer()
public long getPingRoundTripDelay()
public long getRoundTripDelay()
public final java.lang.String[] getSubscribedTopics()
public final java.lang.String subscribe(java.lang.String url, java.lang.String qos) throws XmlBlasterException
XmlBlasterException
public java.lang.String[] unSubscribeByIndex(int index, java.lang.String qos) throws XmlBlasterException
XmlBlasterException
public final java.lang.String[] unSubscribe(java.lang.String url, java.lang.String qos) throws XmlBlasterException
XmlBlasterException
public final java.lang.String[] getSubscriptions() throws XmlBlasterException
XmlBlasterException
public final java.lang.String[] getRootSubscriptions() throws XmlBlasterException
XmlBlasterException
public final java.lang.String getSubscriptionDump() throws XmlBlasterException
XmlBlasterException
public final java.lang.String killSession() throws XmlBlasterException
XmlBlasterException
public final long getPersistenceUniqueId()
public final void setPersistenceUniqueId(long persistenceId)
persistenceId
- public void setDispatcherActive(boolean dispatcherActive)
dispatchActive
- public boolean getDispatcherActive()
public java.lang.String reactivateDispatcherThread(boolean force)
public java.lang.String[] peekCallbackMessages(int numOfEntries) throws XmlBlasterException
XmlBlasterException
public java.lang.String[] peekCallbackMessagesToFile(int numOfEntries, java.lang.String path) throws java.lang.Exception
numOfEntries
- The number of messages to peek, taken from the frontpath
- The path to dump the messages to, it is automatically created if missing.
java.lang.Exception
public long clearCallbackQueue()
public long removeFromCallbackQueue(long numOfEntries) throws XmlBlasterException
XmlBlasterException
public MsgUnit[] getCallbackQueueEntries(java.lang.String query) throws XmlBlasterException
XmlBlasterException
public final void setSessionTimeout(long timeout)
public java.lang.String usage()
public java.lang.String getUsageUrl()
public void setUsageUrl(java.lang.String url)
public ClientPropertiesInfo getRemoteProperties()
public ClientProperty[] getRemotePropertyArr()
public java.util.Map<java.lang.String,ClientProperty> getRemotePropertiesMap()
public void setRemoteProperties(java.util.Map map)
remoteProperties
- The remoteProperties to set, pass null to reset.
The key is of type String and the value of type ClientPropertypublic int clearRemoteProperties(java.lang.String prefix)
prefix
- if not null only keys starting with are removed
public void mergeRemoteProperties(java.util.Map map)
remoteProperties
- The remoteProperties to set,
if a property exists its value is overwritten, passing null does nothing
The key is of type String and the value of type ClientPropertypublic ClientProperty addRemoteProperty(java.lang.String key, java.lang.String value)
key
- The unique key (no multimap)value
- The value, it is assumed to be of type "String"
public boolean isStalled()
public void lostClientConnection()
public XmlBlasterException getTransportConnectFail()
public void setTransportConnectFail(XmlBlasterException transportConnectFail)
transportConnectFail
- the transportConnectFail to setpublic java.lang.Object getAuthorizationCache()
public void setAuthorizationCache(java.lang.Object authorizationCache)
public boolean isBlockClientSessionLogin()
public java.lang.String setBlockClientSessionLogin(boolean blockClient)
public java.lang.String disconnectClientKeepSession()
public java.lang.Object getUserObject(java.lang.String key, java.lang.Object defaultValue)
public boolean hasUserObject(java.lang.String key)
public java.lang.Object setUserObject(java.lang.String key, java.lang.Object value)
key
- value
-
public java.util.Map<java.lang.String,java.lang.Object> getUserObjectMap()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |