コード例 #1
0
        /// <summary>
        /// Compares current values in eDirectory with the values of the object that is to be written to eDirectory
        /// The results are returned as an LdapModifications array
        /// </summary>
        /// <param name="newApp">
        /// A <see cref="LDAPZFDApp"/>
        /// </param>
        /// <param name="oldApp">
        /// A <see cref="LDAPZFDApp"/>
        /// </param>
        /// <returns>
        /// A <see cref="LdapModification[]"/>
        /// </returns>
        internal static ArrayList BuildZFDAppModifications(LDAPZFDApp newApp, LDAPZFDApp oldApp)
        {
            LdapAttribute attribute;
            ArrayList modList = new ArrayList();

            /* If associations list do not match, replace */
            if (newApp.getZENAppAssociations().SequenceEqual(oldApp.getZENAppAssociations()) == false) {

                Logger.Debug("Current Associations and modified Associations do not match {0}", newApp.getDN());

                attribute = new LdapAttribute( "appAssociations", newApp.getZENAppAssociations().ToArray());
                modList.Add( new LdapModification(LdapModification.REPLACE, attribute)); //Add to the list of mods
            }

            return modList;
        }