xmlBlaster 2.2.0 API

org.xmlBlaster.authentication
Class SubjectInfoProtector

java.lang.Object
  extended by org.xmlBlaster.authentication.SubjectInfoProtector
All Implemented Interfaces:
SubjectInfoProtectorMBean, I_AdminSubject, I_AdminUsage

public final class SubjectInfoProtector
extends java.lang.Object
implements SubjectInfoProtectorMBean

SubjectInfoProtector protects SubjectInfo.java from direct access by administrative tasks.

See javadoc of SubjectInfo.java for a description

Author:
Marcel Ruff

Field Summary
private  SubjectInfo subjectInfo
           
 
Constructor Summary
SubjectInfoProtector(SubjectInfo subjectInfo)
           
 
Method Summary
 java.lang.String blockClientAndResetConnections()
          Prevent client login and reset all its ALIVE protocol connections.
 java.lang.String getCreationDate()
          Get date when this subject was created.
 int getMaxSessions()
          Returns the maximum allowed login sessions for this subject.
 int getNumSessions()
          Returns how many login sessions this subject currently has.
 long getNumUpdate()
          How many messages where sent to all of this clients login sessions.
 I_AdminSession getSessionByPubSessionId(long pubSessionId)
          Navigate to a session instance.
 java.lang.String getSessionList()
          Get a list of all session names for this subject.
 java.lang.String[] getSessions()
          Get a list of all session names for this subject.
 MsgUnit[] getSubjectQueueEntries(java.lang.String querySpec)
          Query the history queue, can be peeking or consuming.
 long getSubjectQueueMaxMsgs()
          Returns the maximum allowed PtP messages in this queue.
 long getSubjectQueueNumMsgs()
          Returns how many PtP messages are currently in my subject queue.
 long getUptime()
          Get elapsed seconds since this subject was created.
 java.lang.String getUsageUrl()
          JMX
 boolean isBlockClientLogin()
          Prevent client from login.
 java.lang.String killClient()
          Destroy the client with all its sessions.
 java.lang.String[] peekSubjectMessages(int numOfEntries)
          Peek point to point messages from subject queue, they are not removed
 java.lang.String[] peekSubjectMessagesToFile(int numOfEntries, java.lang.String path)
          Peek messages from PtP subject queue and dump them to a file, they are not removed.
 java.lang.String setBlockClientLogin(boolean blockClient)
          Allow or prevent client login.
 void setMaxSessions(int maxSessions)
          Configure the maximum allowed login sessions for this subject.
 void setUsageUrl(java.lang.String url)
           
 java.lang.String usage()
          JMX
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subjectInfo

private final SubjectInfo subjectInfo
Constructor Detail

SubjectInfoProtector

public SubjectInfoProtector(SubjectInfo subjectInfo)
Method Detail

getUptime

public long getUptime()
Description copied from interface: I_AdminSubject
Get elapsed seconds since this subject was created.

Specified by:
getUptime in interface I_AdminSubject

getCreationDate

public java.lang.String getCreationDate()
Description copied from interface: I_AdminSubject
Get date when this subject was created. This happens usually on a first login or on a first PtP message for this destination.

Specified by:
getCreationDate in interface I_AdminSubject
Returns:
The date string

getNumUpdate

public long getNumUpdate()
Description copied from interface: I_AdminSubject
How many messages where sent to all of this clients login sessions.

Specified by:
getNumUpdate in interface I_AdminSubject
Returns:
Number of updated messages send

getSubjectQueueNumMsgs

public long getSubjectQueueNumMsgs()
Description copied from interface: I_AdminSubject
Returns how many PtP messages are currently in my subject queue.

Specified by:
getSubjectQueueNumMsgs in interface I_AdminSubject
Returns:
Number of messages in the queue

getSubjectQueueMaxMsgs

public long getSubjectQueueMaxMsgs()
Description copied from interface: I_AdminSubject
Returns the maximum allowed PtP messages in this queue.

Specified by:
getSubjectQueueMaxMsgs in interface I_AdminSubject
Returns:
The max messages supported

getNumSessions

public int getNumSessions()
Description copied from interface: I_AdminSubject
Returns how many login sessions this subject currently has.

Specified by:
getNumSessions in interface I_AdminSubject
Returns:
Number of sessions of this subject

getMaxSessions

public int getMaxSessions()
Description copied from interface: I_AdminSubject
Returns the maximum allowed login sessions for this subject.

