public XInventoryService(IConfigSource config, string configName)
            : base(config)
        {
            if (configName != string.Empty)
            {
                m_ConfigName = configName;
            }

            string dllName    = String.Empty;
            string connString = String.Empty;
            //string realm = "Inventory"; // OSG version doesn't use this

            //
            // Try reading the [InventoryService] section first, if it exists
            //
            IConfig authConfig = config.Configs[m_ConfigName];

            if (authConfig != null)
            {
                dllName       = authConfig.GetString("StorageProvider", dllName);
                connString    = authConfig.GetString("ConnectionString", connString);
                m_AllowDelete = authConfig.GetBoolean("AllowDelete", true);
                // realm = authConfig.GetString("Realm", realm);
            }

            //
            // Try reading the [DatabaseService] section, if it exists
            //
            IConfig dbConfig = config.Configs["DatabaseService"];

            if (dbConfig != null)
            {
                if (dllName == String.Empty)
                {
                    dllName = dbConfig.GetString("StorageProvider", String.Empty);
                }
                if (connString == String.Empty)
                {
                    connString = dbConfig.GetString("ConnectionString", String.Empty);
                }
            }

            //
            // We tried, but this doesn't exist. We can't proceed.
            //
            if (dllName == String.Empty)
            {
                throw new Exception("No StorageProvider configured");
            }

            m_Database = LoadPlugin <IXInventoryData>(dllName,
                                                      new Object[] { connString, String.Empty });

            if (m_Database == null)
            {
                throw new Exception("Could not find a storage interface in the given module");
            }
        }
Example #2
0
        public HGInventoryService(IConfigSource config)
            : base(config)
        {
            string dllName    = String.Empty;
            string connString = String.Empty;
            //string realm = "Inventory"; // OSG version doesn't use this

            //
            // Try reading the [DatabaseService] section, if it exists
            //
            IConfig dbConfig = config.Configs["DatabaseService"];

            if (dbConfig != null)
            {
                if (dllName == String.Empty)
                {
                    dllName = dbConfig.GetString("StorageProvider", String.Empty);
                }
                if (connString == String.Empty)
                {
                    connString = dbConfig.GetString("ConnectionString", String.Empty);
                }
            }

            //
            // Try reading the [InventoryService] section, if it exists
            //
            IConfig authConfig = config.Configs["InventoryService"];

            if (authConfig != null)
            {
                dllName    = authConfig.GetString("StorageProvider", dllName);
                connString = authConfig.GetString("ConnectionString", connString);
                // realm = authConfig.GetString("Realm", realm);
            }

            //
            // We tried, but this doesn't exist. We can't proceed.
            //
            if (dllName == String.Empty)
            {
                throw new Exception("No StorageProvider configured");
            }

            m_Database = LoadPlugin <IXInventoryData>(dllName,
                                                      new Object[] { connString, String.Empty });
            if (m_Database == null)
            {
                throw new Exception("Could not find a storage interface in the given module");
            }

            m_log.Debug("[HG INVENTORY SERVICE]: Starting...");
        }
Example #3
0
        public HGInventoryService(IConfigSource config)
            : base(config)
        {
            string dllName = String.Empty;
            string connString = String.Empty;
            //string realm = "Inventory"; // OSG version doesn't use this

            //
            // Try reading the [DatabaseService] section, if it exists
            //
            IConfig dbConfig = config.Configs["DatabaseService"];
            if (dbConfig != null)
            {
                if (dllName == String.Empty)
                    dllName = dbConfig.GetString("StorageProvider", String.Empty);
                if (connString == String.Empty)
                    connString = dbConfig.GetString("ConnectionString", String.Empty);
            }

            //
            // Try reading the [InventoryService] section, if it exists
            //
            IConfig authConfig = config.Configs["InventoryService"];
            if (authConfig != null)
            {
                dllName = authConfig.GetString("StorageProvider", dllName);
                connString = authConfig.GetString("ConnectionString", connString);
                // realm = authConfig.GetString("Realm", realm);
            }

            //
            // We tried, but this doesn't exist. We can't proceed.
            //
            if (dllName == String.Empty)
                throw new Exception("No StorageProvider configured");

            m_Database = LoadPlugin<IXInventoryData>(dllName,
                    new Object[] {connString, String.Empty});
            if (m_Database == null)
                throw new Exception("Could not find a storage interface in the given module");

            m_log.Debug("[HG INVENTORY SERVICE]: Starting...");
        }
