| Method from org.apache.catalina.ha.authenticator.ClusterSingleSignOn Detail: |
protected void associate(String ssoId,
Session session) {
if (cluster != null) {
messageNumber++;
SingleSignOnMessage msg =
new SingleSignOnMessage(cluster.getLocalMember(),
ssoId, session.getId());
Manager mgr = session.getManager();
if ((mgr != null) && (mgr instanceof ClusterManager))
msg.setContextName(((ClusterManager) mgr).getName());
msg.setAction(SingleSignOnMessage.ADD_SESSION);
cluster.sendClusterDomain(msg);
if (containerLog.isDebugEnabled())
containerLog.debug("SingleSignOnMessage Send with action "
+ msg.getAction());
}
associateLocal(ssoId, session);
}
Notify the cluster of the addition of a Session to
an SSO session and associate the specified single
sign on identifier with the specified Session on the
local node. |
protected void associateLocal(String ssoId,
Session session) {
super.associate(ssoId, session);
}
|
protected void deregister(String ssoId) {
if (cluster != null) {
messageNumber++;
SingleSignOnMessage msg =
new SingleSignOnMessage(cluster.getLocalMember(),
ssoId, null);
msg.setAction(SingleSignOnMessage.LOGOUT_SESSION);
cluster.sendClusterDomain(msg);
if (containerLog.isDebugEnabled())
containerLog.debug("SingleSignOnMessage Send with action "
+ msg.getAction());
}
deregisterLocal(ssoId);
}
Notifies the cluster that a single sign on session
has been terminated due to a user logout, deregister
the specified single sign on identifier, and invalidate
any associated sessions on the local node. |
protected void deregister(String ssoId,
Session session) {
if (cluster != null) {
messageNumber++;
SingleSignOnMessage msg =
new SingleSignOnMessage(cluster.getLocalMember(),
ssoId, session.getId());
Manager mgr = session.getManager();
if ((mgr != null) && (mgr instanceof ClusterManager))
msg.setContextName(((ClusterManager) mgr).getName());
msg.setAction(SingleSignOnMessage.DEREGISTER_SESSION);
cluster.sendClusterDomain(msg);
if (containerLog.isDebugEnabled())
containerLog.debug("SingleSignOnMessage Send with action "
+ msg.getAction());
}
deregisterLocal(ssoId, session);
}
Notify the cluster of the removal of a Session from an
SSO session and deregister the specified session. If it is the last
session, then also get rid of the single sign on identifier on the
local node. |
protected void deregisterLocal(String ssoId) {
super.deregister(ssoId);
}
|
protected void deregisterLocal(String ssoId,
Session session) {
super.deregister(ssoId, session);
}
|
public CatalinaCluster getCluster() {
return cluster;
}
|
public String getInfo() {
return (info);
}
Return descriptive information about this Valve implementation. |
protected void register(String ssoId,
Principal principal,
String authType,
String username,
String password) {
if (cluster != null) {
messageNumber++;
SingleSignOnMessage msg =
new SingleSignOnMessage(cluster.getLocalMember(),
ssoId, null);
msg.setAction(SingleSignOnMessage.REGISTER_SESSION);
msg.setAuthType(authType);
msg.setUsername(username);
msg.setPassword(password);
cluster.sendClusterDomain(msg);
if (containerLog.isDebugEnabled())
containerLog.debug("SingleSignOnMessage Send with action "
+ msg.getAction());
}
registerLocal(ssoId, principal, authType, username, password);
}
Notifies the cluster of the creation of a new SSO entry
and register the specified Principal as being associated
with the specified value for the single sign on identifier. |
protected void registerLocal(String ssoId,
Principal principal,
String authType,
String username,
String password) {
super.register(ssoId, principal, authType, username, password);
}
|
protected void removeSession(String ssoId,
Session session) {
if (cluster != null) {
messageNumber++;
SingleSignOnMessage msg =
new SingleSignOnMessage(cluster.getLocalMember(),
ssoId, session.getId());
Manager mgr = session.getManager();
if ((mgr != null) && (mgr instanceof ClusterManager))
msg.setContextName(((ClusterManager) mgr).getName());
msg.setAction(SingleSignOnMessage.REMOVE_SESSION);
cluster.sendClusterDomain(msg);
if (containerLog.isDebugEnabled())
containerLog.debug("SingleSignOnMessage Send with action "
+ msg.getAction());
}
removeSessionLocal(ssoId, session);
}
Remove a single Session from a SingleSignOn and notify the cluster
of the removal. Called when a session is timed out and no longer active. |
protected void removeSessionLocal(String ssoId,
Session session) {
super.removeSession(ssoId, session);
}
|
public void setCluster(CatalinaCluster cluster) {
this.cluster = cluster;
}
|
public void start() throws LifecycleException {
super.start();
clusterSSOListener = new ClusterSingleSignOnListener();
clusterSSOListener.setClusterSSO(this);
// Load the cluster component, if any
try {
//the channel is already running
Cluster cluster = getCluster();
// stop remove cluster binding
if(cluster == null) {
Container host = getContainer();
if(host != null && host instanceof Host) {
cluster = host.getCluster();
if(cluster != null && cluster instanceof CatalinaCluster) {
setCluster((CatalinaCluster) cluster);
getCluster().addClusterListener(clusterSSOListener);
} else {
Container engine = host.getParent();
if(engine != null && engine instanceof Engine) {
cluster = engine.getCluster();
if(cluster != null && cluster instanceof CatalinaCluster) {
setCluster((CatalinaCluster) cluster);
getCluster().addClusterListener(clusterSSOListener);
}
} else {
cluster = null;
}
}
}
}
if (cluster == null) {
throw new LifecycleException
("There is no Cluster for ClusterSingleSignOn");
}
} catch (Throwable t) {
throw new LifecycleException
("ClusterSingleSignOn exception during clusterLoad " + t);
}
}
Prepare for the beginning of active use of the public methods of this
component. This method should be called after configure(),
and before any of the public methods of the component are utilized. |
public void stop() throws LifecycleException {
super.stop();
if (getCluster() != null && getCluster() instanceof CatalinaCluster) {
getCluster().removeClusterListener(clusterSSOListener);
}
}
Gracefully terminate the active use of the public methods of this
component. This method should be the last one called on a given
instance of this component. |
public String toString() {
StringBuffer sb = new StringBuffer("ClusterSingleSignOn[");
if (container == null )
sb.append("Container is null");
else
sb.append(container.getName());
sb.append("]");
return (sb.toString());
}
Return a String rendering of this object. |
protected void update(String ssoId,
Principal principal,
String authType,
String username,
String password) {
if (cluster != null) {
messageNumber++;
SingleSignOnMessage msg =
new SingleSignOnMessage(cluster.getLocalMember(),
ssoId, null);
msg.setAction(SingleSignOnMessage.UPDATE_SESSION);
msg.setAuthType(authType);
msg.setUsername(username);
msg.setPassword(password);
cluster.sendClusterDomain(msg);
if (containerLog.isDebugEnabled())
containerLog.debug("SingleSignOnMessage Send with action "
+ msg.getAction());
}
updateLocal(ssoId, principal, authType, username, password);
}
Notifies the cluster of an update of the security credentials
associated with an SSO session. Updates any SingleSignOnEntry
found under key ssoId with the given authentication data.
The purpose of this method is to allow an SSO entry that was
established without a username/password combination (i.e. established
following DIGEST or CLIENT-CERT authentication) to be updated with
a username and password if one becomes available through a subsequent
BASIC or FORM authentication. The SSO entry will then be usable for
reauthentication.
NOTE: Only updates the SSO entry if a call to
SingleSignOnEntry.getCanReauthenticate() returns
false; otherwise, it is assumed that the SSO entry already
has sufficient information to allow reauthentication and that no update
is needed. |
protected void updateLocal(String ssoId,
Principal principal,
String authType,
String username,
String password) {
super.update(ssoId, principal, authType, username, password);
}
|