001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kim.sesn.timeouthandlers;
017
018import java.util.Map;
019
020/**
021 * This interface allows different methods for handling timeouts for Authentication
022 * 
023 * @author Kuali Rice Team (rice.collab@kuali.org)
024 *
025 */
026public interface TimeoutHandler {
027    
028    /**
029     * Determines the timeout based on the context and initiator
030     *
031     * @param args the args passed depends on the requirements of the TimeoutHandler Implementation
032     *
033     * @return the timeout in seconds.  Returns 0 to disable timeouts.
034     */
035    public int getTimeout(Map<String,Object> args);
036    
037    
038    /**
039     * Determines if the timeout has expired
040     *
041     * @param args the args passed depends on the requirements of the TimeoutHandler Implementation
042     *
043     * @return true if the session has timed out.
044     */
045    public boolean hasTimedOut(Map<String,Object> args);
046
047}