Class Responses
java.lang.Object
org.forgerock.opendj.ldap.messages.Responses
This class contains various methods for creating and manipulating responses.
All copy constructors of the form copyOfXXXResult perform deep copies
of their response parameter. More specifically, any controls, modifications,
and attributes contained within the response will be duplicated.
Similarly, all unmodifiable views of responses returned by methods of the
form unmodifiableXXXResult return deep unmodifiable views of their
response parameter. More specifically, any controls, modifications, and
attributes contained within the returned response will be unmodifiable.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResultcopyOfResult(Result result) Creates a new result that is an exact copy of the provided result.static SearchResultEntrycopyOfSearchResultEntry(SearchResultEntry searchResultEntry) Creates a new search result entry that is an exact copy of the provided result.static BindResultnewBindResult(Result result) Creates a new bind result using the provided result.static BindResultnewBindResult(ResultCode resultCode) Creates a new bind result using the provided result code.static BindResultnewBindResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, Throwable cause) Creates a new bind result using the provided result code.static BindResultnewBindResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<String> referralUris, ByteString credentials, List<Control> controls, Throwable cause, SaslServer saslServer) Creates a new bind result using the provided result code.static BindResultnewBindResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, ByteString credentials, Throwable cause, SaslServer saslServer) Creates a new bind result using the provided result code.static BindResultnewBindResult(ResultCode resultCode, ByteString credentials, SaslServer saslServer) Creates a new bind result using the provided result code.static CompareResultnewCompareResult(Result result) Creates a new compare result using the provided result.static CompareResultnewCompareResult(ResultCode resultCode) Creates a new compare result using the provided result code.static CompareResultnewCompareResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<String> referralUris, Throwable cause) Creates a new compare result using the provided result code.static GenericExtendedResultCreates a new generic extended result using the provided extended result data.static GenericExtendedResultnewGenericExtendedResult(ResultCode resultCode) Creates a new generic extended result using the provided result code.static GenericExtendedResultnewGenericExtendedResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, String responseName, ByteString responseValue) Creates a new generic extended result using the provided result code.static GenericExtendedResultnewGenericExtendedResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<String> referralUris, String responseName, ByteString responseValue, List<Control> controls) Creates a new generic extended result using the provided result code.static GenericExtendedResultnewGenericExtendedResult(ResultCode resultCode, String responseName, ByteString responseValue) Creates a new generic extended result using the provided result code.static IntermediateResponsenewIntermediateResponse(String oid, Object value) Creates a new intermediate response using the provided response name and value.static PasswordModifyExtendedResultnewPasswordModifyExtendedResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, ByteString password) Creates a new password modify extended result using the provided result code, and no generated password.static PasswordModifyExtendedResultnewPasswordModifyExtendedResult(ResultCode resultCode, ByteString password) Creates a new password modify extended result using the provided result code, and no generated password.static ResultnewResult(ResultCode resultCode) Creates a new result using the provided result code.static ResultnewResult(ResultCode resultCode, CharSequence diagnosticMessage) Creates a new result using the provided result code, the cause, the diagnostic message and the matched DN.static ResultnewResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<String> referralUris, Throwable cause) Creates a new result using the provided result code, the cause, the diagnostic message and the matched DN.static ResultnewResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<String> referralUris, List<Control> controls, Throwable cause) Creates a new result using the provided result code, the cause, the diagnostic message and the matched DN.static ResultnewResult(ResultCode resultCode, Dn matchedDn, CharSequence diagnosticMessage) Creates a new result using the provided result code, the cause, the diagnostic message and the matched DN.static ResultnewResult(ResultCode resultCode, Dn matchedDn, CharSequence diagnosticMessage, Throwable cause) Creates a new result using the provided result code, the cause, the diagnostic message and the matched DN.static SearchResultEntrynewSearchResultEntry(String name) Creates a new search result entry using the provided distinguished name decoded using the default schema.static SearchResultEntrynewSearchResultEntry(String... ldifLines) Creates a new search result entry using the provided lines of LDIF decoded using the default schema.static SearchResultEntrynewSearchResultEntry(Dn name) Creates a new search result entry using the provided distinguished name.static SearchResultEntrynewSearchResultEntry(Entry entry) Creates a new search result entry backed by the provided entry.static SearchResultReferenceCreates a new search result reference using the provided continuation reference URI.static SearchResultReferencenewSearchResultReference(List<String> uris) Creates a new search result reference using the provided continuation reference URIs.static StartTlsExtendedResultnewStartTlsExtendedResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<Control> controls, Throwable cause, SslOptions sslOptions) Creates a new start TLS extended result which will use the provided SSL context.static StartTlsExtendedResultnewStartTlsExtendedResult(ResultCode resultCode, SslOptions sslOptions) Creates a new start TLS extended result which will use the provided SSL context.static WhoAmIExtendedResultnewWhoAmIExtendedResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, String authorizationId) Creates a new who am I extended result with the provided result code, diagnosticMessage and matchedDn.
-
Method Details
-
copyOfResult
Creates a new result that is an exact copy of the provided result.- Parameters:
result- The result to be copied.- Returns:
- The new result.
-
copyOfSearchResultEntry
Creates a new search result entry that is an exact copy of the provided result.- Parameters:
searchResultEntry- The search result entry to be copied.- Returns:
- The new search result entry.
-
newBindResult
Creates a new bind result using the provided result code.- Parameters:
resultCode- The result code.- Returns:
- The new bind result.
-
newBindResult
Creates a new bind result using the provided result.- Parameters:
result- The result.- Returns:
- The new bind result.
-
newBindResult
public static BindResult newBindResult(ResultCode resultCode, ByteString credentials, SaslServer saslServer) Creates a new bind result using the provided result code.- Parameters:
resultCode- The result code.credentials- The server SASL credentials associated with this bind result, which may benullindicating that none was provided.saslServer- TheSaslServerto use by the underlying connection, ornullif SASL integrity and/or privacy protection must not be enabled.- Returns:
- The new bind result.
-
newBindResult
public static BindResult newBindResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, Throwable cause) Creates a new bind result using the provided result code.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornull.cause- The throwable cause, which may benullindicating that none was provided.- Returns:
- The new bind result.
-
newBindResult
public static BindResult newBindResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, ByteString credentials, Throwable cause, SaslServer saslServer) Creates a new bind result using the provided result code.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornull.credentials- The server SASL credentials associated with this bind result, which may benullindicating that none was provided.cause- The throwable cause, which may benullindicating that none was provided.saslServer- TheSaslServerto use by the underlying connection, ornullif SASL integrity and/or privacy protection must not be enabled.- Returns:
- The new bind result.
-
newBindResult
public static BindResult newBindResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<String> referralUris, ByteString credentials, List<Control> controls, Throwable cause, SaslServer saslServer) Creates a new bind result using the provided result code.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornull.referralUris- The optional referrals are present in a BindResult if the result code is set toResultCode.REFERRAL, and they are absent with all other result codes.credentials- The server SASL credentials associated with this bind result, which may benullindicating that none was provided.controls- theListcontaining the controls.cause- The throwable cause, which may benullindicating that none was provided.saslServer- TheSaslServerto use by the underlying connection, ornullif SASL integrity and/or privacy protection must not be enabled.- Returns:
- The new bind result.
-
newCompareResult
Creates a new compare result using the provided result code.- Parameters:
resultCode- The result code.- Returns:
- The new compare result.
-
newCompareResult
Creates a new compare result using the provided result.- Parameters:
result- The result.- Returns:
- The new compare result.
-
newCompareResult
public static CompareResult newCompareResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<String> referralUris, Throwable cause) Creates a new compare result using the provided result code.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornull.referralUris- The optional referrals are present in a CompareResult if the result code is set toResultCode.REFERRAL, and they are absent with all other result codes.cause- The throwable cause, which may benullindicating that none was provided.- Returns:
- The new compare result.
-
newGenericExtendedResult
Creates a new generic extended result using the provided result code.- Parameters:
resultCode- The result code.- Returns:
- The new generic extended result.
-
newGenericExtendedResult
Creates a new generic extended result using the provided extended result data.- Parameters:
result- The extended result to be used for copy.- Returns:
- The new generic extended result.
-
newGenericExtendedResult
public static GenericExtendedResult newGenericExtendedResult(ResultCode resultCode, String responseName, ByteString responseValue) Creates a new generic extended result using the provided result code.- Parameters:
resultCode- The result code.responseName- The numeric OID associated with this extended result, ornullif there is no value.responseValue- The value associated with this extended result, ornullif there is no value.- Returns:
- The new generic extended result.
-
newGenericExtendedResult
public static GenericExtendedResult newGenericExtendedResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, String responseName, ByteString responseValue) Creates a new generic extended result using the provided result code.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornull.responseName- The numeric OID associated with this extended result, ornullif there is no value.responseValue- The value associated with this extended result, ornullif there is no value.- Returns:
- The new generic extended result.
-
newGenericExtendedResult
public static GenericExtendedResult newGenericExtendedResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<String> referralUris, String responseName, ByteString responseValue, List<Control> controls) Creates a new generic extended result using the provided result code.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornull.referralUris- The optional referrals are present in a GenericExtendedResult if the result code is set toResultCode.REFERRAL, and they are absent with all other result codes.responseName- The numeric OID associated with this extended result, ornullif there is no value.responseValue- The value associated with this extended result, ornullif there is no value.controls- theListcontaining the controls.- Returns:
- The new generic extended result.
-
newIntermediateResponse
Creates a new intermediate response using the provided response name and value.If the response value is not an instance of
ByteStringthen it will be converted using theByteString.valueOfObject(Object)method.- Parameters:
oid- The dotted-decimal representation of the unique OID corresponding to this intermediate response, which may benullindicating that none was provided.value- The response value associated with this intermediate response, which may benullindicating that none was provided.- Returns:
- The new intermediate response.
-
newPasswordModifyExtendedResult
public static PasswordModifyExtendedResult newPasswordModifyExtendedResult(ResultCode resultCode, ByteString password) Creates a new password modify extended result using the provided result code, and no generated password.- Parameters:
resultCode- The result code.password- The generated password, ornullif there is no generated password associated with this result.- Returns:
- The new password modify extended result.
-
newPasswordModifyExtendedResult
public static PasswordModifyExtendedResult newPasswordModifyExtendedResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, ByteString password) Creates a new password modify extended result using the provided result code, and no generated password.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornull.password- The generated password, ornullif there is no generated password associated with this result.- Returns:
- The new password modify extended result.
-
newResult
Creates a new result using the provided result code.- Parameters:
resultCode- The result code.- Returns:
- The new result.
-
newResult
Creates a new result using the provided result code, the cause, the diagnostic message and the matched DN.- Parameters:
resultCode- The result code.diagnosticMessage- The diagnostic message, which may be empty ornullindicating that none was provided.- Returns:
- The new result.
-
newResult
Creates a new result using the provided result code, the cause, the diagnostic message and the matched DN.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornullindicating that none was provided.- Returns:
- The new result.
-
newResult
public static Result newResult(ResultCode resultCode, Dn matchedDn, CharSequence diagnosticMessage, Throwable cause) Creates a new result using the provided result code, the cause, the diagnostic message and the matched DN.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornullindicating that none was provided.cause- The throwable cause, which may benullindicating that none was provided.- Returns:
- The new result.
-
newResult
public static Result newResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<String> referralUris, Throwable cause) Creates a new result using the provided result code, the cause, the diagnostic message and the matched DN.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornullindicating that none was provided.referralUris- The optional referrals are present in a ResultImpl if the result code is set toResultCode.REFERRAL, and they are absent with all other result codes.cause- The throwable cause, which may benullindicating that none was provided.- Returns:
- The new result.
-
newResult
public static Result newResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<String> referralUris, List<Control> controls, Throwable cause) Creates a new result using the provided result code, the cause, the diagnostic message and the matched DN.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornullindicating that none was provided.referralUris- The optional referrals are present in a ResultImpl if the result code is set toResultCode.REFERRAL, and they are absent with all other result codes.controls- theListcontaining the controls.cause- The throwable cause, which may benullindicating that none was provided.- Returns:
- The new result.
-
newSearchResultEntry
Creates a new search result entry using the provided distinguished name.- Parameters:
name- The distinguished name of the entry.- Returns:
- The new search result entry.
-
newSearchResultEntry
Creates a new search result entry backed by the provided entry. Modifications made toentrywill be reflected in the returned search result entry. The returned search result entry supports updates to its list of controls, as well as updates to the name and attributes if the underlying entry allows.- Parameters:
entry- The entry.- Returns:
- The new search result entry.
-
newSearchResultEntry
Creates a new search result entry using the provided distinguished name decoded using the default schema.- Parameters:
name- The distinguished name of the entry.- Returns:
- The new search result entry.
-
newSearchResultEntry
Creates a new search result entry using the provided lines of LDIF decoded using the default schema.- Parameters:
ldifLines- Lines of LDIF containing an LDIF add change record or an LDIF entry record.- Returns:
- The new search result entry.
-
newSearchResultReference
Creates a new search result reference using the provided continuation reference URI.- Parameters:
uri- The first continuation reference URI to be added to this search result reference.- Returns:
- The new search result reference.
- Throws:
NullPointerException- Ifuriwasnull.
-
newSearchResultReference
Creates a new search result reference using the provided continuation reference URIs.- Parameters:
uris- The reference URIs to be added to this search result reference.- Returns:
- The new search result reference.
-
newStartTlsExtendedResult
public static StartTlsExtendedResult newStartTlsExtendedResult(ResultCode resultCode, SslOptions sslOptions) Creates a new start TLS extended result which will use the provided SSL context.- Parameters:
resultCode- The result code.sslOptions- TheSslOptionswhich should be used to secure the connection on TLS layer.- Returns:
- The new start TLS extended request.
-
newStartTlsExtendedResult
public static StartTlsExtendedResult newStartTlsExtendedResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, List<Control> controls, Throwable cause, SslOptions sslOptions) Creates a new start TLS extended result which will use the provided SSL context.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornullindicating that none was provided.controls- TheListcontaining the controls.cause- The throwable cause, which may benullindicating that none was provided.sslOptions- TheSslOptionswhich should be used to secure the connection on TLS layer.- Returns:
- The new start TLS extended request.
-
newWhoAmIExtendedResult
public static WhoAmIExtendedResult newWhoAmIExtendedResult(ResultCode resultCode, String matchedDn, CharSequence diagnosticMessage, String authorizationId) Creates a new who am I extended result with the provided result code, diagnosticMessage and matchedDn.- Parameters:
resultCode- The result code.matchedDn- The matched DN associated, which may be empty ornullindicating that none was provided.diagnosticMessage- The diagnostic message, which may be empty ornull.authorizationId- The authorization ID of the user, that usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted. The authorization ID may benullor empty if this result does not contain an authorization ID.- Returns:
- The new who am I extended result.
-