001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements. See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership. The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License. You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied. See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019 package org.apache.shiro.session.mgt;
020
021 /**
022 * Interface that should be implemented by classes that can control validating sessions on a regular
023 * basis. This interface is used as a delegate for session validation by the {@link org.apache.shiro.session.mgt.DefaultSessionManager}
024 *
025 * @author Jeremy Haile
026 * @author Les Hazlewood
027 * @see org.apache.shiro.session.mgt.DefaultSessionManager#setSessionValidationScheduler(SessionValidationScheduler)
028 * @since 0.1
029 */
030 public interface SessionValidationScheduler {
031
032 /**
033 * Returns <code>true</code> if this Scheduler is enabled and ready to begin validation at the appropriate time,
034 * <code>false</code> otherwise.
035 * <p/>
036 * It does <em>not</em> indicate if the validation is actually executing at that instant - only that it is prepared
037 * to do so at the appropriate time.
038 *
039 * @return <code>true</code> if this Scheduler is enabled and ready to begin validation at the appropriate time,
040 * <code>false</code> otherwise.
041 */
042 boolean isEnabled();
043
044 /**
045 * Enables the session validation job.
046 */
047 void enableSessionValidation();
048
049 /**
050 * Disables the session validation job.
051 */
052 void disableSessionValidation();
053
054 }