001/* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * Copyright 2013-2014 ForgeRock AS. 024 */ 025package org.forgerock.opendj.ldap; 026 027/** 028 * Listener on timeout events. 029 * <p> 030 * The listener must register itself with a {@code TimeoutChecker} using 031 * {@code TimeoutChecker#addListener()} method to be called back with 032 * {@code #handleTimeout} method. 033 * <p> 034 * The listener must deregister itself using 035 * {@code TimeoutChecker#removeListener()} to stop being called back. 036 */ 037public interface TimeoutEventListener { 038 039 /** 040 * Handle a timeout event. 041 * 042 * @param currentTime 043 * Time to use as current time for any check. 044 * @return The delay to wait before next timeout callback in milliseconds, 045 * or zero if this listener should no longer be notified. 046 */ 047 long handleTimeout(long currentTime); 048 049 /** 050 * Returns the timeout for this listener. 051 * 052 * @return The timeout in milliseconds. 053 */ 054 long getTimeout(); 055 056}