1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.security.auth;
  6. /**
  7. * Objects such as credentials may optionally implement this
  8. * interface to provide the capability to refresh itself.
  9. * For example, a credential with a particular time-restricted lifespan
  10. * may implement this interface to allow callers to refresh the time period
  11. * for which it is valid.
  12. *
  13. * @version 1.5, 01/11/00
  14. * @see javax.security.auth.Subject
  15. */
  16. public interface Refreshable {
  17. /**
  18. * Determine if this <code>Object</code> is current.
  19. *
  20. * <p>
  21. *
  22. * @return true if this <code>Object</code> is currently current,
  23. * false otherwise.
  24. */
  25. boolean isCurrent();
  26. /**
  27. * Update or extend the validity period for this
  28. * <code>Object</code>.
  29. *
  30. * <p>
  31. *
  32. * @exception SecurityException if the caller does not have permission
  33. * to update or extend the validity period for this
  34. * <code>Object</code>. <p>
  35. *
  36. * @exception RefreshFailedException if the refresh attempt failed.
  37. */
  38. void refresh() throws RefreshFailedException;
  39. }