Class Responses
- java.lang.Object
-
- org.forgerock.opendj.ldap.messages.Responses
-
public final class Responses extends Object
This class contains various methods for creating and manipulating responses.All copy constructors of the form
copyOfXXXResultperform 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
unmodifiableXXXResultreturn deep unmodifiable views of their response parameter. More specifically, any controls, modifications, and attributes contained within the returned response will be unmodifiable.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BindResultcopyOfBindResult(BindResult result)Creates a new bind result that is an exact copy of the provided result.static CompareResultcopyOfCompareResult(CompareResult result)Creates a new compare result that is an exact copy of the provided result.static GenericExtendedResultcopyOfGenericExtendedResult(GenericExtendedResult result)Creates a new generic extended result that is an exact copy of the provided result.static GenericIntermediateResponsecopyOfGenericIntermediateResponse(GenericIntermediateResponse result)Creates a new generic intermediate response that is an exact copy of the provided response.static PasswordModifyExtendedResultcopyOfPasswordModifyExtendedResult(PasswordModifyExtendedResult result)Creates a new password modify extended result that is an exact copy of the provided result.static ResultcopyOfResult(Result result)Creates a new result that is an exact copy of the provided result.static SearchResultEntrycopyOfSearchResultEntry(SearchResultEntry entry)Creates a new search result entry that is an exact copy of the provided result.static SearchResultReferencecopyOfSearchResultReference(SearchResultReference reference)Creates a new search result reference that is an exact copy of the provided result.static WhoAmIExtendedResultcopyOfWhoAmIExtendedResult(WhoAmIExtendedResult result)Creates a new who am I extended result that is an exact copy of the provided result.static BindResultnewBindResult(ResultCode resultCode)Creates a new bind result using the provided result code.static CompareResultnewCompareResult(ResultCode resultCode)Creates a new compare result using the provided result code.static GenericExtendedResultnewGenericExtendedResult(ResultCode resultCode)Creates a new generic extended result using the provided result code.static GenericIntermediateResponsenewGenericIntermediateResponse()Creates a new generic intermediate response with no name or value.static GenericIntermediateResponsenewGenericIntermediateResponse(String responseName, Object responseValue)Creates a new generic intermediate response using the provided response name and value.static PasswordModifyExtendedResultnewPasswordModifyExtendedResult(ResultCode resultCode)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 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 SearchResultReferencenewSearchResultReference(String uri)Creates 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)Creates a new start TLS extended result which will use the provided SSL context.static WhoAmIExtendedResultnewWhoAmIExtendedResult(ResultCode resultCode)Creates a new who am I extended result with the provided result code and no authorization ID.static BindResultunmodifiableBindResult(BindResult result)Creates an unmodifiable bind result using the provided response.static CompareResultunmodifiableCompareResult(CompareResult result)Creates an unmodifiable compare result using the provided response.static GenericExtendedResultunmodifiableGenericExtendedResult(GenericExtendedResult result)Creates an unmodifiable generic extended result using the provided response.static GenericIntermediateResponseunmodifiableGenericIntermediateResponse(GenericIntermediateResponse response)Creates an unmodifiable generic intermediate response using the provided response.static PasswordModifyExtendedResultunmodifiablePasswordModifyExtendedResult(PasswordModifyExtendedResult result)Creates an unmodifiable password modify extended result using the provided response.static ResultunmodifiableResult(Result result)Creates an unmodifiable result using the provided response.static SearchResultEntryunmodifiableSearchResultEntry(SearchResultEntry entry)Creates an unmodifiable search result entry using the provided response.static SearchResultReferenceunmodifiableSearchResultReference(SearchResultReference reference)Creates an unmodifiable search result reference using the provided response.static WhoAmIExtendedResultunmodifiableWhoAmIExtendedResult(WhoAmIExtendedResult result)Creates an unmodifiable who am I extended result using the provided response.
-
-
-
Method Detail
-
copyOfBindResult
public static BindResult copyOfBindResult(BindResult result)
Creates a new bind result that is an exact copy of the provided result.- Parameters:
result- The bind result to be copied.- Returns:
- The new bind result.
- Throws:
NullPointerException- Ifresultwasnull.
-
copyOfCompareResult
public static CompareResult copyOfCompareResult(CompareResult result)
Creates a new compare result that is an exact copy of the provided result.- Parameters:
result- The compare result to be copied.- Returns:
- The new compare result.
- Throws:
NullPointerException- Ifresultwasnull.
-
copyOfGenericExtendedResult
public static GenericExtendedResult copyOfGenericExtendedResult(GenericExtendedResult result)
Creates a new generic extended result that is an exact copy of the provided result.- Parameters:
result- The generic extended result to be copied.- Returns:
- The new generic extended result.
- Throws:
NullPointerException- Ifresultwasnull.
-
copyOfGenericIntermediateResponse
public static GenericIntermediateResponse copyOfGenericIntermediateResponse(GenericIntermediateResponse result)
Creates a new generic intermediate response that is an exact copy of the provided response.- Parameters:
result- The generic intermediate response to be copied.- Returns:
- The new generic intermediate response.
- Throws:
NullPointerException- Ifresultwasnull.
-
copyOfPasswordModifyExtendedResult
public static PasswordModifyExtendedResult copyOfPasswordModifyExtendedResult(PasswordModifyExtendedResult result)
Creates a new password modify extended result that is an exact copy of the provided result.- Parameters:
result- The password modify extended result to be copied.- Returns:
- The new password modify extended result.
- Throws:
NullPointerException- Ifresultwasnull.
-
copyOfResult
public static Result copyOfResult(Result result)
Creates a new result that is an exact copy of the provided result.- Parameters:
result- The result to be copied.- Returns:
- The new result.
- Throws:
NullPointerException- Ifresultwasnull.
-
copyOfSearchResultEntry
public static SearchResultEntry copyOfSearchResultEntry(SearchResultEntry entry)
Creates a new search result entry that is an exact copy of the provided result.- Parameters:
entry- The search result entry to be copied.- Returns:
- The new search result entry.
- Throws:
NullPointerException- Ifentrywasnull.
-
copyOfSearchResultReference
public static SearchResultReference copyOfSearchResultReference(SearchResultReference reference)
Creates a new search result reference that is an exact copy of the provided result.- Parameters:
reference- The search result reference to be copied.- Returns:
- The new search result reference.
- Throws:
NullPointerException- Ifreferencewasnull.
-
copyOfWhoAmIExtendedResult
public static WhoAmIExtendedResult copyOfWhoAmIExtendedResult(WhoAmIExtendedResult result)
Creates a new who am I extended result that is an exact copy of the provided result.- Parameters:
result- The who am I result to be copied.- Returns:
- The new who am I extended result.
- Throws:
NullPointerException- Ifresultwasnull.
-
newBindResult
public static BindResult newBindResult(ResultCode resultCode)
Creates a new bind result using the provided result code.- Parameters:
resultCode- The result code.- Returns:
- The new bind result.
- Throws:
NullPointerException- IfresultCodewasnull.
-
newCompareResult
public static CompareResult newCompareResult(ResultCode resultCode)
Creates a new compare result using the provided result code.- Parameters:
resultCode- The result code.- Returns:
- The new compare result.
- Throws:
NullPointerException- IfresultCodewasnull.
-
newGenericExtendedResult
public static GenericExtendedResult newGenericExtendedResult(ResultCode resultCode)
Creates a new generic extended result using the provided result code.- Parameters:
resultCode- The result code.- Returns:
- The new generic extended result.
- Throws:
NullPointerException- IfresultCodewasnull.
-
newGenericIntermediateResponse
public static GenericIntermediateResponse newGenericIntermediateResponse()
Creates a new generic intermediate response with no name or value.- Returns:
- The new generic intermediate response.
-
newGenericIntermediateResponse
public static GenericIntermediateResponse newGenericIntermediateResponse(String responseName, Object responseValue)
Creates a new generic 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:
responseName- The dotted-decimal representation of the unique OID corresponding to this intermediate response, which may benullindicating that none was provided.responseValue- The response value associated with this generic intermediate response, which may benullindicating that none was provided.- Returns:
- The new generic intermediate response.
-
newPasswordModifyExtendedResult
public static PasswordModifyExtendedResult newPasswordModifyExtendedResult(ResultCode resultCode)
Creates a new password modify extended result using the provided result code, and no generated password.- Parameters:
resultCode- The result code.- Returns:
- The new password modify extended result.
- Throws:
NullPointerException- IfresultCodewasnull.
-
newResult
public static Result newResult(ResultCode resultCode)
Creates a new result using the provided result code.- Parameters:
resultCode- The result code.- Returns:
- The new result.
- Throws:
NullPointerException- IfresultCodewasnull.
-
newSearchResultEntry
public static SearchResultEntry newSearchResultEntry(Dn name)
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.
- Throws:
NullPointerException- Ifnamewasnull.
-
newSearchResultEntry
public static SearchResultEntry newSearchResultEntry(Entry entry)
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.
- Throws:
NullPointerException- Ifentrywasnull.
-
newSearchResultEntry
public static SearchResultEntry newSearchResultEntry(String name)
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.
- Throws:
LocalizedIllegalArgumentException- Ifnamecould not be decoded using the default schema.NullPointerException- Ifnamewasnull.
-
newSearchResultEntry
public static SearchResultEntry newSearchResultEntry(String... ldifLines)
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.
- Throws:
LocalizedIllegalArgumentException- IfldifLineswas empty, or contained invalid LDIF, or could not be decoded using the default schema.NullPointerException- IfldifLineswasnull.
-
newSearchResultReference
public static SearchResultReference newSearchResultReference(String uri)
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
public static SearchResultReference newSearchResultReference(List<String> uris)
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.
- Throws:
NullPointerException- Ifuriswerenull.
-
newStartTlsExtendedResult
public static StartTlsExtendedResult newStartTlsExtendedResult(ResultCode resultCode)
Creates a new start TLS extended result which will use the provided SSL context.- Parameters:
resultCode- The result code.- Returns:
- The new start TLS extended request.
- Throws:
NullPointerException- IfresultCodewasnull.
-
newWhoAmIExtendedResult
public static WhoAmIExtendedResult newWhoAmIExtendedResult(ResultCode resultCode)
Creates a new who am I extended result with the provided result code and no authorization ID.- Parameters:
resultCode- The result code.- Returns:
- The new who am I extended result.
- Throws:
NullPointerException- IfresultCodewasnull.
-
unmodifiableBindResult
public static BindResult unmodifiableBindResult(BindResult result)
Creates an unmodifiable bind result using the provided response.- Parameters:
result- The bind result to be copied.- Returns:
- The unmodifiable bind result.
- Throws:
NullPointerException- Ifresultwasnull.
-
unmodifiableCompareResult
public static CompareResult unmodifiableCompareResult(CompareResult result)
Creates an unmodifiable compare result using the provided response.- Parameters:
result- The compare result to be copied.- Returns:
- The unmodifiable compare result.
- Throws:
NullPointerException- Ifresultwasnull.
-
unmodifiableGenericExtendedResult
public static GenericExtendedResult unmodifiableGenericExtendedResult(GenericExtendedResult result)
Creates an unmodifiable generic extended result using the provided response.- Parameters:
result- The generic extended result to be copied.- Returns:
- The unmodifiable generic extended result.
- Throws:
NullPointerException- Ifresultwasnull.
-
unmodifiableGenericIntermediateResponse
public static GenericIntermediateResponse unmodifiableGenericIntermediateResponse(GenericIntermediateResponse response)
Creates an unmodifiable generic intermediate response using the provided response.- Parameters:
response- The generic intermediate response to be copied.- Returns:
- The unmodifiable generic intermediate response.
- Throws:
NullPointerException- Ifresponsewasnull.
-
unmodifiablePasswordModifyExtendedResult
public static PasswordModifyExtendedResult unmodifiablePasswordModifyExtendedResult(PasswordModifyExtendedResult result)
Creates an unmodifiable password modify extended result using the provided response.- Parameters:
result- The password modify extended result to be copied.- Returns:
- The unmodifiable password modify extended result.
- Throws:
NullPointerException- Ifresultwasnull.
-
unmodifiableResult
public static Result unmodifiableResult(Result result)
Creates an unmodifiable result using the provided response.- Parameters:
result- The result to be copied.- Returns:
- The unmodifiable result.
- Throws:
NullPointerException- Ifresultwasnull.
-
unmodifiableSearchResultEntry
public static SearchResultEntry unmodifiableSearchResultEntry(SearchResultEntry entry)
Creates an unmodifiable search result entry using the provided response.- Parameters:
entry- The search result entry to be copied.- Returns:
- The unmodifiable search result entry.
- Throws:
NullPointerException- Ifentrywasnull.
-
unmodifiableSearchResultReference
public static SearchResultReference unmodifiableSearchResultReference(SearchResultReference reference)
Creates an unmodifiable search result reference using the provided response.- Parameters:
reference- The search result reference to be copied.- Returns:
- The unmodifiable search result reference.
- Throws:
NullPointerException- IfsearchResultReferencewasnull.
-
unmodifiableWhoAmIExtendedResult
public static WhoAmIExtendedResult unmodifiableWhoAmIExtendedResult(WhoAmIExtendedResult result)
Creates an unmodifiable who am I extended result using the provided response.- Parameters:
result- The who am I result to be copied.- Returns:
- The unmodifiable who am I extended result.
- Throws:
NullPointerException- Ifresultwasnull.
-
-