Пример #1
0
 static public SyncInterval Get(Member member, Collection collection)
 {
     // Get the aggregate policy.
     return(SyncInterval.Get(collection));
 }
Пример #2
0
        /// <summary>
        /// Collect the list of policies for a member for a particular node
        /// </summary>
        /// <param name="member">Member for which policies list needed</param>
        /// <param name="node">Reference Node with all policies</param>
        internal void AggregateAllPolicies(Member member, ref Node node)
        {
            Store store = Store.GetStore();
            //Domain domain = store.GetDomain(store.DefaultDomain);

            long AggregateNoOfiFoldersLimit = Simias.Policy.iFolderLimit.Get(member).Limit;

            //All the encryption policies are local properties, but still they need to go
            //to clients for encryption related operations. In future this needs to be changed
            //to client local properties.
            if (member.RAName != "")
            {
                Property p = new Property(PropertyTags.RAName, member.RAName);
                node.Properties.DeleteNodeProperties(PropertyTags.RAName);
                node.Properties.ModifyNodeProperty(p);
            }

            if (member.EncryptionKey != "")
            {
                Property p = new Property(PropertyTags.EncryptionKey, member.EncryptionKey);
                node.Properties.DeleteNodeProperties(PropertyTags.EncryptionKey);
                node.Properties.ModifyNodeProperty(p);
            }

            if (member.EncryptionVersion != "")
            {
                Property p = new Property(PropertyTags.EncryptionVersion, member.EncryptionVersion);
                node.Properties.DeleteNodeProperties(PropertyTags.EncryptionVersion);
                node.Properties.ModifyNodeProperty(p);
            }

            if (member.EncryptionBlob != "")
            {
                Property p = new Property(PropertyTags.EncryptionBlob, member.EncryptionBlob);
                node.Properties.DeleteNodeProperties(PropertyTags.EncryptionBlob);
                node.Properties.ModifyNodeProperty(p);
            }

            if (member.EncryptionType != "")
            {
                Property p = new Property(PropertyTags.EncryptionType, member.EncryptionType);
                node.Properties.DeleteNodeProperties(PropertyTags.EncryptionType);
                node.Properties.ModifyNodeProperty(p);
            }

            if (member.RAPublicKey != "")
            {
                Property p = new Property(PropertyTags.RAPublicKey, member.RAPublicKey);
                node.Properties.DeleteNodeProperties(PropertyTags.RAPublicKey);
                node.Properties.ModifyNodeProperty(p);
            }



            Rule rule = new Rule(AggregateNoOfiFoldersLimit, Rule.Operation.Greater, Rule.Result.Deny);

            node.Properties.ModifyNodeProperty(Simias.Policy.iFolderLimit.iFolderLimitPolicyID, rule.ToString());

            long AggregateDiskSpaceQuota = Simias.Policy.DiskSpaceQuota.Get(member).Limit;
            Rule DiskSpaceRule           = new Rule(AggregateDiskSpaceQuota, Rule.Operation.Greater, Rule.Result.Deny);

            node.Properties.ModifyNodeProperty(Simias.Policy.DiskSpaceQuota.DiskSpaceQuotaPolicyID, DiskSpaceRule.ToString());
            long UsedDiskSpace = Simias.Policy.DiskSpaceQuota.Get(member).UsedSpace;

            node.Properties.ModifyNodeProperty(Simias.Policy.DiskSpaceQuota.UsedDiskSpaceOnServer, UsedDiskSpace);

            Simias.Policy.SyncInterval SyncIntervalObject = Simias.Policy.SyncInterval.Get(member);
            int AggregateSyncInterval = SyncIntervalObject.Interval;

            node.Properties.ModifyNodeProperty(Simias.Policy.SyncInterval.SyncIntervalPolicyID, AggregateSyncInterval);

            long AggregateFileSizeLimit = Simias.Policy.FileSizeFilter.Get(member).Limit;
            Rule FileSizeRule           = new Rule(AggregateFileSizeLimit, Rule.Operation.Greater, Rule.Result.Deny);

            node.Properties.ModifyNodeProperty(Simias.Policy.FileSizeFilter.FileSizeFilterPolicyID, FileSizeRule.ToString());

            int AggregateEncryptionStatus = Simias.Policy.SecurityState.Get(member);

            node.Properties.ModifyNodeProperty(Simias.Policy.SecurityState.EncryptionStatePolicyID, AggregateEncryptionStatus);

            int AggregateSharingStatus = Simias.Policy.Sharing.Get(member);

            node.Properties.ModifyNodeProperty(Simias.Policy.Sharing.SharingPolicyID, AggregateSharingStatus);

            //Simias.Policy.FileTypeFilter.GetPatterns(domain)
        }