internal RmsTemplate GetRmsTemplate(OrganizationId orgId, Guid templateId) { ArgumentValidator.ThrowIfNull("orgId", orgId); if (!this.enableOrgAndTemplateCache) { throw new NotSupportedException("This function is only supported in datacenter where offlineRms is enabled"); } if (orgId == OrganizationId.ForestWideOrgId) { throw new InvalidOperationException("GetRmsTemplate called with ForestWideOrgId"); } if (templateId == RmsTemplate.DoNotForward.Id) { return(RmsTemplate.DoNotForward); } if (templateId == RmsTemplate.InternetConfidential.Id) { return(RmsTemplate.InternetConfidential); } RmsConfiguration.PerTenantTemplateInfo tenantTemplateConfig = this.GetTenantTemplateConfig(orgId); RmsTemplate result; if (!tenantTemplateConfig.TryGetValue(templateId, out result)) { return(null); } return(result); }
internal IEnumerable <RmsTemplate> GetRmsTemplates(OrganizationId orgId) { ArgumentValidator.ThrowIfNull("orgId", orgId); if (orgId == OrganizationId.ForestWideOrgId) { throw new InvalidOperationException("GetRmsTemplates called with ForestWideOrgId"); } if (!this.enableOrgAndTemplateCache) { throw new NotSupportedException("This function is not supported when offlineRms is not enabled"); } RmsConfiguration.PerTenantTemplateInfo tenantTemplateConfig = this.GetTenantTemplateConfig(orgId); return(tenantTemplateConfig.Templates); }