001 /*
002 * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025
026 package javax.naming.ldap;
027
028 /**
029 * This interface represents an LDAP extended operation response as defined in
030 * <A HREF="ftp://ftp.isi.edu/in-notes/rfc2251.txt">RFC 2251</A>.
031 * <pre>
032 * ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
033 * COMPONENTS OF LDAPResult,
034 * responseName [10] LDAPOID OPTIONAL,
035 * response [11] OCTET STRING OPTIONAL }
036 * </pre>
037 * It comprises an optional object identifier and an optional ASN.1 BER
038 * encoded value.
039 *
040 *<p>
041 * The methods in this class can be used by the application to get low
042 * level information about the extended operation response. However, typically,
043 * the application will be using methods specific to the class that
044 * implements this interface. Such a class should have decoded the BER buffer
045 * in the response and should provide methods that allow the user to
046 * access that data in the response in a type-safe and friendly manner.
047 *<p>
048 * For example, suppose the LDAP server supported a 'get time' extended operation.
049 * It would supply GetTimeRequest and GetTimeResponse classes.
050 * The GetTimeResponse class might look like:
051 *<blockquote><pre>
052 * public class GetTimeResponse implements ExtendedResponse {
053 * public java.util.Date getDate() {...};
054 * public long getTime() {...};
055 * ....
056 * }
057 *</pre></blockquote>
058 * A program would use then these classes as follows:
059 *<blockquote><pre>
060 * GetTimeResponse resp =
061 * (GetTimeResponse) ectx.extendedOperation(new GetTimeRequest());
062 * java.util.Date now = resp.getDate();
063 *</pre></blockquote>
064 *
065 * @author Rosanna Lee
066 * @author Scott Seligman
067 * @author Vincent Ryan
068 * @version 1.14 07/05/05
069 *
070 * @see ExtendedRequest
071 * @since 1.3
072 */
073
074 public interface ExtendedResponse extends java.io.Serializable {
075
076 /**
077 * Retrieves the object identifier of the response.
078 * The LDAP protocol specifies that the response object identifier is optional.
079 * If the server does not send it, the response will contain no ID (i.e. null).
080 *
081 * @return A possibly null object identifier string representing the LDAP
082 * <tt>ExtendedResponse.responseName</tt> component.
083 */
084 public String getID();
085
086 /**
087 * Retrieves the ASN.1 BER encoded value of the LDAP extended operation
088 * response. Null is returned if the value is absent from the response
089 * sent by the LDAP server.
090 * The result is the raw BER bytes including the tag and length of
091 * the response value. It does not include the response OID.
092 *
093 * @return A possibly null byte array representing the ASN.1 BER encoded
094 * contents of the LDAP <tt>ExtendedResponse.response</tt>
095 * component.
096 */
097 public byte[] getEncodedValue();
098
099 //static final long serialVersionUID = -3320509678029180273L;
100 }
|