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