示例#1
0
        /// <summary>
        /// This method generates InstructionSets upon request. When called, GenerateDeploymentDetails is assured that tainitiationSourcergetSource is
        /// exclusively "locked" for assignment at that time.
        /// </summary>
        /// <param name="listPreprocessResult">The list of initiationSources returned from the most recent call to ListPreprocess</param>
        /// <param name="initiationSource">The initiationSource from the listPreprocessResult list for which an InstructionSet is being requested</param>
        /// <param name="recommendedBranchIP">The Branch IP that is preferred for this assignment</param>
        /// <param name="limitedToBranches">The Branch IPs that this assignment is limited to in case you choose to override recommendedBranchIP</param>
        /// <returns>The DeploymentDetails instance containing the InstructionSet to be assigned, or null if no assignment should be made at this time</returns>
        public virtual DeploymentDetails GenerateDeploymentDetails(IReadOnlyList <string> listPreprocessResult, string initiationSource, string recommendedBranchIP, IReadOnlyList <string> limitedToBranches)
        {
            DeploymentDetails ret = null;

            try
            {
                _InstructionSet clone = GetTemplateInstance(true);

                CustomizeInstructionSet(clone, TemplateKVP, recommendedBranchIP, initiationSource, true);

                bool updated = clone.PopulateAuthenticationDetails(GetAuthenticationStore());

                if (updated)
                {
                    CustomizeInstructionSet(clone, TemplateKVP, recommendedBranchIP, initiationSource, true);
                }

                return(new DeploymentDetails(clone, recommendedBranchIP));
            }
            catch (Exception ex)
            {
                STEM.Sys.EventLog.WriteEntry("DeploymentController.GenerateDeploymentDetails", new Exception(InstructionSetTemplate + ": " + initiationSource, ex).ToString(), STEM.Sys.EventLog.EventLogEntryType.Error);
            }

            return(ret);
        }
示例#2
0
        public void CopyFrom(object source)
        {
            if (source is DeploymentDetails)
            {
                DeploymentDetails s = source as DeploymentDetails;

                if (s != null)
                {
                    ISet                   = s.ISet;
                    BranchIP               = s.BranchIP;
                    DeploymentManagerIP    = s.DeploymentManagerIP;
                    InitiationSource       = s.InitiationSource;
                    InstructionSetID       = s.InstructionSetID;
                    DeploymentControllerID = s.DeploymentControllerID;
                    SwitchboardRowID       = s.SwitchboardRowID;
                    DeploymentController   = s.DeploymentController;

                    Exceptions = s.Exceptions.ToList();

                    if (Issued > s.Issued || Received > s.Received || Completed > s.Completed)
                    {
                        return;
                    }

                    Issued       = s.Issued;
                    Received     = s.Received;
                    Completed    = s.Completed;
                    LastModified = s.LastModified;
                }
            }
        }
示例#3
0
 /// <summary>
 /// ExecutionComplete is called to inform the Controller that execution has completed.
 /// </summary>
 /// <param name="details">The instance of DeploymentDetails that this Controller issued</param>
 /// <param name="exceptions">A list of exceptions if any</param>
 public virtual void ExecutionComplete(DeploymentDetails details, List <Exception> exceptions)
 {
 }
示例#4
0
 /// <summary>
 /// RememberDeployment is called with DeploymentDetails that should be known to your Controller.
 /// If no independent bookkeeping is being performed by your custom Controller, simply ignore these calls.
 /// </summary>
 /// <param name="details">The instance of DeploymentDetails that this Controller is being asked to remember</param>
 public virtual void RememberDeployment(DeploymentDetails details)
 {
 }
示例#5
0
 /// <summary>
 /// InstructionSets executing on a Branch may choose to send Messages back to the DeploymentController that generated the InstructionSet;
 /// these Messages are delivered to the DeploymentController through InstructionMessageReceived
 /// </summary>
 /// <param name="m">The message related to an Instruction</param>
 /// <param name="d">The DeploymentDetails instance related to the InstructionSet that generated the Message</param>
 public virtual void InstructionMessageReceived(InstructionMessage m, DeploymentDetails d)
 {
 }