Information about a single instance of SobekCM maintained by the SobekCM builder application
        /// <summary> Constructor for a new instance of the Worker_BulkLoader class </summary>
        /// <param name="Logger"> Log file object for logging progress </param>
        /// <param name="Verbose"> Flag indicates if the builder is in verbose mode, where it should log alot more information </param>
        /// <param name="InstanceInfo"> Information for the instance of SobekCM to be processed by this bulk loader </param>
        /// <param name="LogFileDirectory"> Directory where any log files would be written </param>
        /// <param name="PluginRootDirectory"> Root directory where all the plug-ins are stored locally for the builder </param>
        public Worker_BulkLoader(LogFileXhtml Logger, Single_Instance_Configuration InstanceInfo, bool Verbose, string LogFileDirectory, string PluginRootDirectory )
        {
            // Save the log file and verbose flag
            logger = Logger;
            verbose = Verbose;
            multiInstanceBuilder = ( MultiInstance_Builder_Settings.Instances.Count > 1);
            logFileDirectory = LogFileDirectory;
            pluginRootDirectory = PluginRootDirectory;
            instanceInfo = InstanceInfo;

            // If this is processing multiple instances, limit the numbe of packages that should be processed
            // before allowing the builder to move to the next instance and poll
            if (multiInstanceBuilder)
                newItemLimit = 100;
            else
                newItemLimit = -1;

            Add_NonError_To_Log("Worker_BulkLoader.Constructor: Start", verbose, String.Empty, String.Empty, -1);

            // Create new list of collections to build
            aggregationsToRefresh = new List<string>();
            processedItems = new List<BibVidStruct>();
            deletedItems = new List<BibVidStruct>();

            // Set some defaults
            aborted = false;
            refreshed = false;
            noFoldersReported = false;
            firstrun = true;

            Add_NonError_To_Log("Worker_BulkLoader.Constructor: Done", verbose, String.Empty, String.Empty, -1);
        }
Ejemplo n.º 2
0
        private static void read_instances(XmlReader ReaderXml)
        {
            Single_Instance_Configuration singleInstance = new Single_Instance_Configuration();

            while (ReaderXml.Read())
            {
                // Only detect start elements.
                if (ReaderXml.NodeType == XmlNodeType.Element)
                {
                    // Get element name and switch on it.
                    switch (ReaderXml.Name.ToLower())
                    {
                    case "instance":
                        singleInstance = new Single_Instance_Configuration();
                        if (ReaderXml.MoveToAttribute("active"))
                        {
                            if (ReaderXml.Value.ToLower() == "false")
                            {
                                singleInstance.Is_Active = false;
                            }
                        }
                        if (ReaderXml.MoveToAttribute("name"))
                        {
                            singleInstance.Name = ReaderXml.Value.Trim();
                        }
                        break;

                    case "connection_string":
                        if (ReaderXml.MoveToAttribute("type"))
                        {
                            if (ReaderXml.Value.ToLower() == "postgresql")
                            {
                                singleInstance.DatabaseConnection.Database_Type = EalDbTypeEnum.PostgreSQL;
                            }
                        }
                        ReaderXml.Read();
                        singleInstance.DatabaseConnection.Connection_String = ReaderXml.Value;
                        break;

                    case "microservices":
                        MicroservicesClient_Config_Reader.Read_Microservices_Client_Details(ReaderXml.ReadSubtree(), singleInstance.Microservices, String.Empty);
                        break;
                    }
                }
                else if ((ReaderXml.NodeType == XmlNodeType.EndElement) && (ReaderXml.Name.ToLower() == "instance"))
                {
                    // Esnure it has SOME name
                    if (String.IsNullOrWhiteSpace(singleInstance.Name))
                    {
                        singleInstance.Name = "Connection" + (MultiInstance_Builder_Settings.Instances.Count + 1);
                    }

                    // Add this to the list of instances
                    MultiInstance_Builder_Settings.Instances.Add(singleInstance);
                }
            }
        }
