1. /*
  2. * @(#)RealmChoiceCallback.java 1.12 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.security.sasl;
  8. import javax.security.auth.callback.ChoiceCallback;
  9. /**
  10. * This callback is used by <tt>SaslClient</tt> and <tt>SaslServer</tt>
  11. * to obtain a realm given a list of realm choices.
  12. *
  13. * @since 1.5
  14. *
  15. * @author Rosanna Lee
  16. * @author Rob Weltman
  17. */
  18. public class RealmChoiceCallback extends ChoiceCallback {
  19. /**
  20. * Constructs a <tt>RealmChoiceCallback</tt> with a prompt, a list of
  21. * choices and a default choice.
  22. *
  23. * @param prompt the non-null prompt to use to request the realm.
  24. * @param choices the non-null list of realms to choose from.
  25. * @param defaultChoice the choice to be used as the default choice
  26. * when the list of choices is displayed. It is an index into
  27. * the <tt>choices</tt> arary.
  28. * @param multiple true if multiple choices allowed; false otherwise
  29. * @throws IllegalArgumentException If <tt>prompt</tt> is null or the empty string,
  30. * if <tt>choices</tt> has a length of 0, if any element from
  31. * <tt>choices</tt> is null or empty, or if <tt>defaultChoice</tt>
  32. * does not fall within the array boundary of <tt>choices</tt>
  33. */
  34. public RealmChoiceCallback(String prompt, String[]choices,
  35. int defaultChoice, boolean multiple) {
  36. super(prompt, choices, defaultChoice, multiple);
  37. }
  38. private static final long serialVersionUID = -8588141348846281332L;
  39. }