xmlBlaster 2.2.0 API

org.xmlBlaster.engine.admin
Interface I_AdminSession

All Superinterfaces:
ConnectQosDataMBean, I_AdminUsage
All Known Subinterfaces:
SessionInfoProtectorMBean
All Known Implementing Classes:
SessionInfoProtector

public interface I_AdminSession
extends ConnectQosDataMBean, I_AdminUsage

Declares available methods of a session for administration.

SNMP or telnet tools can access only the here declared properties.
This interface is implemented by SessionInfo.java, delivering the meat.

Since:
0.79f
Author:
xmlBlaster@marcelruff.info

Method Summary
 java.lang.String addRemoteProperty(java.lang.String key, java.lang.String value)
          Add a remote property.
 long clearCallbackQueue()
          Removes all callback entries.
 void clearLastCallbackException()
          Clear the last exception text.
 java.lang.String clearRemoteProperties()
          Remove all remote properties from this session.
 java.lang.String clearRemotePropertiesStartingWith(java.lang.String prefix)
          Remove remote properties which key starts with the given prefix
 java.lang.String disconnectClientKeepSession()
           
 java.lang.String getAliveSinceDate()
          Get the date when last time a ALIVE state was reached.
 MsgUnit[] getCallbackQueueEntries(java.lang.String querySpec)
          Gets the entries in the callback queue according to what is specified in the querySpec
 long getCbQueueBytes()
          Number of bytes used by the callback queue.
 long getCbQueueBytesCache()
          Number of bytes used on the RAM part of the callback queue.
 long getCbQueueMaxMsgs()
          How many messages are max.
 long getCbQueueMaxMsgsCache()
          How many messages are max.
 long getCbQueueNumMsgs()
          How many messages are in this clients session callback queue
 long getCbQueueNumMsgsCache()
          How many messages are in this clients session callback queue and are cached
 java.lang.String getConnectionState()
          Access the callback connection status.
 ConnectQosServer getConnectQos()
           
 long getCurrBytesWritten()
          The number of bytes read from the currently outgoing message or response.
 boolean getDispatcherActive()
          true if the dispatcher is currently able to dispatch asyncronously
 java.lang.String getId()
          Access the cluster wide unique identifier: /node/heron/client//
 java.lang.String getLastCallbackException()
          Holds the last exception text for JMX.
 java.lang.String getLoginDate()
          Get date when client logged in.
 java.lang.String getLoginName()
          Get the login name.
 long getNumBytesToWrite()
          The size of the currently outgoing message or response Note: Currently only implemented by the SOCKET protocol driver
 int getNumCallbackExceptions()
          Holds the total amount of exceptions since startup.
 long getNumErase()
          How many subscribe requests where received from this clients login session
 long getNumGet()
          How many get requests where received from this clients login session
 long getNumPublish()
          How many messages where received from this clients login session
 long getNumSubscribe()
          How many subscribe requests where received from this clients login session
 long getNumUnSubscribe()
          How many unsubscribe requests where received from this clients login session
 long getNumUpdate()
          How many messages where sent to this clients login session
 long getNumUpdateOneway()
          How many oneway messages where sent to this clients login session
 long getOverallBytesWritten()
          Overall bytes send since startup Note: Currently only implemented by the SOCKET protocol driver
 long getPingRoundTripDelay()
          Measures the round trip for the last ping() invocation in milli seconds.
 java.lang.String getPollingSinceDate()
          Get the date when last time a POLLING state was reached.
 long getPublicSessionId()
          Get the sessions public session id.
 java.lang.String getQos()
          Access the configuration
 java.lang.String[] getRemoteProperties()
          Access all known remote properties kept in this session.
 java.lang.String[] getRootSubscriptions()
          If XPATH, the parent XPATH is returned and not all its children
 long getRoundTripDelay()
          Measures the round trip for the last remote method invocation in milli seconds.
 java.lang.String getSessionTimeoutExpireDate()
          Get the estimated date when the session expires if no refresh occures
 java.lang.String[] getSubscribedTopics()
          Comma separated list of all subscribed topic oids of this login session
 java.lang.String getSubscriptionDump()
          An XML dump of all subscriptions of this login session
 java.lang.String[] getSubscriptions()
          Access a list of all subscriptionId of this login session
 long getUptime()
          Uptime in seconds
 java.util.Map<java.lang.String,java.lang.Object> getUserObjectMap()
           
 boolean isAcceptWrongSenderAddress()
          Configure server with '-xmlBlaster/acceptWrongSenderAddress true' or "-xmlBlaster/acceptWrongSenderAddress/joe true".
 boolean isBlockClientSessionLogin()
          Prevent clients session from login.
 boolean isCallbackConfigured()
          Check if a callback was configured, if client has passed a callback address on connect.
 boolean isStalled()
          Returns true if the connection is currently stalled (detected in the dispatch statistics when pinging).
 java.lang.String killSession()
          Invoke operation to destroy the session (force logout)
 java.lang.String[] peekCallbackMessages(int numOfEntries)
          Peek messages from callback queue, they are not removed
 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()
          Send a ping to the clients callback server.
 java.lang.String reactivateDispatcherThread(boolean force)
           
 void refreshSession()
          Invoke operation to reactivate the session expiry to full value
 long removeFromCallbackQueue(long numOfEntries)
          Removes max num messages.
 void setAcceptWrongSenderAddress(boolean acceptWrongSenderAddress)
           
 java.lang.String setBlockClientSessionLogin(boolean blockClient)
          Allow or prevent the clients session to login.
 void setDispatcherActive(boolean dispatcherActive)
          Activates/inhibits the dispatch of messages to this session.
 java.lang.String subscribe(java.lang.String url, java.lang.String qos)
          Invoke operation to subscribe the topic, given by its oid
 java.lang.String[] unSubscribe(java.lang.String url, java.lang.String qos)
          Invoke operation to unSubscribe one/many topics.
 java.lang.String[] unSubscribeByIndex(int index, java.lang.String qos)
          Invoke operation to unSubscribe one topic by index listed.
 
