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 class
AbstractResult.AbstractBuilder<B,T extends AbstractResult>
protected static class
AbstractResult.DiagnosticMessageHandler
Parse handler implementation for the LDAP diagnostic message.protected static class
AbstractResult.MatchedDNHandler
Parse handler implementation for the LDAP matched DN.protected static class
AbstractResult.ReferralHandler
Parse handler implementation for the LDAP referral.protected static class
AbstractResult.ResultCodeHandler
Parse 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 String
diagnosticMessage
Diagnostic message.private String
matchedDN
Matched DN.private List<String>
referralURLs
Referral URLS.private ResultCode
resultCode
Result 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 void
addReferralURLs(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.boolean
equals(Object o)
boolean
equalsResult(Result result)
Returns whether the base properties of this result are equal.String
getDiagnosticMessage()
Returns the diagnostic message.String
getMatchedDN()
Returns the matched DN.String[]
getReferralURLs()
Returns the referral URLs.ResultCode
getResultCode()
Returns the result code.protected void
setDiagnosticMessage(String message)
Sets the diagnostic message.protected void
setMatchedDN(String dn)
Sets the matched DN.protected void
setResultCode(ResultCode code)
Sets the result code.String
toString()
-
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:
getResultCode
in 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:
getMatchedDN
in 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:
getDiagnosticMessage
in 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:
getReferralURLs
in 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:
equals
in classAbstractMessage
-
toString
public String toString()
- Overrides:
toString
in classAbstractMessage
-
-