org.apache.catalina.authenticator.SingleSignOnEntry Java Examples

The following examples show how to use org.apache.catalina.authenticator.SingleSignOnEntry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClusterSingleSignOn.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
protected boolean associate(String ssoId, Session session) {
    boolean result = super.associate(ssoId, session);
    if (result) {
        ((ReplicatedMap<String,SingleSignOnEntry>) cache).replicate(ssoId, true);
    }
    return result;
}
 
Example #2
Source File: ClusterSingleSignOn.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
protected boolean update(String ssoId, Principal principal, String authType,
        String username, String password) {
    boolean result = super.update(ssoId, principal, authType, username, password);
    if (result) {
        ((ReplicatedMap<String,SingleSignOnEntry>) cache).replicate(ssoId, true);
    }
    return result;
}
 
Example #3
Source File: ClusterSingleSignOn.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * Start this component and implement the requirements
 * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected synchronized void startInternal() throws LifecycleException {

    // Load the cluster component, if any
    try {
        if(cluster == null) {
            Container host = getContainer();
            if(host instanceof Host) {
                if(host.getCluster() instanceof CatalinaCluster) {
                    setCluster((CatalinaCluster) host.getCluster());
                }
            }
        }
        if (cluster == null) {
            throw new LifecycleException(sm.getString("clusterSingleSignOn.nocluster"));
        }

        ClassLoader[] cls = new ClassLoader[] { this.getClass().getClassLoader() };

        ReplicatedMap<String,SingleSignOnEntry> cache = new ReplicatedMap<>(
                this, cluster.getChannel(), rpcTimeout, cluster.getClusterName() + "-SSO-cache",
                cls, terminateOnStartFailure);
        cache.setChannelSendOptions(mapSendOptions);
        cache.setAccessTimeout(accessTimeout);
        this.cache = cache;
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        throw new LifecycleException(sm.getString("clusterSingleSignOn.clusterLoad.fail"), t);
    }

    super.startInternal();
}
 
Example #4
Source File: ClusterSingleSignOn.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Override
protected boolean associate(String ssoId, Session session) {
    boolean result = super.associate(ssoId, session);
    if (result) {
        ((ReplicatedMap<String,SingleSignOnEntry>) cache).replicate(ssoId, true);
    }
    return result;
}
 
Example #5
Source File: ClusterSingleSignOn.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Override
protected boolean update(String ssoId, Principal principal, String authType,
        String username, String password) {
    boolean result = super.update(ssoId, principal, authType, username, password);
    if (result) {
        ((ReplicatedMap<String,SingleSignOnEntry>) cache).replicate(ssoId, true);
    }
    return result;
}
 
Example #6
Source File: ClusterSingleSignOn.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
/**
 * Start this component and implement the requirements
 * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected synchronized void startInternal() throws LifecycleException {
    
    // Load the cluster component, if any
    try {
        if(cluster == null) {
            Container host = getContainer();
            if(host instanceof Host) {
                if(host.getCluster() instanceof CatalinaCluster) {
                    setCluster((CatalinaCluster) host.getCluster());
                }
            }
        }
        if (cluster == null) {
            throw new LifecycleException(
                    "There is no Cluster for ClusterSingleSignOn");
        }

        ClassLoader[] cls = new ClassLoader[] { this.getClass().getClassLoader() };

        ReplicatedMap<String,SingleSignOnEntry> cache =
                new ReplicatedMap<String,SingleSignOnEntry>(
                this, cluster.getChannel(), rpcTimeout, cluster.getClusterName() + "-SSO-cache",
                cls, terminateOnStartFailure);
        cache.setChannelSendOptions(mapSendOptions);
        this.cache = cache;
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        throw new LifecycleException(
                "ClusterSingleSignOn exception during clusterLoad " + t);
    }

    super.startInternal();
}
 
Example #7
Source File: ClusterSingleSignOn.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
protected boolean associate(String ssoId, Session session) {
    boolean result = super.associate(ssoId, session);
    if (result) {
        ((ReplicatedMap<String,SingleSignOnEntry>) cache).replicate(ssoId, true);
    }
    return result;
}
 
Example #8
Source File: ClusterSingleSignOn.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
protected boolean update(String ssoId, Principal principal, String authType,
        String username, String password) {
    boolean result = super.update(ssoId, principal, authType, username, password);
    if (result) {
        ((ReplicatedMap<String,SingleSignOnEntry>) cache).replicate(ssoId, true);
    }
    return result;
}
 
Example #9
Source File: ClusterSingleSignOn.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
/**
 * Start this component and implement the requirements
 * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected synchronized void startInternal() throws LifecycleException {
    
    // Load the cluster component, if any
    try {
        if(cluster == null) {
            Container host = getContainer();
            if(host instanceof Host) {
                if(host.getCluster() instanceof CatalinaCluster) {
                    setCluster((CatalinaCluster) host.getCluster());
                }
            }
        }
        if (cluster == null) {
            throw new LifecycleException(
                    "There is no Cluster for ClusterSingleSignOn");
        }

        ClassLoader[] cls = new ClassLoader[] { this.getClass().getClassLoader() };

        ReplicatedMap<String,SingleSignOnEntry> cache =
                new ReplicatedMap<String,SingleSignOnEntry>(
                this, cluster.getChannel(), rpcTimeout, cluster.getClusterName() + "-SSO-cache",
                cls, terminateOnStartFailure);
        cache.setChannelSendOptions(mapSendOptions);
        this.cache = cache;
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        throw new LifecycleException(
                "ClusterSingleSignOn exception during clusterLoad " + t);
    }

    super.startInternal();
}