Methods inherited from interface org.xmlBlaster.util.qos.ConnectQosDataMBean
getMaxSessions, getSessionTimeout, isPersistent, isPtpAllowed, setSessionTimeout
 
Methods inherited from interface org.xmlBlaster.util.admin.I_AdminUsage
getUsageUrl, setUsageUrl, usage
 

Method Detail

getId

java.lang.String getId()
Access the cluster wide unique identifier: /node/heron/client//


getQos

java.lang.String getQos()
Access the configuration


getLoginName

java.lang.String getLoginName()
Get the login name.


isCallbackConfigured

boolean isCallbackConfigured()
Check if a callback was configured, if client has passed a callback address on connect.


getConnectionState

java.lang.String getConnectionState()
Access the callback connection status.


getPublicSessionId

long getPublicSessionId()
Get the sessions public session id.


getLoginDate

java.lang.String getLoginDate()
Get date when client logged in.


getSessionTimeoutExpireDate

java.lang.String getSessionTimeoutExpireDate()
Get the estimated date when the session expires if no refresh occures


getAliveSinceDate

java.lang.String getAliveSinceDate()
Get the date when last time a ALIVE state was reached. An alive client is reachable with its callback connection.

Returns:
For example "2005-03-21 11:18:12.622"

getPollingSinceDate

java.lang.String getPollingSinceDate()
Get the date when last time a POLLING state was reached. A polling client is not reachable with its callback connection.

Returns:
For example "2005-03-21 11:18:12.622"

getLastCallbackException

java.lang.String getLastCallbackException()
Holds the last exception text for JMX. Typically a user exception thrown from the remote client or a communication exception.

Returns:
The exception text or "" but never null

clearLastCallbackException

void clearLastCallbackException()
Clear the last exception text.


getNumCallbackExceptions

int getNumCallbackExceptions()
Holds the total amount of exceptions since startup.

Returns:
The number of exceptions occurred

refreshSession

void refreshSession()
                    throws XmlBlasterException
Invoke operation to reactivate the session expiry to full value

Throws:
XmlBlasterException

getUptime

long getUptime()
Uptime in seconds


getNumPublish

long getNumPublish()
How many messages where received from this clients login session


getNumSubscribe

long getNumSubscribe()
How many subscribe requests where received from this clients login session


getNumUnSubscribe

long getNumUnSubscribe()
How many unsubscribe requests where received from this clients login session


getNumGet

long getNumGet()
How many get requests where received from this clients login session


getNumErase

long getNumErase()
How many subscribe requests where received from this clients login session


getNumUpdateOneway

long getNumUpdateOneway()
How many oneway messages where sent to this clients login session


getNumUpdate

long getNumUpdate()
How many messages where sent to this clients login session


getCurrBytesWritten

