Class LdapResultDsml

    • Constructor Detail

      • LdapResultDsml

        public LdapResultDsml​(LdapApiService codec,
                              LdapResult result,
                              Message message)
        Creates a new instance of LdapResultDsml.
        Parameters:
        codec - The LDAP Service to use
        result - the LdapResult to decorate
        message - the associated message
    • Method Detail

      • toDsml

        public org.dom4j.Element toDsml​(org.dom4j.Element root)
        Converts the request/reponse to its XML representation in the DSMLv2 format
        Specified by:
        toDsml in interface DsmlDecorator<LdapResult>
        Parameters:
        root - the root dom4j Element
        Returns:
        the dom4j Element corresponding to the entry.
      • getDiagnosticMessage

        public String getDiagnosticMessage()
        Gets the descriptive diagnostic message associated with the error code. May be null for SUCCESS, COMPARETRUE, COMPAREFALSE and REFERRAL operations.
        Specified by:
        getDiagnosticMessage in interface LdapResult
        Returns:
        the descriptive diagnostic message.
      • setDiagnosticMessage

        public void setDiagnosticMessage​(String diagnosticMessage)
        Sets the descriptive diagnostic message associated with the error code. May be null for SUCCESS, COMPARETRUE, and COMPAREFALSE operations.
        Specified by:
        setDiagnosticMessage in interface LdapResult
        Parameters:
        diagnosticMessage - the descriptive diagnostic message.
      • addReferral

        public void addReferral​(LdapUrl referral)
        Add a referral
        Parameters:
        referral - The referral to add.
      • isReferral

        public boolean isReferral()
        Gets whether or not this result represents a Referral. For referrals the error code is set to REFERRAL and the referral property is not null.
        Specified by:
        isReferral in interface LdapResult
        Returns:
        true if this result represents a referral.
      • getReferral

        public Referral getReferral()
        Gets the Referral associated with this LdapResult if the resultCode property is set to the REFERRAL ResultCodeEnum.
        Specified by:
        getReferral in interface LdapResult
        Returns:
        the referral on REFERRAL resultCode, null on all others.
      • setReferral

        public void setReferral​(Referral referral)
        Sets the Referral associated with this LdapResult if the resultCode property is set to the REFERRAL ResultCodeEnum. Setting this property will result in a true return from isReferral and the resultCode should be set to REFERRAL.
        Specified by:
        setReferral in interface LdapResult
        Parameters:
        referral - optional referral on REFERRAL errors.
      • isDefaultSuccess

        public boolean isDefaultSuccess()
        Tells if the LdapResult is a success, with no added information. The MatchedDn will be empty, as the diagnostic message and the referral. The ResultCode will always be 0.
        Specified by:
        isDefaultSuccess in interface LdapResult
        Returns:
        True if the LdapResult is SUCCESS.