protected virtual void GetEnableSecuritySetting(INamedPropertyDictionary properties)
 {
     lock (_globalSettingsLock)
     {
         if (properties.ContainsKey(GlymaModelConstants.EnableSecurity))
         {
             _isSecurityEnabled = (bool)properties[GlymaModelConstants.EnableSecurity];
         }
     }
 }
 protected virtual void GetEnableNodeAclCacheSetting(INamedPropertyDictionary properties)
 {
     lock (_globalSettingsLock)
     {
         if (properties.ContainsKey(GlymaModelConstants.EnableNodeAclCache))
         {
             _isNodeAclCacheEnabled = (bool)properties[GlymaModelConstants.EnableNodeAclCache];
         }
     }
 }
 protected virtual void GetSecurityConnectionString(INamedPropertyDictionary properties)
 {
     lock (_globalSettingsLock)
     {
         if (!properties.ContainsKey(GlymaModelConstants.SecurityConnectionString) || string.IsNullOrEmpty((string)properties[GlymaModelConstants.SecurityConnectionString]))
         {
             throw new ArgumentException("A security repository connection string has not been specified in the model.");
         }
         _securityConnectionString = (string)properties[GlymaModelConstants.SecurityConnectionString];
     }
 }
        /// <summary>
        /// Reads configuration parameters from BDCM and instantiates the ShopifyClient.
        /// </summary>
        /// <returns></returns>
        private ShopifyClient GetShopifyClient()
        {
            INamedPropertyDictionary properties = LobSystemInstance.GetProperties();

            string apiKey;
            string apiPassword;
            string apiHostName;

            if (properties.ContainsKey("ApiKey") && !string.IsNullOrWhiteSpace(properties["ApiKey"].ToString()))
            {
                apiKey = properties["ApiKey"].ToString();
            }
            else
            {
                throw new ArgumentException("ApiKey property must be defined for LOB System Instance");
            }

            if (properties.ContainsKey("ApiPassword") && !string.IsNullOrWhiteSpace(properties["ApiPassword"].ToString()))
            {
                apiPassword = properties["ApiPassword"].ToString();
            }
            else
            {
                throw new ArgumentException("ApiPassword property must be defined for LOB System Instance");
            }

            if (properties.ContainsKey("ApiHostName") && !string.IsNullOrWhiteSpace(properties["ApiHostName"].ToString()))
            {
                apiHostName = properties["ApiHostName"].ToString();
            }
            else
            {
                throw new ArgumentException("ApiHostName property must be defined for LOB System Instance");
            }

            return(new ShopifyClient(apiKey, apiPassword, apiHostName));
        }
        protected virtual void SetMapConnectionString(GlymaRepositoryProxy proxy, INamedPropertyDictionary properties, string repositoryName)
        {
            string connectionString = string.Empty;

            if (!properties.ContainsKey(GlymaModelConstants.MapConnectionString) || string.IsNullOrEmpty((string)properties[GlymaModelConstants.MapConnectionString]))
            {
                throw new ArgumentException("A map repository connection string has not been specified in the model for the LOB instance: " + repositoryName + ".");
            }
            connectionString = (string)properties[GlymaModelConstants.MapConnectionString];

            if (_dataAccessType == DataAccessType.Sql)
            {
                proxy.MapRepository = new SqlGlymaMapRepository(connectionString);
            }
        }
 protected virtual void GetNodeAclTaskWaitDuration(INamedPropertyDictionary properties)
 {
     lock (_globalSettingsLock)
     {
         if (properties.ContainsKey(GlymaModelConstants.NodeAclTaskWaitDuration))
         {
             int aclWaitDuration = (int)properties[GlymaModelConstants.NodeAclTaskWaitDuration];
             if (aclWaitDuration < 0)
             {
                 throw new ArgumentException("The propery: " + GlymaModelConstants.NodeAclTaskWaitDuration + ", cannot be a negative number.");
             }
             _nodeAclTaskWaitDuration = new TimeSpan(0, 0, (int)properties[GlymaModelConstants.NodeAclTaskWaitDuration]);
         }
     }
 }
 protected virtual void GetNodeAclCacheMaxItems(INamedPropertyDictionary properties)
 {
     lock (_globalSettingsLock)
     {
         if (properties.ContainsKey(GlymaModelConstants.NodeAclCacheMaxItems))
         {
             int maxItems = (int)properties[GlymaModelConstants.NodeAclCacheMaxItems];
             if (maxItems < 0)
             {
                 throw new ArgumentException("The propery: " + GlymaModelConstants.NodeAclCacheMaxItems + ", cannot be a negative number.");
             }
             _nodeAclCacheMaxItems = maxItems;
         }
     }
 }
 protected virtual void GetNodeAclCacheAutoExpirePeriod(INamedPropertyDictionary properties)
 {
     lock (_globalSettingsLock)
     {
         if (properties.ContainsKey(GlymaModelConstants.NodeAclCacheAutoExpirePeriod))
         {
             int cacheAutoExpirePeriod = (int)properties[GlymaModelConstants.NodeAclCacheAutoExpirePeriod];
             if (cacheAutoExpirePeriod < 0)
             {
                 throw new ArgumentException("The propery: " + GlymaModelConstants.NodeAclCacheAutoExpirePeriod + ", cannot be a negative number.");
             }
             _nodeAclCacheAutoExpirePeriod = new TimeSpan(0, 0, (int)properties[GlymaModelConstants.NodeAclCacheAutoExpirePeriod]);
         }
     }
 }
        protected virtual void GetDataAccessType(INamedPropertyDictionary properties)
        {
            lock (_globalSettingsLock)
            {
                if (!properties.ContainsKey(GlymaModelConstants.DataAccessType) || string.IsNullOrEmpty((string)properties[GlymaModelConstants.DataAccessType]))
                {
                    throw new ArgumentException("The property: " + GlymaModelConstants.DataAccessType + ", has not been specified in the model.");
                }

                string         dataAccessTypeString = (string)properties[GlymaModelConstants.DataAccessType];
                DataAccessType dataAccessType;
                try
                {
                    dataAccessType = ParseEnum <DataAccessType>(dataAccessTypeString);
                }
                catch (ArgumentException)
                {
                    throw new ArgumentException("The property: " + GlymaModelConstants.DataAccessType + ", has an invalid value.  The allowed values are: (" + string.Join(", ", Enum.GetNames(typeof(DataAccessType))) + ").");
                }

                _dataAccessType = dataAccessType;
            }
        }