1. /*
  2. * @(#)ExtendedResponse.java 1.4 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 LDAP extended operation response as defined in
  13. * <A HREF="ftp://ftp.isi.edu/in-notes/rfc2251.txt">RFC 2251</A>.
  14. * <pre>
  15. * ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
  16. * COMPONENTS OF LDAPResult,
  17. * responseName [10] LDAPOID OPTIONAL,
  18. * response [11] OCTET STRING OPTIONAL }
  19. * </pre>
  20. * It comprises an optional object identifier and an optional ASN.1 BER
  21. * encoded value.
  22. *
  23. *<p>
  24. * The methods in this class can be used by the application to get low
  25. * level information about the extended operation response. However, typically,
  26. * the application will be using methods specific to the class that
  27. * implements this interface. Such a class should have decoded the BER buffer
  28. * in the response and should provide methods that allow the user to
  29. * access that data in the response in a type-safe and friendly manner.
  30. *<p>
  31. * For example, suppose the LDAP server supported a 'get time' extended operation.
  32. * It would supply GetTimeRequest and GetTimeResponse classes.
  33. * The GetTimeResponse class might look like:
  34. *<blockquote><pre>
  35. * public class GetTimeResponse implements ExtendedResponse {
  36. * public java.util.Date getDate() {...};
  37. * public long getTime() {...};
  38. * ....
  39. * }
  40. *</pre></blockquote>
  41. * A program would use then these classes as follows:
  42. *<blockquote><pre>
  43. * GetTimeResponse resp =
  44. * (GetTimeResponse) ectx.extendedOperation(new GetTimeRequest());
  45. * java.util.Date now = resp.getDate();
  46. *</pre></blockquote>
  47. *
  48. * @author Rosanna Lee
  49. * @author Scott Seligman
  50. * @author Vincent Ryan
  51. * @version 1.4 00/02/02
  52. *
  53. * @see ExtendedRequest
  54. * @since 1.3
  55. */
  56. public interface ExtendedResponse extends java.io.Serializable {
  57. /**
  58. * Retrieves the object identifier of the response.
  59. * The LDAP protocol specifies that the response object identifier is optional.
  60. * If the server does not send it, the response will contain no ID (i.e. null).
  61. *
  62. * @return A possibly null object identifier string representing the LDAP
  63. * <tt>ExtendedResponse.responseName</tt> component.
  64. */
  65. public String getID();
  66. /**
  67. * Retrieves the ASN.1 BER encoded value of the LDAP extended operation
  68. * response. Null is returned if the value is absent from the response
  69. * sent by the LDAP server.
  70. * The result is the raw BER bytes including the tag and length of
  71. * the response value. It does not include the response OID.
  72. *
  73. * @return A possibly null byte array representing the ASN.1 BER encoded
  74. * contents of the LDAP <tt>ExtendedResponse.response</tt>
  75. * component.
  76. */
  77. public byte[] getEncodedValue();
  78. //static final long serialVersionUID = -3320509678029180273L;
  79. }