Path: blob/master/src/java.naming/share/classes/javax/naming/ldap/ExtendedResponse.java
41159 views
/*1* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.naming.ldap;2627/**28* This interface represents an LDAP extended operation response as defined in29* <A HREF="http://www.ietf.org/rfc/rfc2251.txt">RFC 2251</A>.30* <pre>31* ExtendedResponse ::= [APPLICATION 24] SEQUENCE {32* COMPONENTS OF LDAPResult,33* responseName [10] LDAPOID OPTIONAL,34* response [11] OCTET STRING OPTIONAL }35* </pre>36* It comprises an optional object identifier and an optional ASN.1 BER37* encoded value.38*39*<p>40* The methods in this class can be used by the application to get low41* level information about the extended operation response. However, typically,42* the application will be using methods specific to the class that43* implements this interface. Such a class should have decoded the BER buffer44* in the response and should provide methods that allow the user to45* access that data in the response in a type-safe and friendly manner.46*<p>47* For example, suppose the LDAP server supported a 'get time' extended operation.48* It would supply GetTimeRequest and GetTimeResponse classes.49* The GetTimeResponse class might look like:50*<blockquote><pre>51* public class GetTimeResponse implements ExtendedResponse {52* public java.util.Date getDate() {...};53* public long getTime() {...};54* ....55* }56*</pre></blockquote>57* A program would use then these classes as follows:58*<blockquote><pre>59* GetTimeResponse resp =60* (GetTimeResponse) ectx.extendedOperation(new GetTimeRequest());61* java.util.Date now = resp.getDate();62*</pre></blockquote>63*64* @author Rosanna Lee65* @author Scott Seligman66* @author Vincent Ryan67*68* @see ExtendedRequest69* @since 1.370*/7172public interface ExtendedResponse extends java.io.Serializable {7374/**75* Retrieves the object identifier of the response.76* The LDAP protocol specifies that the response object identifier is optional.77* If the server does not send it, the response will contain no ID (i.e. null).78*79* @return A possibly null object identifier string representing the LDAP80* {@code ExtendedResponse.responseName} component.81*/82public String getID();8384/**85* Retrieves the ASN.1 BER encoded value of the LDAP extended operation86* response. Null is returned if the value is absent from the response87* sent by the LDAP server.88* The result is the raw BER bytes including the tag and length of89* the response value. It does not include the response OID.90*91* @return A possibly null byte array representing the ASN.1 BER encoded92* contents of the LDAP {@code ExtendedResponse.response}93* component.94*/95public byte[] getEncodedValue();9697//static final long serialVersionUID = -3320509678029180273L;98}99100101