Пример #1
0
        public TestCommunicationsManager(NetworkServersInfo serversInfo)
            : base(serversInfo, new BaseHttpServer(666), null, false, null)
        {
            SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin());

            m_assetCache = new AssetCache(assetService);

            LocalInventoryService lis = new LocalInventoryService();

            m_inventoryDataPlugin = new TestInventoryDataPlugin();
            lis.AddPlugin(m_inventoryDataPlugin);
            m_interServiceInventoryService = lis;
            AddInventoryService(lis);

            LocalUserServices lus = new LocalUserServices(991, 992, this);

            lus.AddPlugin(new TemporaryUserProfilePlugin());
            m_userDataPlugin = new TestUserDataPlugin();
            lus.AddPlugin(m_userDataPlugin);
            m_userService      = lus;
            m_userAdminService = lus;

            LocalBackEndServices gs = new LocalBackEndServices();

            m_gridService = gs;
        }
Пример #2
0
        public UserServiceBase(IConfigSource config) : base(config)
        {
            IConfig userConfig = config.Configs["UserService"];

            if (userConfig == null)
            {
                throw new Exception("No UserService configuration");
            }

            string dllName = userConfig.GetString("StorageProvider",
                                                  String.Empty);

            if (dllName == String.Empty)
            {
                throw new Exception("No StorageProvider configured");
            }

            string connString = userConfig.GetString("ConnectionString",
                                                     String.Empty);

            m_Database = LoadPlugin <IUserDataPlugin>(dllName);

            if (m_Database == null)
            {
                throw new Exception("Could not find a storage interface in the given module");
            }

            m_Database.Initialise(connString);
        }
        public TestCommunicationsManager(NetworkServersInfo serversInfo)
            : base(serversInfo, null)
        {                        

            LocalUserServices lus = new LocalUserServices(991, 992, this);
            lus.AddPlugin(new TemporaryUserProfilePlugin());
            m_userDataPlugin = new TestUserDataPlugin();
            lus.AddPlugin(m_userDataPlugin);
            m_userService = lus;
            m_userAdminService = lus;

            LocalBackEndServices gs = new LocalBackEndServices();
            m_gridService = gs;
        }
Пример #4
0
        public UserServiceBase(IConfigSource config) : base(config)
        {
            IConfig userConfig = config.Configs["UserService"];
            if (userConfig == null)
                throw new Exception("No UserService configuration");

            string dllName = userConfig.GetString("StorageProvider",
                    String.Empty);

            if (dllName == String.Empty)
                throw new Exception("No StorageProvider configured");

            string connString = userConfig.GetString("ConnectionString",
                    String.Empty);

            m_Database = LoadPlugin<IUserDataPlugin>(dllName);

            if (m_Database == null)
                throw new Exception("Could not find a storage interface in the given module");

            m_Database.Initialise(connString);
        }
Пример #5
0
        public HGAuthenticationService(IConfigSource config) : base(config)
        {
            string dllName = String.Empty;
            string connString = String.Empty;

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

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

                m_PerformAuthentication = authConfig.GetBoolean("Authenticate", true);
                m_AuthorityURL = "http://" + authConfig.GetString("Authority", "localhost");
                if (!m_AuthorityURL.EndsWith("/"))
                    m_AuthorityURL += "/";
            }

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

            m_Database = LoadPlugin<IUserDataPlugin>(dllName);
            if (m_Database == null)
                throw new Exception("Could not find a storage interface in the given module");

            m_Database.Initialise(connString);
        } 
 /// <summary>
 /// Add a new user data plugin - plugins will be requested in the order they were added.
 /// </summary>
 /// <param name="plugin">The plugin that will provide user data</param>
 public void AddPlugin(IUserDataPlugin plugin)
 {
     m_storage.AddPlugin(plugin);
 }
Пример #7
0
 /// <summary>
 /// Add a new user data plugin - plugins will be requested in the order they were added.
 /// </summary>
 /// <param name="plugin">The plugin that will provide user data</param>
 public void AddPlugin(IUserDataPlugin plugin)
 {
     m_plugins.Add(plugin);
 }
 /// <summary>
 /// Add a new user data plugin - plugins will be requested in the order they were added.
 /// </summary>
 /// <param name="plugin">The plugin that will provide user data</param>
 public void AddPlugin(IUserDataPlugin plugin)
 {
     m_plugins.Add(plugin);
 }
Пример #9
0
        public override void Initialize(IPlugin plugin)
        {
            IUserDataPlugin p = plugin as IUserDataPlugin;

            p.Initialize(connect);
        }