Package org.ldaptive
Class AbstractResult
- java.lang.Object
-
- org.ldaptive.AbstractMessage
-
- org.ldaptive.AbstractResult
-
- Direct Known Subclasses:
AddResponse,AuthenticationHandlerResponse,AuthenticationResponse,BindResponse,CompareResponse,DeleteResponse,ExtendedResponse,ModifyDnResponse,ModifyResponse,SearchResponse
public abstract class AbstractResult extends AbstractMessage implements Result
LDAP result message defined as:LDAPResult ::= SEQUENCE { resultCode ENUMERATED { ... }, matchedDN LDAPDN, diagnosticMessage LDAPString, referral [3] Referral OPTIONAL } Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI URI ::= LDAPString -- limited to characters permitted in -- URIs
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractResult.AbstractBuilder<B,T extends AbstractResult>protected static classAbstractResult.DiagnosticMessageHandlerParse handler implementation for the LDAP diagnostic message.protected static classAbstractResult.MatchedDNHandlerParse handler implementation for the LDAP matched DN.protected static classAbstractResult.ReferralHandlerParse handler implementation for the LDAP referral.protected static classAbstractResult.ResultCodeHandlerParse handler implementation for the LDAP result code.-
Nested classes/interfaces inherited from class org.ldaptive.AbstractMessage
AbstractMessage.ControlParser, AbstractMessage.ControlsHandler, AbstractMessage.MessageIDHandler
-
-
Field Summary
Fields Modifier and Type Field Description private StringdiagnosticMessageDiagnostic message.private StringmatchedDNMatched DN.private List<String>referralURLsReferral URLS.private ResultCoderesultCodeResult code.-
Fields inherited from interface org.ldaptive.Result
ENCODE_CNTRL_CHARS
-
-
Constructor Summary
Constructors Constructor Description AbstractResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddReferralURLs(String... urls)Adds referral URLs to the result.protected <T extends Result>
voidcopyValues(T result)Copies the property values from the supplied result to this result.booleanequals(Object o)booleanequalsResult(Result result)Returns whether the base properties of this result are equal.StringgetDiagnosticMessage()Returns the diagnostic message.StringgetMatchedDN()Returns the matched DN.String[]getReferralURLs()Returns the referral URLs.ResultCodegetResultCode()Returns the result code.protected voidsetDiagnosticMessage(String message)Sets the diagnostic message.protected voidsetMatchedDN(String dn)Sets the matched DN.protected voidsetResultCode(ResultCode code)Sets the result code.StringtoString()-
Methods inherited from class org.ldaptive.AbstractMessage
addControls, copyValues, equalsMessage, getControls, getMessageID, hashCode, setMessageID
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ldaptive.Message
getControl, getControls, getMessageID
-
Methods inherited from interface org.ldaptive.Result
getEncodedDiagnosticMessage, isSuccess
-
-
-
-
Field Detail
-
resultCode
private ResultCode resultCode
Result code.
-
matchedDN
private String matchedDN
Matched DN.
-
diagnosticMessage
private String diagnosticMessage
Diagnostic message.
-
-
Method Detail
-
getResultCode
public final ResultCode getResultCode()
Returns the result code.- Specified by:
getResultCodein interfaceResult- Returns:
- result code
-
setResultCode
protected final void setResultCode(ResultCode code)
Sets the result code.- Parameters:
code- result code
-
getMatchedDN
public final String getMatchedDN()
Returns the matched DN.- Specified by:
getMatchedDNin interfaceResult- Returns:
- matched DN
-
setMatchedDN
protected final void setMatchedDN(String dn)
Sets the matched DN.- Parameters:
dn- matched DN
-
getDiagnosticMessage
public final String getDiagnosticMessage()
Returns the diagnostic message.- Specified by:
getDiagnosticMessagein interfaceResult- Returns:
- diagnostic message
-
setDiagnosticMessage
protected final void setDiagnosticMessage(String message)
Sets the diagnostic message.- Parameters:
message- diagnostic message
-
getReferralURLs
public final String[] getReferralURLs()
Returns the referral URLs.- Specified by:
getReferralURLsin interfaceResult- Returns:
- referral URLs
-
addReferralURLs
protected final void addReferralURLs(String... urls)
Adds referral URLs to the result.- Parameters:
urls- to add
-
copyValues
protected final <T extends Result> void copyValues(T result)
Copies the property values from the supplied result to this result.- Type Parameters:
T- type of result- Parameters:
result- to copy from
-
equalsResult
public final boolean equalsResult(Result result)
Returns whether the base properties of this result are equal. Those include message ID, controls, result code, matched DN, diagnostic message and referral URLs.- Parameters:
result- to compare- Returns:
- whether result properties are equal
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classAbstractMessage
-
toString
public String toString()
- Overrides:
toStringin classAbstractMessage
-
-