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