long getCurrBytesWritten()
The number of bytes read from the currently outgoing message or response. Note: Currently only implemented by the SOCKET protocol driver

Returns:
Number of bytes written

getNumBytesToWrite

long getNumBytesToWrite()
The size of the currently outgoing message or response Note: Currently only implemented by the SOCKET protocol driver

Returns:
Number of bytes written

getOverallBytesWritten

long getOverallBytesWritten()
Overall bytes send since startup Note: Currently only implemented by the SOCKET protocol driver

Returns:
Number of bytes written

getCbQueueNumMsgs

long getCbQueueNumMsgs()
How many messages are in this clients session callback queue


getCbQueueBytes

long getCbQueueBytes()
Number of bytes used by the callback queue. Note that this is the bytes occupied by the references (which point to the real message in msgUnitStore)

Returns:
the approximately occupied bytes

getCbQueueNumMsgsCache

long getCbQueueNumMsgsCache()
How many messages are in this clients session callback queue and are cached

Returns:
-1 if no cach queue is used

getCbQueueBytesCache

long getCbQueueBytesCache()
Number of bytes used on the RAM part of the callback queue. Note that this is the bytes occupied by the references (which point to the real message in msgUnitStore)

Returns:
the approximately occupied bytes; -1L if not applicable (e.g. only a persistent queue is configured)

getCbQueueMaxMsgs

long getCbQueueMaxMsgs()
How many messages are max. allowed in this clients session callback queue


getCbQueueMaxMsgsCache

long getCbQueueMaxMsgsCache()
How many messages are max. allowed in the cache of the callback queue,

Returns:
is -1 if no cache queue implementation is used

pingClientCallbackServer

java.lang.String pingClientCallbackServer()
Send a ping to the clients callback server.

Returns:
Returns the pingRoundTripDelay.

getPingRoundTripDelay

long getPingRoundTripDelay()
Measures the round trip for the last ping() invocation in milli seconds.

Returns:
Returns the pingRoundTripDelay.

getRoundTripDelay

long getRoundTripDelay()
Measures the round trip for the last remote method invocation in milli seconds. For example update(), publish(), subscribe()

Returns:
Returns the roundTripDelay.

getSubscribedTopics

java.lang.String[] getSubscribedTopics()
Comma separated list of all subscribed topic oids of this login session


unSubscribe

java.lang.String[] unSubscribe(java.lang.String url,
                               java.lang.String qos)
                               throws XmlBlasterException
Invoke operation to unSubscribe one/many topics.

Parameters:
url - The topic oid/xpath to unSubscribe (e.g. "Hello" or "xpath://key")
qos - The qos XML string (e.g. "" or "")
Returns:
The status string
Throws:
XmlBlasterException

unSubscribeByIndex

java.lang.String[] unSubscribeByIndex(int index,
                                      java.lang.String qos)
                                      throws XmlBlasterException
Invoke operation to unSubscribe one topic by index listed.

Parameters:
index - 0 will kill the first listed subscription, 1 the second and so forth
qos - The qos XML string (e.g. "" or "")
Returns:
The status string
Throws:
XmlBlasterException

subscribe

java.lang.String subscribe(java.lang.String url,
                           java.lang.String qos)
                           throws XmlBlasterException
Invoke operation to subscribe the topic, given by its oid

Parameters:
url - The topic oid/xpath to subscribe (e.g. "Hello" or "xpath://key")
qos - The qos XML string (e.g. "" or "")
Returns:
The status string
Throws:
XmlBlasterException

getSubscriptions

java.lang.String[] getSubscriptions()
                                    throws java.lang.Exception
Access a list of all subscriptionId of this login session

Returns:
An array with subscriptionId
Throws:
java.lang.Exception

getRootSubscriptions

java.lang.String[] getRootSubscriptions()
                                        throws java.lang.Exception
If XPATH, the parent XPATH is returned and not all its children

Returns:
Throws:
java.lang.Exception

getSubscriptionDump

java.lang.String getSubscriptionDump()
                                     throws XmlBlasterException
An XML dump of all subscriptions of this login session

Throws:
XmlBlasterException

killSession

java.lang.String killSession()
                             throws XmlBlasterException
Invoke operation to destroy the session (force logout)

Throws:
XmlBlasterException

getUserObjectMap

java.util.Map<java.lang.String,java.lang.Object> getUserObjectMap()

setDispatcherActive