Specified by:
getMaxSessions in interface I_AdminSubject
Returns:
Max. number of sessions for this subject

setMaxSessions

public void setMaxSessions(int maxSessions)
Description copied from interface: I_AdminSubject
Configure the maximum allowed login sessions for this subject.

Specified by:
setMaxSessions in interface I_AdminSubject
Parameters:
maxSessions - The maximum number of sessions for this subject

isBlockClientLogin

public boolean isBlockClientLogin()
Description copied from interface: I_AdminSubject
Prevent client from login.

Specified by:
isBlockClientLogin in interface I_AdminSubject
Returns:
true if client may not login, existing sessions are not destroyed

setBlockClientLogin

public java.lang.String setBlockClientLogin(boolean blockClient)
Description copied from interface: I_AdminSubject
Allow or prevent client login. Note this is for going into maintenance mode only as you can't hit this button (there is no Subject showing this button) if the client hasn't been here and is not a fail save client.

Specified by:
setBlockClientLogin in interface I_AdminSubject
Parameters:
blockClient - true to prevent client logins

blockClientAndResetConnections

public java.lang.String blockClientAndResetConnections()
Description copied from interface: I_AdminSubject
Prevent client login and reset all its ALIVE protocol connections. The callback queue entries remain for fail save clients

Note this is for going into maintenance mode only as you can't hit this button (there is no Subject showing this button) if the client hasn't been here and is not a fail save client.

Specified by:
blockClientAndResetConnections in interface I_AdminSubject

getSessionList

public java.lang.String getSessionList()
Description copied from interface: I_AdminSubject
Get a list of all session names for this subject.

Specified by:
getSessionList in interface I_AdminSubject
Returns:
Comma separated list of sessions

getSessions

public java.lang.String[] getSessions()
Description copied from interface: I_AdminSubject
Get a list of all session names for this subject.

Specified by:
getSessions in interface I_AdminSubject
Returns:
Array of session names

getSessionByPubSessionId

public I_AdminSession getSessionByPubSessionId(long pubSessionId)
Description copied from interface: I_AdminSubject
Navigate to a session instance.

Specified by:
getSessionByPubSessionId in interface I_AdminSubject
Parameters:
pubSessionId - The public session ID of the session to lookup
Returns:
The found session interface

killClient

public java.lang.String killClient()
                            throws XmlBlasterException
Description copied from interface: I_AdminSubject
Destroy the client with all its sessions.

Specified by:
killClient in interface I_AdminSubject
Returns:
The list of killed sessions (public session IDs)
Throws:
XmlBlasterException

peekSubjectMessages

public java.lang.String[] peekSubjectMessages(int numOfEntries)
                                       throws XmlBlasterException
Description copied from interface: I_AdminSubject
Peek point to point messages from subject queue, they are not removed

Specified by:
peekSubjectMessages in interface I_AdminSubject
Parameters:
numOfEntries - The number of messages to peek, taken from the front
Returns:
The dump of the messages
Throws:
XmlBlasterException

peekSubjectMessagesToFile

public java.lang.String[] peekSubjectMessagesToFile(int numOfEntries,
                                                    java.lang.String path)
                                             throws java.lang.Exception
Description copied from interface: I_AdminSubject
Peek messages from PtP subject queue and dump them to a file, they are not removed.

Specified by:
peekSubjectMessagesToFile in interface I_AdminSubject
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

getSubjectQueueEntries

public MsgUnit[] getSubjectQueueEntries(java.lang.String querySpec)
                                 throws XmlBlasterException
Description copied from interface: I_AdminSubject
Query the history queue, can be peeking or consuming.

Specified by:
getSubjectQueueEntries in interface I_AdminSubject
Parameters:
querySpec - Can be configured to be consuming e.g. "maxEntries=3&maxSize=-1&consumable=true&waitingDelay=0"
Throws:
XmlBlasterException
See Also:
The engine.qos.queryspec.QueueQuery requirement

usage

public java.lang.String usage()
JMX

Specified by:
usage in interface I_AdminUsage
Returns:
a human readable usage help string

getUsageUrl

public java.lang.String getUsageUrl()
JMX

Specified by:
getUsageUrl in interface I_AdminUsage
Returns:
A link on javadoc for JMX usage

setUsageUrl

public void setUsageUrl(java.lang.String url)
Specified by:
setUsageUrl in interface I_AdminUsage

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.