Java 类org.apache.catalina.ha.session.SerializablePrincipal 实例源码

项目:class-guard    文件:ClusterSingleSignOn.java   
/**
 * 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.
 *
 * @param ssoId Single sign on identifier to register
 * @param principal Associated user principal that is identified
 * @param authType Authentication type used to authenticate this
 *  user principal
 * @param username Username used to authenticate this user
 * @param password Password used to authenticate this user
 */
@Override
protected void register(String ssoId, Principal principal, String authType,
              String username, String password) {

    if (cluster != null && cluster.getMembers().length > 0) {
        messageNumber++;
        SingleSignOnMessage msg =
            new SingleSignOnMessage(cluster.getLocalMember(),
                                    ssoId, null);
        msg.setAction(SingleSignOnMessage.REGISTER_SESSION);
        msg.setAuthType(authType);
        msg.setUsername(username);
        msg.setPassword(password);

        SerializablePrincipal sp = null;
        if (principal instanceof GenericPrincipal) {
            sp = SerializablePrincipal.createPrincipal((GenericPrincipal) principal);
            msg.setPrincipal(sp);
        }

        cluster.send(msg);
        if (containerLog.isDebugEnabled())
            containerLog.debug("SingleSignOnMessage Send with action "
                               + msg.getAction());
    }

    registerLocal(ssoId, principal, authType, username, password);

}
项目:class-guard    文件:ClusterSingleSignOn.java   
/**
 * Notifies the cluster of an update of the security credentials
 * associated with an SSO session. Updates any <code>SingleSignOnEntry</code>
 * found under key <code>ssoId</code> with the given authentication data.
 * <p>
 * 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.
 * <p>
 * <b>NOTE:</b> Only updates the SSO entry if a call to
 * <code>SingleSignOnEntry.getCanReauthenticate()</code> returns
 * <code>false</code>; otherwise, it is assumed that the SSO entry already
 * has sufficient information to allow reauthentication and that no update
 * is needed.
 *
 * @param ssoId     identifier of Single sign to be updated
 * @param principal the <code>Principal</code> returned by the latest
 *                  call to <code>Realm.authenticate</code>.
 * @param authType  the type of authenticator used (BASIC, CLIENT-CERT,
 *                  DIGEST or FORM)
 * @param username  the username (if any) used for the authentication
 * @param password  the password (if any) used for the authentication
 */
@Override
protected void update(String ssoId, Principal principal, String authType,
                      String username, String password) {

    if (cluster != null && cluster.getMembers().length > 0) {
        messageNumber++;
        SingleSignOnMessage msg =
            new SingleSignOnMessage(cluster.getLocalMember(),
                                    ssoId, null);
        msg.setAction(SingleSignOnMessage.UPDATE_SESSION);
        msg.setAuthType(authType);
        msg.setUsername(username);
        msg.setPassword(password);

        SerializablePrincipal sp = null;
        if (principal instanceof GenericPrincipal) {
            sp = SerializablePrincipal.createPrincipal((GenericPrincipal) principal);
            msg.setPrincipal(sp);
        }

        cluster.send(msg);
        if (containerLog.isDebugEnabled())
            containerLog.debug("SingleSignOnMessage Send with action "
                               + msg.getAction());
    }

    updateLocal(ssoId, principal, authType, username, password);

}
项目:apache-tomcat-7.0.57    文件:ClusterSingleSignOn.java   
/**
 * 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.
 *
 * @param ssoId Single sign on identifier to register
 * @param principal Associated user principal that is identified
 * @param authType Authentication type used to authenticate this
 *  user principal
 * @param username Username used to authenticate this user
 * @param password Password used to authenticate this user
 */
@Override
protected void register(String ssoId, Principal principal, String authType,
              String username, String password) {

    if (cluster != null && cluster.getMembers().length > 0) {
        messageNumber++;
        SingleSignOnMessage msg =
            new SingleSignOnMessage(cluster.getLocalMember(),
                                    ssoId, null);
        msg.setAction(SingleSignOnMessage.REGISTER_SESSION);
        msg.setAuthType(authType);
        msg.setUsername(username);
        msg.setPassword(password);

        SerializablePrincipal sp = null;
        if (principal instanceof GenericPrincipal) {
            sp = SerializablePrincipal.createPrincipal((GenericPrincipal) principal);
            msg.setPrincipal(sp);
        }

        cluster.send(msg);
        if (containerLog.isDebugEnabled())
            containerLog.debug("SingleSignOnMessage Send with action "
                               + msg.getAction());
    }

    registerLocal(ssoId, principal, authType, username, password);

}
项目:apache-tomcat-7.0.57    文件:ClusterSingleSignOn.java   
/**
 * Notifies the cluster of an update of the security credentials
 * associated with an SSO session. Updates any <code>SingleSignOnEntry</code>
 * found under key <code>ssoId</code> with the given authentication data.
 * <p>
 * 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.
 * <p>
 * <b>NOTE:</b> Only updates the SSO entry if a call to
 * <code>SingleSignOnEntry.getCanReauthenticate()</code> returns
 * <code>false</code>; otherwise, it is assumed that the SSO entry already
 * has sufficient information to allow reauthentication and that no update
 * is needed.
 *
 * @param ssoId     identifier of Single sign to be updated
 * @param principal the <code>Principal</code> returned by the latest
 *                  call to <code>Realm.authenticate</code>.
 * @param authType  the type of authenticator used (BASIC, CLIENT-CERT,
 *                  DIGEST or FORM)
 * @param username  the username (if any) used for the authentication
 * @param password  the password (if any) used for the authentication
 */