Example #4
0
        public XInventoryService(IConfigSource config) : base(config)
        {
            string dllName = String.Empty;
            string connString = String.Empty;
            //string realm = "Inventory"; // OSG version doesn't use this

            //
            // Try reading the [InventoryService] section first, if it exists
            //
            IConfig authConfig = config.Configs["InventoryService"];
            if (authConfig != null)
            {
                dllName = authConfig.GetString("StorageProvider", dllName);
                connString = authConfig.GetString("ConnectionString", connString);
                m_AllowDelete = authConfig.GetBoolean("AllowDelete", true);
                // realm = authConfig.GetString("Realm", realm);
            }

            //
            // Try reading the [DatabaseService] section, if it exists
            //
            IConfig dbConfig = config.Configs["DatabaseService"];
            if (dbConfig != null)
            {
                if (dllName == String.Empty)
                    dllName = dbConfig.GetString("StorageProvider", String.Empty);
                if (connString == String.Empty)
                    connString = dbConfig.GetString("ConnectionString", String.Empty);
            }

            //
            // We tried, but this doesn't exist. We can't proceed.
            //
            if (dllName == String.Empty)
                throw new Exception("No StorageProvider configured");

            m_Database = LoadPlugin<IXInventoryData>(dllName,
                    new Object[] {connString, String.Empty});
            if (m_Database == null)
                throw new Exception("Could not find a storage interface in the given module");

            IConfig m_LoginServerConfig = config.Configs["LoginService"];
            if (m_LoginServerConfig == null)
                throw new Exception(String.Format("No section LoginService in config file"));
            Object[] args = new Object[] { config };
            string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty);
            m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
        }
Example #5
0
        public HGInventoryService(IConfigSource config)
            : base(config)
        {
            m_log.Debug("[HGInventory Service]: Starting");

            string dllName    = String.Empty;
            string connString = String.Empty;
            //string realm = "Inventory"; // OSG version doesn't use this

            //
            // Try reading the [DatabaseService] section, if it exists
            //
            IConfig dbConfig = config.Configs["DatabaseService"];

            if (dbConfig != null)
            {
                if (dllName == String.Empty)
                {
                    dllName = dbConfig.GetString("StorageProvider", String.Empty);
                }
                if (connString == String.Empty)
                {
                    connString = dbConfig.GetString("ConnectionString", String.Empty);
                }
            }

            //
            // Try reading the [InventoryService] section, if it exists
            //
            IConfig invConfig = config.Configs["HGInventoryService"];

            if (invConfig != null)
            {
                dllName    = invConfig.GetString("StorageProvider", dllName);
                connString = invConfig.GetString("ConnectionString", connString);

                // realm = authConfig.GetString("Realm", realm);
                string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty);
                if (userAccountsDll == string.Empty)
                {
                    throw new Exception("Please specify UserAccountsService in HGInventoryService configuration");
                }

                Object[] args = new Object[] { config };
                m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(userAccountsDll, args);
                if (m_UserAccountService == null)
                {
                    throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));
                }

                // legacy configuration [obsolete]
                m_HomeURL = invConfig.GetString("ProfileServerURI", string.Empty);
                // Preferred
                m_HomeURL = invConfig.GetString("HomeURI", m_HomeURL);

                m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
            }

            //
            // We tried, but this doesn't exist. We can't proceed.
            //
            if (dllName == String.Empty)
            {
                throw new Exception("No StorageProvider configured");
            }

            m_Database = LoadPlugin <IXInventoryData>(dllName,
                                                      new Object[] { connString, String.Empty });
            if (m_Database == null)
            {
                throw new Exception("Could not find a storage interface in the given module");
            }

            m_log.Debug("[HG INVENTORY SERVICE]: Starting...");
        }
        public HGInventoryService(IConfigSource config)
            : base(config)
        {
            m_log.Debug("[HGInventory Service]: Starting");

            string dllName = String.Empty;
            string connString = String.Empty;
            //string realm = "Inventory"; // OSG version doesn't use this

            //
            // Try reading the [DatabaseService] section, if it exists
            //
            IConfig dbConfig = config.Configs["DatabaseService"];
            if (dbConfig != null)
            {
                if (dllName == String.Empty)
                    dllName = dbConfig.GetString("StorageProvider", String.Empty);
                if (connString == String.Empty)
                    connString = dbConfig.GetString("ConnectionString", String.Empty);
            }

            //
            // Try reading the [InventoryService] section, if it exists
            //
            IConfig invConfig = config.Configs["HGInventoryService"];
            if (invConfig != null)
            {
                dllName = invConfig.GetString("StorageProvider", dllName);
                connString = invConfig.GetString("ConnectionString", connString);
                
                // realm = authConfig.GetString("Realm", realm);
                string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty);
                if (userAccountsDll == string.Empty)
                    throw new Exception("Please specify UserAccountsService in HGInventoryService configuration");

                Object[] args = new Object[] { config };
                m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountsDll, args);
                if (m_UserAccountService == null)
                    throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));

                m_ProfileServiceURL = invConfig.GetString("ProfileServerURI", string.Empty);

                m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
            }

            //
            // We tried, but this doesn't exist. We can't proceed.
            //
            if (dllName == String.Empty)
                throw new Exception("No StorageProvider configured");

            m_Database = LoadPlugin<IXInventoryData>(dllName,
                    new Object[] {connString, String.Empty});
            if (m_Database == null)
                throw new Exception("Could not find a storage interface in the given module");

            m_log.Debug("[HG INVENTORY SERVICE]: Starting...");
        }