void setDispatcherActive(boolean dispatcherActive)
Activates/inhibits the dispatch of messages to this session. This is a very helpful operation as you can temporary stop sending messages to a client, they are nicely queued and after activating again the messages are send.

Parameters:
dispatcherActive - true: callback messages are send to the client if connected false: messages are hold back

getDispatcherActive

boolean getDispatcherActive()
true if the dispatcher is currently able to dispatch asyncronously


reactivateDispatcherThread

java.lang.String reactivateDispatcherThread(boolean force)

peekCallbackMessages

java.lang.String[] peekCallbackMessages(int numOfEntries)
                                        throws XmlBlasterException
Peek messages from callback queue, they are not removed

Parameters:
numOfEntries - The number of messages to peek, taken from the front
Returns:
The dump of the messages
Throws:
XmlBlasterException

peekCallbackMessagesToFile

java.lang.String[] peekCallbackMessagesToFile(int numOfEntries,
                                              java.lang.String path)
                                              throws java.lang.Exception
Peek messages from callback queue and dump them to a file, they are not removed.

Parameters:
numOfEntries - The number of messages to peek, taken from the front
path - The path to dump the messages to, it is automatically created if missing.
Returns:
The absolute file names dumped
Throws:
java.lang.Exception

getCallbackQueueEntries

MsgUnit[] getCallbackQueueEntries(java.lang.String querySpec)
                                  throws XmlBlasterException
Gets the entries in the callback queue according to what is specified in the querySpec

Parameters:
querySpec - maxEntries=3&maxSize=-1&consumable=false&waitingDelay=0
Throws:
XmlBlasterException
See Also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/engine.qos.queryspec.QueueQuery.html

clearCallbackQueue

long clearCallbackQueue()
Removes all callback entries.

Returns:
The number of entries erased

removeFromCallbackQueue

long removeFromCallbackQueue(long numOfEntries)
                             throws java.lang.Exception
Removes max num messages. This method does not block.

Parameters:
numOfEntries - Erase num entries or less if less entries are available, -1 erases everything
Returns:
Number of entries erased
Throws:
java.lang.Exception - if the underlying implementation gets an exception.

getRemoteProperties

java.lang.String[] getRemoteProperties()
Access all known remote properties kept in this session. The remote properties are client side settings send to the server, they contain informations which, for example, can be used by the EventPlugin to alert administrators.

Returns:
The properties in notation key=value
See Also:
The admin.events requirement

clearRemotePropertiesStartingWith

java.lang.String clearRemotePropertiesStartingWith(java.lang.String prefix)
Remove remote properties which key starts with the given prefix

Parameters:
prefix - For examlpe "logging/"
Returns:
A string describing success

clearRemoteProperties

java.lang.String clearRemoteProperties()
Remove all remote properties from this session.

Returns:
Some receipt text

addRemoteProperty

java.lang.String addRemoteProperty(java.lang.String key,
                                   java.lang.String value)
Add a remote property. Usually this is done by a publish of a client, but for testing reasons we can to it here manually. If the key exists, its value is overwritten

Parameters:
key - The unique key (no multimap)
value - The value, it is assumed to be of type "String"
Returns:
Some receipt text
See Also:
The admin.events requirement

getConnectQos

ConnectQosServer getConnectQos()

isStalled

boolean isStalled()
Returns true if the connection is currently stalled (detected in the dispatch statistics when pinging).

Returns:

isAcceptWrongSenderAddress

boolean isAcceptWrongSenderAddress()
Configure server with '-xmlBlaster/acceptWrongSenderAddress true' or "-xmlBlaster/acceptWrongSenderAddress/joe true".

Returns:
true: We accept wrong sender address in PublishQos.getSender() (not myself)

setAcceptWrongSenderAddress

void setAcceptWrongSenderAddress(boolean acceptWrongSenderAddress)
Parameters:
acceptWrongSenderAddress - the acceptWrongSenderAddress to set

isBlockClientSessionLogin

boolean isBlockClientSessionLogin()
Prevent clients session from login.

Returns:
true if clients session may not login

setBlockClientSessionLogin

java.lang.String setBlockClientSessionLogin(boolean blockClient)
Allow or prevent the clients session to login. Note this is for going into maintenance mode only as you can't hit this button (there is no Session showing this button) if the client hasn't been here and is not a fail save client.

Parameters:
blockClient - true to prevent this clients session login

disconnectClientKeepSession

java.lang.String disconnectClientKeepSession()

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.