Class LDIFModifyChangeRecord

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROPERTY_ALWAYS_INCLUDE_TRAILING_DASH
      The name of the system property that will be used to indicate whether to always include a trailing dash after the last change in the LDIF representation of a modify change record.
    • Constructor Summary

      Constructors 
      Constructor Description
      LDIFModifyChangeRecord​(ModifyRequest modifyRequest)
      Creates a new LDIF modify change record from the provided modify request.
      LDIFModifyChangeRecord​(java.lang.String dn, Modification... modifications)
      Creates a new LDIF modify change record with the provided DN and set of modifications.
      LDIFModifyChangeRecord​(java.lang.String dn, Modification[] modifications, java.util.List<Control> controls)
      Creates a new LDIF modify change record with the provided DN and set of modifications.
      LDIFModifyChangeRecord​(java.lang.String dn, java.util.List<Modification> modifications)
      Creates a new LDIF modify change record with the provided DN and set of modifications.
      LDIFModifyChangeRecord​(java.lang.String dn, java.util.List<Modification> modifications, java.util.List<Control> controls)
      Creates a new LDIF modify change record with the provided DN and set of modifications.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean alwaysIncludeTrailingDash()
      Indicates whether the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change.
      LDIFModifyChangeRecord duplicate​(Control... controls)
      Creates a duplicate of this LDIF change record with the provided set of controls.
      boolean equals​(java.lang.Object o)
      Indicates whether the provided object is equal to this LDIF change record.
      ChangeType getChangeType()
      Retrieves the type of operation represented by this LDIF change record.
      Modification[] getModifications()
      Retrieves the set of modifications for this modify change record.
      int hashCode()
      Retrieves a hash code for this change record.
      LDAPResult processChange​(LDAPInterface connection, boolean includeControls)
      Apply the change represented by this LDIF change record to a directory server using the provided connection, optionally including any change record controls in the request.
      static void setAlwaysIncludeTrailingDash​(boolean alwaysIncludeTrailingDash)
      Specifies whether the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change.
      java.lang.String[] toLDIF​(int wrapColumn)
      Retrieves a string array whose lines contain an LDIF representation of this change record.
      void toLDIF​(ByteStringBuffer buffer, int wrapColumn)
      Appends an LDIF string representation of this change record to the provided buffer.
      void toLDIFString​(java.lang.StringBuilder buffer, int wrapColumn)
      Appends an LDIF string representation of this change record to the provided buffer.
      ModifyRequest toModifyRequest()
      Creates a modify request from this LDIF modify change record.
      ModifyRequest toModifyRequest​(boolean includeControls)
      Creates a modify request from this LDIF modify change record, optionally including any change record controls in the request.
      void toString​(java.lang.StringBuilder buffer)
      Appends a single-line string representation of this change record to the provided buffer.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • PROPERTY_ALWAYS_INCLUDE_TRAILING_DASH

        public static final java.lang.String PROPERTY_ALWAYS_INCLUDE_TRAILING_DASH
        The name of the system property that will be used to indicate whether to always include a trailing dash after the last change in the LDIF representation of a modify change record. By default, the dash will always be included.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LDIFModifyChangeRecord

        public LDIFModifyChangeRecord​(java.lang.String dn,
                                      Modification... modifications)
        Creates a new LDIF modify change record with the provided DN and set of modifications.
        Parameters:
        dn - The DN for this LDIF add change record. It must not be null.
        modifications - The set of modifications for this LDIF modify change record. It must not be null or empty.
      • LDIFModifyChangeRecord

        public LDIFModifyChangeRecord​(java.lang.String dn,
                                      Modification[] modifications,
                                      java.util.List<Control> controls)
        Creates a new LDIF modify change record with the provided DN and set of modifications.
        Parameters:
        dn - The DN for this LDIF add change record. It must not be null.
        modifications - The set of modifications for this LDIF modify change record. It must not be null or empty.
        controls - The set of controls for this LDIF modify change record. It may be null or empty if there are no controls.
      • LDIFModifyChangeRecord

        public LDIFModifyChangeRecord​(java.lang.String dn,
                                      java.util.List<Modification> modifications)
        Creates a new LDIF modify change record with the provided DN and set of modifications.
        Parameters:
        dn - The DN for this LDIF add change record. It must not be null.
        modifications - The set of modifications for this LDIF modify change record. It must not be null or empty.
      • LDIFModifyChangeRecord

        public LDIFModifyChangeRecord​(java.lang.String dn,
                                      java.util.List<Modification> modifications,
                                      java.util.List<Control> controls)
        Creates a new LDIF modify change record with the provided DN and set of modifications.
        Parameters:
        dn - The DN for this LDIF add change record. It must not be null.
        modifications - The set of modifications for this LDIF modify change record. It must not be null or empty.
        controls - The set of controls for this LDIF modify change record. It may be null or empty if there are no controls.
      • LDIFModifyChangeRecord

        public LDIFModifyChangeRecord​(ModifyRequest modifyRequest)
        Creates a new LDIF modify change record from the provided modify request.
        Parameters:
        modifyRequest - The modify request to use to create this LDIF modify change record. It must not be null.
    • Method Detail

      • alwaysIncludeTrailingDash

        public static boolean alwaysIncludeTrailingDash()
        Indicates whether the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change.
        Returns:
        true if the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change, or false if not.
      • setAlwaysIncludeTrailingDash

        public static void setAlwaysIncludeTrailingDash​(boolean alwaysIncludeTrailingDash)
        Specifies whether the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change.
        Parameters:
        alwaysIncludeTrailingDash - Indicates whether the LDIF representation of a modify change record should always include a trailing dash after the last (or only) change.
      • getModifications

        public Modification[] getModifications()
        Retrieves the set of modifications for this modify change record.
        Returns:
        The set of modifications for this modify change record.
      • toModifyRequest

        public ModifyRequest toModifyRequest()
        Creates a modify request from this LDIF modify change record. Any change record controls will be included in the request
        Returns:
        The modify request created from this LDIF modify change record.
      • toModifyRequest

        public ModifyRequest toModifyRequest​(boolean includeControls)
        Creates a modify request from this LDIF modify change record, optionally including any change record controls in the request.
        Parameters:
        includeControls - Indicates whether to include any controls in the request.
        Returns:
        The modify request created from this LDIF modify change record.
      • duplicate

        public LDIFModifyChangeRecord duplicate​(Control... controls)
        Creates a duplicate of this LDIF change record with the provided set of controls.
        Specified by:
        duplicate in class LDIFChangeRecord
        Parameters:
        controls - The set of controls to include in the duplicate change record. It may be null or empty if no controls should be included.
        Returns:
        A duplicate of this LDIF change record with the provided set of controls.
      • processChange

        public LDAPResult processChange​(LDAPInterface connection,
                                        boolean includeControls)
                                 throws LDAPException
        Apply the change represented by this LDIF change record to a directory server using the provided connection, optionally including any change record controls in the request.
        Specified by:
        processChange in class LDIFChangeRecord
        Parameters:
        connection - The connection to use to apply the change.
        includeControls - Indicates whether to include any controls in the request.
        Returns:
        An object providing information about the result of the operation.
        Throws:
        LDAPException - If an error occurs while processing this change in the associated directory server.
      • toLDIF

        public java.lang.String[] toLDIF​(int wrapColumn)
        Retrieves a string array whose lines contain an LDIF representation of this change record.
        Specified by:
        toLDIF in interface LDIFRecord
        Specified by:
        toLDIF in class LDIFChangeRecord
        Parameters:
        wrapColumn - The column at which to wrap long lines. A value that is less than or equal to two indicates that no wrapping should be performed.
        Returns:
        A string array whose lines contain an LDIF representation of this change record.
      • toLDIF

        public void toLDIF​(ByteStringBuffer buffer,
                           int wrapColumn)
        Appends an LDIF string representation of this change record to the provided buffer.
        Specified by:
        toLDIF in interface LDIFRecord
        Specified by:
        toLDIF in class LDIFChangeRecord
        Parameters:
        buffer - The buffer to which to append an LDIF representation of this change record.
        wrapColumn - The column at which to wrap long lines. A value that is less than or equal to two indicates that no wrapping should be performed.
      • toLDIFString

        public void toLDIFString​(java.lang.StringBuilder buffer,
                                 int wrapColumn)
        Appends an LDIF string representation of this change record to the provided buffer.
        Specified by:
        toLDIFString in interface LDIFRecord
        Specified by:
        toLDIFString in class LDIFChangeRecord
        Parameters:
        buffer - The buffer to which to append an LDIF representation of this change record.
        wrapColumn - The column at which to wrap long lines. A value that is less than or equal to two indicates that no wrapping should be performed.
      • hashCode

        public int hashCode()
        Retrieves a hash code for this change record.
        Specified by:
        hashCode in class LDIFChangeRecord
        Returns:
        A hash code for this change record.
      • equals

        public boolean equals​(java.lang.Object o)
        Indicates whether the provided object is equal to this LDIF change record.
        Specified by:
        equals in class LDIFChangeRecord
        Parameters:
        o - The object for which to make the determination.
        Returns:
        true if the provided object is equal to this LDIF change record, or false if not.
      • toString

        public void toString​(java.lang.StringBuilder buffer)
        Appends a single-line string representation of this change record to the provided buffer.
        Specified by:
        toString in interface LDIFRecord
        Specified by:
        toString in class LDIFChangeRecord
        Parameters:
        buffer - The buffer to which the information should be written.