@Override
protected void update(String ssoId, Principal principal, String authType,
                      String username, String password) {

    if (cluster != null && cluster.getMembers().length > 0) {
        messageNumber++;
        SingleSignOnMessage msg =
            new SingleSignOnMessage(cluster.getLocalMember(),
                                    ssoId, null);
        msg.setAction(SingleSignOnMessage.UPDATE_SESSION);
        msg.setAuthType(authType);
        msg.setUsername(username);
        msg.setPassword(password);

        SerializablePrincipal sp = null;
        if (principal instanceof GenericPrincipal) {
            sp = SerializablePrincipal.createPrincipal((GenericPrincipal) principal);
            msg.setPrincipal(sp);
        }

        cluster.send(msg);
        if (containerLog.isDebugEnabled())
            containerLog.debug("SingleSignOnMessage Send with action "
                               + msg.getAction());
    }

    updateLocal(ssoId, principal, authType, username, password);

}
项目:apache-tomcat-7.0.57    文件:ClusterSingleSignOn.java   
/**
 * 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.
 *
 * @param ssoId Single sign on identifier to register
 * @param principal Associated user principal that is identified
 * @param authType Authentication type used to authenticate this
 *  user principal
 * @param username Username used to authenticate this user
 * @param password Password used to authenticate this user
 */
@Override
protected void register(String ssoId, Principal principal, String authType,
              String username, String password) {

    if (cluster != null && cluster.getMembers().length > 0) {
        messageNumber++;
        SingleSignOnMessage msg =
            new SingleSignOnMessage(cluster.getLocalMember(),
                                    ssoId, null);
        msg.setAction(SingleSignOnMessage.REGISTER_SESSION);
        msg.setAuthType(authType);
        msg.setUsername(username);
        msg.setPassword(password);

        SerializablePrincipal sp = null;
        if (principal instanceof GenericPrincipal) {
            sp = SerializablePrincipal.createPrincipal((GenericPrincipal) principal);
            msg.setPrincipal(sp);
        }

        cluster.send(msg);
        if (containerLog.isDebugEnabled())
            containerLog.debug("SingleSignOnMessage Send with action "
                               + msg.getAction());
    }

    registerLocal(ssoId, principal, authType, username, password);

}
项目:apache-tomcat-7.0.57    文件:ClusterSingleSignOn.java   
/**
 * Notifies the cluster of an update of the security credentials
 * associated with an SSO session. Updates any <code>SingleSignOnEntry</code>
 * found under key <code>ssoId</code> with the given authentication data.
 * <p>
 * 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.
 * <p>
 * <b>NOTE:</b> Only updates the SSO entry if a call to
 * <code>SingleSignOnEntry.getCanReauthenticate()</code> returns
 * <code>false</code>; otherwise, it is assumed that the SSO entry already
 * has sufficient information to allow reauthentication and that no update
 * is needed.
 *
 * @param ssoId     identifier of Single sign to be updated
 * @param principal the <code>Principal</code> returned by the latest
 *                  call to <code>Realm.authenticate</code>.
 * @param authType  the type of authenticator used (BASIC, CLIENT-CERT,
 *                  DIGEST or FORM)
 * @param username  the username (if any) used for the authentication
 * @param password  the password (if any) used for the authentication
 */
@Override
protected void update(String ssoId, Principal principal, String authType,
                      String username, String password) {

    if (cluster != null && cluster.getMembers().length > 0) {
        messageNumber++;
        SingleSignOnMessage msg =
            new SingleSignOnMessage(cluster.getLocalMember(),
                                    ssoId, null);
        msg.setAction(SingleSignOnMessage.UPDATE_SESSION);
        msg.setAuthType(authType);
        msg.setUsername(username);
        msg.setPassword(password);

        SerializablePrincipal sp = null;
        if (principal instanceof GenericPrincipal) {
            sp = SerializablePrincipal.createPrincipal((GenericPrincipal) principal);
            msg.setPrincipal(sp);
        }

        cluster.send(msg);
        if (containerLog.isDebugEnabled())
            containerLog.debug("SingleSignOnMessage Send with action "
                               + msg.getAction());
    }

    updateLocal(ssoId, principal, authType, username, password);

}
项目:class-guard    文件:SingleSignOnMessage.java   
public SerializablePrincipal getPrincipal() {
    return principal;
}
项目:class-guard    文件:SingleSignOnMessage.java   
public void setPrincipal(SerializablePrincipal principal) {
    this.principal = principal;
}
项目:apache-tomcat-7.0.57    文件:SingleSignOnMessage.java   
public SerializablePrincipal getPrincipal() {
    return principal;
}
项目:apache-tomcat-7.0.57    文件:SingleSignOnMessage.java   
public void setPrincipal(SerializablePrincipal principal) {
    this.principal = principal;
}
项目:apache-tomcat-7.0.57    文件:SingleSignOnMessage.java   
public SerializablePrincipal getPrincipal() {
    return principal;
}
项目:apache-tomcat-7.0.57    文件:SingleSignOnMessage.java   
public void setPrincipal(SerializablePrincipal principal) {
    this.principal = principal;
}