|
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.Authenticate
public final class Authenticate
Authenticate a client via login.
The login method serves as a factory for a xmlBlaster.Server Reference
Field Summary | |
---|---|
private boolean |
acceptWrongSenderAddress
|
private java.util.Set<I_ClientListener> |
clientListenerSet
For listeners who want to be informed about login/logout |
private long |
counter
Unique counter to generate IDs |
private ServerScope |
glob
|
private static java.util.logging.Logger |
log
|
private java.util.Map<java.lang.String,SubjectInfo> |
loginNameSubjectInfoMap
With this map you can find a client using his login name. |
private java.lang.String |
ME
|
private PluginManager |
plgnLdr
|
private java.util.Map<java.lang.String,SessionInfo> |
sessionInfoMap
With this map you can find a client using a sessionId. |
private I_XmlBlaster |
xmlBlasterImpl
The singleton handle for this xmlBlaster server |
Constructor Summary | |
---|---|
Authenticate(ServerScope global)
|
Method Summary | |
---|---|
void |
addClientListener(I_ClientListener l)
Adds the specified client listener to receive login/logout events. |
void |
changeSecretSessionId(java.lang.String oldSessionId,
java.lang.String newSessionId)
Replace the old by the new session id |
SessionInfo |
check(java.lang.String secretSessionId)
Use this method to check a clients authentication. |
ConnectReturnQosServer |
connect(ConnectQosServer xmlQos)
Login to xmlBlaster. |
ConnectReturnQosServer |
connect(ConnectQosServer connectQos,
java.lang.String forcedSecretSessionId)
Login to xmlBlaster. |
void |
connectionState(java.lang.String secretSessionId,
ConnectionStateEnum state)
Helper method where protocol layers may report a lost connection (e.g. |
private java.lang.String |
createSessionId(java.lang.String loginName)
Generate a unique (and secret) resource ID |
void |
disconnect(java.lang.String secretSessionId,
java.lang.String qos_literal)
|
private void |
fireClientEvent(SessionInfo sessionInfo,
boolean login)
Used to fire an event if a client does a login / logout |
private void |
firePreRemovedClientEvent(SessionInfo sessionInfo)
|
java.lang.String |
getClientList()
For JMX MBean: These are the login names returned, every client may be logged in multiple times which you can't see here |
private I_ClientListener[] |
getClientListenerArr()
Returns a current snapshot of all ClientListeners |
ServerScope |
getGlobal()
|
int |
getMaxClients()
For JMX MBean: The maximum number of different users, the sessions may be higher |
int |
getMaxSubjects()
|
java.lang.String |
getName()
Enforced by I_RunlevelListener |
int |
getNumClients()
For JMX MBean: The number of different users, the sessions may be higher |
int |
getNumSubjects()
|
private SessionInfo |
getOrCreateSessionInfo(SessionName sessionName,
ConnectQosServer connectQos)
Blocks for existing SessionInfo until it is initialized. |
SubjectInfo |
getOrCreateSubjectInfoByName(SessionName subjectName,
boolean returnLocked,
I_Subject subjectCtx,
CbQueueProperty prop)
Access a subjectInfo with the unique login name. |
SessionInfo |
getSessionInfo(SessionName sessionName)
Find a session by its login name and pubSessionId or return null if not found |
private SessionInfo |
getSessionInfo(java.lang.String secretSessionId)
Access a sessionInfo with the unique secretSessionId. |
SessionInfo[] |
getSessionInfoArr()
Returns a current snapshot of all sessions, never returns null. |
SessionInfo |
getSessionInfoByName(SessionName sessionName)
|
java.util.Map |
getSessionInfoMap()
Just to testing sync |
SubjectInfo[] |
getSubjectInfoArr()
Get a current snapshot of all known subjects. |
SubjectInfo |
getSubjectInfoByName(SessionName subjectName)
Access a subjectInfo with the unique login name |
java.lang.String |
getSubjectList()
Access a list of login names e.g. |
java.lang.String[] |
getSubjects()
Access a list of login names e.g. |
I_XmlBlaster |
getXmlBlaster()
Access the xmlBlaster singleton. |
boolean |
isAcceptWrongSenderAddress(SessionInfo sessionInfo)
Authorization check (TODO: generic approach) |
private boolean |
isKnownInSessionInfoMap(java.lang.String previousSecretSessionId)
|
java.lang.String |
login(java.lang.String loginName,
java.lang.String passwd,
java.lang.String xmlQoS_literal,
java.lang.String secretSessionId)
|
void |
logout(java.lang.String secretSessionId)
Logout of a client. |
void |
removeClientListener(I_ClientListener l)
Removes the specified listener |
(package private) void |
removeLoginName(SubjectInfo subjectInfo)
Remove a SubjectInfo instance. |
private void |
resetSessionInfo(SessionInfo sessionInfo,
boolean clearQueue,
boolean forceShutdownEvenIfEntriesExist,
boolean isDisconnecting)
|
void |
runlevelChange(int from,
int to,
boolean force)
Invoked on run level change, see RunlevelManager.RUNLEVEL_HALTED and RunlevelManager.RUNLEVEL_RUNNING Enforced by I_RunlevelListener |
boolean |
sessionExists(java.lang.String secretSessionId)
|
void |
setAcceptWrongSenderAddress(boolean acceptWrongSenderAddress)
|
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. |
SessionInfo |
unsecureCreateSession(ConnectQos connectQos)
Use this to create a user and session for internal users only. |
private void |
updateConnectQos(SessionInfo sessionInfo,
ConnectQosServer newConnectQos)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.lang.String ME
private final PluginManager plgnLdr
private long counter
private final ServerScope glob
private static java.util.logging.Logger log
private final java.util.Map<java.lang.String,SessionInfo> sessionInfoMap
private final java.util.Map<java.lang.String,SubjectInfo> loginNameSubjectInfoMap
private final java.util.Set<I_ClientListener> clientListenerSet
private final I_XmlBlaster xmlBlasterImpl
private boolean acceptWrongSenderAddress
Constructor Detail |
---|
public Authenticate(ServerScope global) throws XmlBlasterException
XmlBlasterException
Method Detail |
---|
public java.util.Map getSessionInfoMap()
public ServerScope getGlobal()
public I_XmlBlaster getXmlBlaster()
public java.lang.String login(java.lang.String loginName, java.lang.String passwd, java.lang.String xmlQoS_literal, java.lang.String secretSessionId) throws XmlBlasterException
XmlBlasterException
public SessionInfo unsecureCreateSession(ConnectQos connectQos) throws XmlBlasterException
XmlBlasterException
public final ConnectReturnQosServer connect(ConnectQosServer xmlQos) throws XmlBlasterException
XmlBlasterException
private boolean isKnownInSessionInfoMap(java.lang.String previousSecretSessionId)
public final ConnectReturnQosServer connect(ConnectQosServer connectQos, java.lang.String forcedSecretSessionId) throws XmlBlasterException
connectQos
- The login/connect QoS, see ConnectQosServer.javasecretSessionId
- The caller (here CORBA-POA protocol driver or SessionPersistencePlugin) may insist to you its own secretSessionId
XmlBlasterException
public final void disconnect(java.lang.String secretSessionId, java.lang.String qos_literal) throws XmlBlasterException
XmlBlasterException
public final SubjectInfo getOrCreateSubjectInfoByName(SessionName subjectName, boolean returnLocked, I_Subject subjectCtx, CbQueueProperty prop) throws XmlBlasterException
returnLocked
- true: The SubjectInfo is lockedprop
- Can be null
the
- SubjectInfo object is never locked in such a case
XmlBlasterException
void removeLoginName(SubjectInfo subjectInfo)
public int getNumSubjects()
public final SubjectInfo getSubjectInfoByName(SessionName subjectName)
public final SessionInfo getSessionInfoByName(SessionName sessionName)
public final void changeSecretSessionId(java.lang.String oldSessionId, java.lang.String newSessionId) throws XmlBlasterException
XmlBlasterException
private final SessionInfo getSessionInfo(java.lang.String secretSessionId)
public final SessionInfo[] getSessionInfoArr()
public final SessionInfo getSessionInfo(SessionName sessionName)
private final SessionInfo getOrCreateSessionInfo(SessionName sessionName, ConnectQosServer connectQos) throws XmlBlasterException
sessionName
- connectQos
-
XmlBlasterException
public boolean sessionExists(java.lang.String secretSessionId)
public final void logout(java.lang.String secretSessionId) throws XmlBlasterException
XmlBlasterException
- If client is unknownprivate void resetSessionInfo(SessionInfo sessionInfo, boolean clearQueue, boolean forceShutdownEvenIfEntriesExist, boolean isDisconnecting) throws XmlBlasterException
sessionInfo
- clearQueue
- Shall the message queue of the client be destroyed as well on last session logout?forceShutdownEvenIfEntriesExist
- on last sessionisDisconnecting
- true if this method is invoked while explicitly disconnecting a session, false
otherwise. It is used to determine if the session queue (callback queue) has to be cleared or not.
XmlBlasterException
private java.lang.String createSessionId(java.lang.String loginName) throws XmlBlasterException
loginName
-
XmlBlasterException
- random generatorprivate final I_ClientListener[] getClientListenerArr()
private void firePreRemovedClientEvent(SessionInfo sessionInfo) throws XmlBlasterException
XmlBlasterException
private void fireClientEvent(SessionInfo sessionInfo, boolean login) throws XmlBlasterException
XmlBlasterException
private void updateConnectQos(SessionInfo sessionInfo, ConnectQosServer newConnectQos) throws XmlBlasterException
XmlBlasterException
public SessionInfo check(java.lang.String secretSessionId) throws XmlBlasterException
This method is called from an invoked xmlBlaster-server method (like subscribe()), using the delivered secretSessionId
XmlBlasterException
- Access deniedpublic void addClientListener(I_ClientListener l)
public void removeClientListener(I_ClientListener l)
public int getMaxSubjects()
public SubjectInfo[] getSubjectInfoArr()
public java.lang.String[] getSubjects()
public java.lang.String getSubjectList()
public java.lang.String getName()
getName
in interface I_RunlevelListener
public void connectionState(java.lang.String secretSessionId, ConnectionStateEnum state)
The SessionInfo can than do an immediate ping() to trigger POLLING mode
I_Authenticate.connectionState(String, ConnectionStateEnum)
public void runlevelChange(int from, int to, boolean force) throws XmlBlasterException
runlevelChange
in interface I_RunlevelListener
from
- The current runlevelto
- The runlevel we want to switch toforce
- If true force the change even if messages are lost
XmlBlasterException
public final java.lang.String toXml()
public final java.lang.String toXml(java.lang.String extraOffset)
extraOffset
- indenting of tags for nice output
public int getNumClients()
public int getMaxClients()
public java.lang.String getClientList()
public boolean isAcceptWrongSenderAddress(SessionInfo sessionInfo)
sessionInfo
- can be null to get the general setting
public void setAcceptWrongSenderAddress(boolean acceptWrongSenderAddress)
acceptWrongSenderAddress
- the acceptWrongSenderAddress to set
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |