/// <summary>
    /// CONSTRUCTOR
    /// </summary>
    /// <param name="filePath"></param>
    public ProvisionUserInstructions(string filePath)
    {
        //==================================================================================
        //Load values from the TARGET SITE config file
        //==================================================================================
        var xmlConfigTargetSite = new System.Xml.XmlDocument();

        xmlConfigTargetSite.Load(filePath);

        //-------------------------------------------------------------------------------
        //Get instructions about the intended site membership provisioning
        //-------------------------------------------------------------------------------
        var xnodeSiteMembership = xmlConfigTargetSite.SelectSingleNode("//SiteProvisioning/SiteMembership");

        this.ActionForUnexpectedSamlUsers = ParseUnexpectedUserAction(
            xnodeSiteMembership.Attributes[ProvisionUserInstructions.XmlAttribute_authSamlUnexpectedUsers].Value);

        this.ActionForUnexpectedDefaultAuthUsers = ParseUnexpectedUserAction(
            xnodeSiteMembership.Attributes[ProvisionUserInstructions.XmlAttribute_authDefaultUnexpectedUsers].Value);

        this.ActionForMissingSamlUsers = ParseMissingUserAction(
            xnodeSiteMembership.Attributes[ProvisionUserInstructions.XmlAttribute_authSamlMissingUsers].Value);

        this.ActionForMissingDefaultAuthUsers = ParseMissingUserAction(
            xnodeSiteMembership.Attributes[ProvisionUserInstructions.XmlAttribute_authDefaultMissingUsers].Value);

        this.ActionForExistingSamlUsers = ParseExistingUserAction(
            xnodeSiteMembership.Attributes[ProvisionUserInstructions.XmlAttribute_authSamlExistingUsers].Value);

        this.ActionForExistingDefaultAuthUsers = ParseExistingUserAction(
            xnodeSiteMembership.Attributes[ProvisionUserInstructions.XmlAttribute_authDefaultExistingUsers].Value);

        //-------------------------------------------------------------------------------
        //Get the users
        //-------------------------------------------------------------------------------
        this.UsersToProvision = ParseUsers(xmlConfigTargetSite, "//SiteProvisioning/SiteMembership/User").AsReadOnly();

        //-------------------------------------------------------------------------------
        //Groups' memberships
        //-------------------------------------------------------------------------------
        var xnodeGroups = xmlConfigTargetSite.SelectSingleNode("//SiteProvisioning/GroupsMemberships");

        this.ActionForMissingGroupMembers = ParseMissingGroupMemberAction(
            xnodeGroups.Attributes[ProvisionUserInstructions.XmlAttribute_MissingGroupMembers].Value);

        this.ActionForUnexpectedGroupMembers = ParseUnexpectedGroupMemberAction(
            xnodeGroups.Attributes[ProvisionUserInstructions.XmlAttribute_UnexpectedGroupMembers].Value);

        //Load each group's membership information
        var provisionGroups = new List <ProvisioningGroup>();
        var xnodesGroups    = xmlConfigTargetSite.SelectNodes("//SiteProvisioning/GroupsMemberships/GroupMembership");

        foreach (XmlNode xmlThisGroup in xnodesGroups)
        {
            var thisGroup = new ProvisioningGroup(xmlThisGroup);
            provisionGroups.Add(thisGroup);
        }
        this.GroupsToProvision = provisionGroups.AsReadOnly();
    }
    /// <summary>
    /// XML Serialization value
    /// </summary>
    /// <param name="action"></param>
    /// <returns></returns>
    internal static string XmlAttributeText(UnexpectedGroupMemberAction action)
    {
        switch (action)
        {
        case UnexpectedGroupMemberAction.Delete:
            return(AttributeValue_Delete);

        case UnexpectedGroupMemberAction.Report:
            return(AttributeValue_Report);

        default:
            IwsDiagnostics.Assert(false, "814-413: Internal error, missing value");
            throw new Exception("814-413: Internal error, missing value");
        }
    }