Ejemplo n.º 3
0
        private static void read_legacy_instance_config(XmlReader ReaderXml)
        {
            while (ReaderXml.Read())
            {
                // Only detect start elements.
                if (ReaderXml.NodeType == XmlNodeType.Element)
                {
                    // Get element name and switch on it.
                    switch (ReaderXml.Name.ToLower())
                    {
                    case "connection_string":
                        Single_Instance_Configuration singleInstance = new Single_Instance_Configuration();
                        if (ReaderXml.MoveToAttribute("active"))
                        {
                            if (ReaderXml.Value.ToLower() == "false")
                            {
                                singleInstance.Is_Active = false;
                            }
                        }
                        if (ReaderXml.MoveToAttribute("name"))
                        {
                            singleInstance.Name = ReaderXml.Value.Trim();
                        }
                        if (ReaderXml.MoveToAttribute("type"))
                        {
                            if (ReaderXml.Value.ToLower() == "postgresql")
                            {
                                singleInstance.DatabaseConnection.Database_Type = EalDbTypeEnum.PostgreSQL;
                            }
                        }
                        ReaderXml.Read();
                        singleInstance.DatabaseConnection.Connection_String = ReaderXml.Value;

                        // Add the default microservice endpoints then
                        singleInstance.Microservices.Add_Endpoint("Builder.Get_Builder_Settings", "[BASEURL]/engine/builder/settings/protobuf?IncludeDescs={0}", Microservice_Endpoint_Protocol_Enum.PROTOBUF);
                        singleInstance.Microservices.Add_Endpoint("Configuration.Extensions", "[BASEURL]/engine/config/extensions/protobuf", Microservice_Endpoint_Protocol_Enum.PROTOBUF);
                        singleInstance.Microservices.Add_Endpoint("Configuration.Metadata", "[BASEURL]/engine/config/metadata/protobuf", Microservice_Endpoint_Protocol_Enum.PROTOBUF);
                        singleInstance.Microservices.Add_Endpoint("Configuration.OAI_PMH", "[BASEURL]/engine/config/oaipmh/protobuf", Microservice_Endpoint_Protocol_Enum.PROTOBUF);

                        // Esnure it has SOME name
                        if (String.IsNullOrWhiteSpace(singleInstance.Name))
                        {
                            singleInstance.Name = "Connection" + (MultiInstance_Builder_Settings.Instances.Count + 1);
                        }

                        // Add this to the list of instances
                        MultiInstance_Builder_Settings.Instances.Add(singleInstance);
                        break;
                    }
                }
            }
        }
        private static void read_instances(XmlReader ReaderXml )
        {
            Single_Instance_Configuration singleInstance = new Single_Instance_Configuration();

            while (ReaderXml.Read())
            {
                // Only detect start elements.
                if (ReaderXml.NodeType == XmlNodeType.Element)
                {
                    // Get element name and switch on it.
                    switch (ReaderXml.Name.ToLower())
                    {
                        case "instance":
                            singleInstance = new Single_Instance_Configuration();
                            if (ReaderXml.MoveToAttribute("active"))
                            {
                                if (ReaderXml.Value.ToLower() == "false")
                                    singleInstance.Is_Active = false;
                            }
                            if (ReaderXml.MoveToAttribute("name"))
                                singleInstance.Name = ReaderXml.Value.Trim();
                            break;

                        case "connection_string":
                            if (ReaderXml.MoveToAttribute("type"))
                            {
                                if (ReaderXml.Value.ToLower() == "postgresql")
                                    singleInstance.DatabaseConnection.Database_Type = EalDbTypeEnum.PostgreSQL;
                            }
                            ReaderXml.Read();
                            singleInstance.DatabaseConnection.Connection_String = ReaderXml.Value;
                            break;

                        case "microservices":
                            MicroservicesClient_Config_Reader.Read_Microservices_Client_Details(ReaderXml.ReadSubtree(), singleInstance.Microservices, String.Empty);
                            break;
                    }
                }
                else if ((ReaderXml.NodeType == XmlNodeType.EndElement) && (ReaderXml.Name.ToLower() == "instance"))
                {
                    // Esnure it has SOME name
                    if ( String.IsNullOrWhiteSpace(singleInstance.Name))
                        singleInstance.Name = "Connection" + ( MultiInstance_Builder_Settings.Instances.Count + 1);

                    // Add this to the list of instances
                    MultiInstance_Builder_Settings.Instances.Add(singleInstance);
                }
            }
        }
        private static void read_legacy_instance_config(XmlReader ReaderXml)
        {
            while (ReaderXml.Read())
            {
                // Only detect start elements.
                if (ReaderXml.NodeType == XmlNodeType.Element)
                {
                    // Get element name and switch on it.
                    switch (ReaderXml.Name.ToLower())
                    {
                        case "connection_string":
                            Single_Instance_Configuration singleInstance = new Single_Instance_Configuration();
                            if (ReaderXml.MoveToAttribute("active"))
                            {
                                if (ReaderXml.Value.ToLower() == "false")
                                    singleInstance.Is_Active = false;
                            }
                            if (ReaderXml.MoveToAttribute("name"))
                                singleInstance.Name = ReaderXml.Value.Trim();
                            if (ReaderXml.MoveToAttribute("type"))
                            {
                                if (ReaderXml.Value.ToLower() == "postgresql")
                                    singleInstance.DatabaseConnection.Database_Type = EalDbTypeEnum.PostgreSQL;
                            }
                            ReaderXml.Read();
                            singleInstance.DatabaseConnection.Connection_String = ReaderXml.Value;

                            // Add the default microservice endpoints then
                            singleInstance.Microservices.Add_Endpoint("Builder.Get_Builder_Settings", "[BASEURL]/engine/builder/settings/protobuf?IncludeDescs={0}", Microservice_Endpoint_Protocol_Enum.PROTOBUF);
                            singleInstance.Microservices.Add_Endpoint("Configuration.Extensions", "[BASEURL]/engine/config/extensions/protobuf", Microservice_Endpoint_Protocol_Enum.PROTOBUF);
                            singleInstance.Microservices.Add_Endpoint("Configuration.Metadata", "[BASEURL]/engine/config/metadata/protobuf", Microservice_Endpoint_Protocol_Enum.PROTOBUF);
                            singleInstance.Microservices.Add_Endpoint("Configuration.OAI_PMH", "[BASEURL]/engine/config/oaipmh/protobuf", Microservice_Endpoint_Protocol_Enum.PROTOBUF);

                            // Esnure it has SOME name
                            if (String.IsNullOrWhiteSpace(singleInstance.Name))
                                singleInstance.Name = "Connection" + (MultiInstance_Builder_Settings.Instances.Count + 1);

                            // Add this to the list of instances
                            MultiInstance_Builder_Settings.Instances.Add(singleInstance);
                            break;
                    }
                }
            }
        }