1. /*
  2. * @(#)Control.java 1.5 00/02/02
  3. *
  4. * Copyright 1999, 2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.naming.ldap;
  11. /**
  12. * This interface represents an LDAPv3 control as defined in
  13. * <A HREF="ftp://ftp.isi.edu/in-notes/rfc2251.txt">RFC 2251</A>.
  14. *<p>
  15. * The LDAPv3 protocol uses controls to send and receive additional data
  16. * to affect the behavior of predefined operations.
  17. * Controls can be sent along with any LDAP operation to the server.
  18. * These are referred to as <em>request controls</em>. For example, a
  19. * "sort" control can be sent with an LDAP search operation to
  20. * request that the results be returned in a particular order.
  21. * Solicited and unsolicited controls can also be returned with
  22. * responses from the server. Such controls are referred to as
  23. * <em>response controls</em>. For example, an LDAP server might
  24. * define a special control to return change notifications.
  25. *<p>
  26. * This interface is used to represent both request and response controls.
  27. *
  28. * @author Rosanna Lee
  29. * @author Scott Seligman
  30. * @author Vincent Ryan
  31. * @version 1.5 00/02/02
  32. *
  33. * @see ControlFactory
  34. * @since 1.3
  35. */
  36. public interface Control extends java.io.Serializable {
  37. /**
  38. * Indicates a critical control.
  39. * The value of this constant is <tt>true</tt>.
  40. */
  41. public static final boolean CRITICAL = true;
  42. /**
  43. * Indicates a non-critical control.
  44. * The value of this constant is <tt>false</tt>.
  45. */
  46. public static final boolean NONCRITICAL = false;
  47. /**
  48. * Retrieves the object identifier assigned for the LDAP control.
  49. *
  50. * @return The non-null object identifier string.
  51. */
  52. public String getID();
  53. /**
  54. * Determines the criticality of the LDAP control.
  55. * A critical control must not be ignored by the server.
  56. * In other words, if the server receives a critical control
  57. * that it does not support, regardless of whether the control
  58. * makes sense for the operation, the operation will not be performed
  59. * and an <tt>OperationNotSupportedException</tt> will be thrown.
  60. * @return true if this control is critical; false otherwise.
  61. */
  62. public boolean isCritical();
  63. /**
  64. * Retrieves the ASN.1 BER encoded value of the LDAP control.
  65. * The result is the raw BER bytes including the tag and length of
  66. * the control's value. It does not include the controls OID or criticality.
  67. *
  68. * Null is returned if the value is absent.
  69. *
  70. * @return A possibly null byte array representing the ASN.1 BER encoded
  71. * value of the LDAP control.
  72. */
  73. public byte[] getEncodedValue();
  74. // static final long serialVersionUID = -591027748900004825L;
  75. }