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