예제 #1
0
        internal void UpdateWorkloadResults(Guid runId, byte[] jobResults, ComplianceBindingType bindingType, ComplianceJobStatus status)
        {
            IEnumerable <ComplianceBinding> enumerable = TempDatabase.Instance.FindComplianceJobBindings(this.organizationId.OrganizationalUnit.ObjectGuid, runId, new ComplianceBindingType?(bindingType));

            if (enumerable != null)
            {
                ComplianceBinding complianceBinding = enumerable.First <ComplianceBinding>();
                if (jobResults != null)
                {
                    complianceBinding.JobResults = jobResults;
                }
                if (complianceBinding.JobStatus != ComplianceJobStatus.StatusUnknown)
                {
                    complianceBinding.JobStatus = status;
                }
                switch (status)
                {
                case ComplianceJobStatus.Succeeded:
                case ComplianceJobStatus.Failed:
                case ComplianceJobStatus.PartiallySucceeded:
                    this.DeleteTasks(this.organizationId.OrganizationalUnit.ObjectGuid, runId, new ComplianceBindingType?(bindingType));
                    break;
                }
                TempDatabase.Instance.UpdateBindingTable(complianceBinding);
            }
        }
예제 #2
0
 public static IComplianceTaskCreator GetInstance(ComplianceBindingType bindingType)
 {
     if (bindingType == ComplianceBindingType.ExchangeBinding)
     {
         return(ComplianceTaskCreatorFactory.exchangeBindingTaskCreatorInstance.Value);
     }
     throw new NotImplementedException();
 }
예제 #3
0
 public static IDisposable SetTestHook(ComplianceBindingType bindingType, IComplianceTaskCreator testHook)
 {
     if (bindingType == ComplianceBindingType.ExchangeBinding)
     {
         return(ComplianceTaskCreatorFactory.exchangeBindingTaskCreatorInstance.SetTestHook(testHook));
     }
     throw new NotImplementedException();
 }
예제 #4
0
        private bool ProcessBindings(ComplianceJob dataObject, ComplianceBindingType bindingType, out bool processedAllBindings, out string[] processedBindings)
        {
            processedAllBindings = false;
            processedBindings    = null;
            string text;
            string text2;
            bool   flag;

            string[] array;
            string[] array2;
            string[] array3;
            MultiValuedProperty <string> multiValuedProperty;

            switch (bindingType)
            {
            case ComplianceBindingType.ExchangeBinding:
                text   = "ExchangeBinding";
                text2  = "AllExchangeBindings";
                flag   = (bool)(base.Fields["AllExchangeBindings"] ?? false);
                array  = (string[])base.Fields["ExchangeBinding"];
                array2 = (string[])base.Fields["AddExchangeBinding"];
                array3 = (string[])base.Fields["RemoveExchangeBinding"];
                multiValuedProperty  = dataObject.ExchangeBindings;
                processedAllBindings = dataObject.AllExchangeBindings;
                break;

            case ComplianceBindingType.SharePointBinding:
                text   = "SharePointBinding";
                text2  = "AllSharePointBindings";
                flag   = (bool)(base.Fields["AllSharePointBindings"] ?? false);
                array  = (string[])base.Fields["SharePointBinding"];
                array2 = (string[])base.Fields["AddSharePointBinding"];
                array3 = (string[])base.Fields["RemoveSharePointBinding"];
                multiValuedProperty  = dataObject.SharePointBindings;
                processedAllBindings = dataObject.AllSharePointBindings;
                break;

            case ComplianceBindingType.PublicFolderBinding:
                text   = "PublicFolderBinding";
                text2  = "AllPublicFolderBindings";
                flag   = (bool)(base.Fields["AllPublicFolderBindings"] ?? false);
                array  = (string[])base.Fields["PublicFolderBinding"];
                array2 = (string[])base.Fields["AddPublicFolderBinding"];
                array3 = (string[])base.Fields["RemovePublicFolderBinding"];
                multiValuedProperty  = dataObject.PublicFolderBindings;
                processedAllBindings = dataObject.AllPublicFolderBindings;
                break;

            default:
                return(false);
            }
            bool result = false;

            if (base.Fields.IsModified(text))
            {
                result = true;
            }
            else if (multiValuedProperty != null)
            {
                array = multiValuedProperty.ToArray();
            }
            if (array2 != null && array2.Length > 0)
            {
                if (array == null)
                {
                    array = array2;
                }
                else
                {
                    array = array.Union(array2).ToArray <string>();
                }
                result = true;
            }
            if (array3 != null && array3.Length > 0 && array != null)
            {
                array  = array.Except(array3).ToArray <string>();
                result = true;
            }
            if (base.Fields.IsModified(text2))
            {
                processedAllBindings = flag;
                result = true;
            }
            if (flag)
            {
                if (array != null || multiValuedProperty != null)
                {
                    this.WriteWarning(Strings.AllSourceMailboxesParameterOverride(text2, text));
                }
                processedBindings = null;
            }
            else
            {
                processedBindings = array;
            }
            return(result);
        }