8234541: C1 emits an empty message when it inlines successfully
Summary: Use "inline" as the message when successfull
Reviewed-by: thartmann, mdoerr
Contributed-by: navy.xliu@gmail.com
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!--Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.This code is free software; you can redistribute it and/or modify itunder the terms of the GNU General Public License version 2 only, aspublished by the Free Software Foundation. Oracle designates thisparticular file as subject to the "Classpath" exception as providedby Oracle in the LICENSE file that accompanied this code.This code is distributed in the hope that it will be useful, but WITHOUTANY WARRANTY; without even the implied warranty of MERCHANTABILITY orFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licenseversion 2 for more details (a copy is included in the LICENSE file thataccompanied this code).You should have received a copy of the GNU General Public License version2 along with this work; if not, write to the Free Software Foundation,Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USAor visit www.oracle.com if you need additional information or have anyquestions.--></head><body bgcolor="white">Provides support for LDAPv3 extended operations and controls.<p>This package extends the directory operations of the Java Naming andDirectory Interface™ (JNDI). JNDI provides naming and directory functionality to applicationswritten in the Java programming language. It is designed to beindependent of any specific naming or directory serviceimplementation. Thus a variety of services--new, emerging, andalready deployed ones--can be accessed in a common way.<p>This package is for applications and service providers that deal withLDAPv3 extended operations and controls, as defined by<a href=http://www.ietf.org/rfc/rfc2251.txt>RFC 2251</a>.The core interface in this package is <code>LdapContext</code>, which definesmethods on a context for performing extended operations and handlingcontrols.<h2>Extended Operations</h2><p>This package defines the interface <code>ExtendedRequest</code>to represent the argument to an extended operation,and the interface <code>ExtendedResponse</code> to represent the resultof the extended operation.An extended response is always paired with an extended requestbut not necessarily vice versa. That is, you can have an extended requestthat has no corresponding extended response.<p>An application typically does not deal directly with these interfaces.Instead, it deals with classes that <em>implement</em> theseinterfaces. The application gets these classes either as part of arepertoire of extended operations standardized through the IETF, orfrom directory vendors for vendor-specific extended operations.The request classes should have constructors that acceptarguments in a type-safe and user-friendly manner, while theresponse classes should have access methods for getting the dataof the response in a type-safe and user-friendly manner.Internally, the request/response classes deal with encoding and decodingBER values.<p>For example, suppose an LDAP server supports a "get time" extended operation.It would supply classes such as<code>GetTimeRequest</code> and <code>GetTimeResponse</code>,so that applications can use this feature.An application would use these classes as follows:<blockquote><pre>GetTimeResponse resp = (GetTimeResponse) ectx.extendedOperation(new GetTimeRequest());long time = resp.getTime();</pre></blockquote><p>The <code>GetTimeRequest</code> and <code>GetTimeResponse</code> classes mightbe defined as follows:<blockquote><pre>public class GetTimeRequest implements ExtendedRequest { // User-friendly constructor public GetTimeRequest() { }; // Methods used by service providers public String getID() { return GETTIME_REQ_OID; } public byte[] getEncodedValue() { return null; // no value needed for get time request } public ExtendedResponse createExtendedResponse( String id, byte[] berValue, int offset, int length) throws NamingException { return new GetTimeResponse(id, berValue, offset, length); }}public class GetTimeResponse() implements ExtendedResponse { long time; // called by GetTimeRequest.createExtendedResponse() public GetTimeResponse(String id, byte[] berValue, int offset, int length) throws NamingException { // check validity of id long time = ... // decode berValue to get time } // Type-safe and User-friendly methods public java.util.Date getDate() { return new java.util.Date(time); } public long getTime() { return time; } // Low level methods public byte[] getEncodedValue() { return // berValue saved; } public String getID() { return GETTIME_RESP_OID; }}</pre></blockquote><h2>Controls</h2>This package defines the interface <code>Control</code> to represent an LDAPv3control. It can be a control that is sent to an LDAP server(<em>request control</em>) or a control returned by an LDAP server(<em>response control</em>). Unlike extended requests and responses,there is not necessarily any pairing between request controls andresponse controls. You can send request controls and expect noresponse controls back, or receive response controls without sendingany request controls.<p>An application typically does not deal directly with this interface.Instead, it deals with classes that <em>implement</em> this interface.The application gets control classes either as part of a repertoire ofcontrols standardized through the IETF, or from directory vendors forvendor-specific controls. The request control classes should haveconstructors that accept arguments in a type-safe and user-friendlymanner, while the response control classes should have access methodsfor getting the data of the response in a type-safe and user-friendlymanner. Internally, the request/response control classes deal withencoding and decoding BER values.<p>For example, suppose an LDAP server supports a "signed results"request control, which when sent with a request, asks theserver to digitally sign the results of an operation.It would supply a class <code>SignedResultsControl</code> so that applicationscan use this feature.An application would use this class as follows:<blockquote><pre>Control[] reqCtls = new Control[] {new SignedResultsControl(Control.CRITICAL)};ectx.setRequestControls(reqCtls);NamingEnumeration enum = ectx.search(...);</pre></blockquote>The <code>SignedResultsControl</code> class might be defined as follows:<blockquote><pre>public class SignedResultsControl implements Control { // User-friendly constructor public SignedResultsControl(boolean criticality) { // assemble the components of the request control }; // Methods used by service providers public String getID() { return // control's object identifier } public byte[] getEncodedValue() { return // ASN.1 BER encoded control value } ...}</pre></blockquote><p>When a service provider receives response controls, it usesthe <code>ControlFactory</code> class to produce specific classesthat implement the <code>Control</code> interface.<p>An LDAP server can send back response controls with an LDAP operationand also with enumeration results, such as those returnedby a list or search operation.The <code>LdapContext</code> provides a method (<code>getResponseControls()</code>)for getting the response controls sent with an LDAP operation,while the <code>HasControls</code> interface is used to retrieveresponse controls associated with enumeration results.<p>For example, suppose an LDAP server sends back a "change ID" control in responseto a successful modification. It would supply a class <code>ChangeIDControl</code>so that the application can use this feature.An application would perform an update, and then try to get the change ID.<blockquote><pre>// Perform updateContext ctx = ectx.createSubsubcontext("cn=newobj");// Get response controlsControl[] respCtls = ectx.getResponseControls();if (respCtls != null) { // Find the one we want for (int i = 0; i < respCtls; i++) { if(respCtls[i] instanceof ChangeIDControl) { ChangeIDControl cctl = (ChangeIDControl)respCtls[i]; System.out.println(cctl.getChangeID()); } }}</pre></blockquote>The vendor might supply the following <code>ChangeIDControl</code> and<code>VendorXControlFactory</code> classes. The <code>VendorXControlFactory</code>will be used by the service provider when the provider receives responsecontrols from the LDAP server.<blockquote><pre>public class ChangeIDControl implements Control { long id; // Constructor used by ControlFactory public ChangeIDControl(String OID, byte[] berVal) throws NamingException { // check validity of OID id = // extract change ID from berVal }; // Type-safe and User-friendly method public long getChangeID() { return id; } // Low-level methods public String getID() { return CHANGEID_OID; } public byte[] getEncodedValue() { return // original berVal } ...}public class VendorXControlFactory extends ControlFactory { public VendorXControlFactory () { } public Control getControlInstance(Control orig) throws NamingException { if (isOneOfMyControls(orig.getID())) { ... // determine which of ours it is and call its constructor return (new ChangeIDControl(orig.getID(), orig.getEncodedValue())); } return null; // not one of ours }}</pre></blockquote><h2>Package Specification</h2>The JNDI API Specification and related documents can be found in the{@extLink jndi_overview JNDI documentation}.@since 1.3</body></html>