Example #1
0
        private void GetNextPage()
        {
            string response;

            if (this.exporting)
            {
                response = this.webService.ExportConnectorSpaceGetNext(this.token, (ulong)this.csParts, this.entryParts, this.pageSize);
                SyncServer.ThrowExceptionOnReturnError(response);
            }
            else
            {
                response = this.webService.GetCSResults(this.token, this.pageSize, (ulong)this.csParts, this.entryParts, 0, null);
                SyncServer.ThrowExceptionOnReturnError(response);
            }

            XmlDocument d = new XmlDocument();

            d.LoadXml(response);

            if (d.SelectSingleNode("error") != null)
            {
                this.currentResultSet = new CSObjectSearchResultBatch(d);
            }
            else
            {
                this.currentResultSet = new CSObjectSearchResultBatch(d.SelectSingleNode("batch"));
            }
        }
Example #2
0
        public string ExecuteRunProfileNative(string runProfileName)
        {
            string result = this.WebService.RunMA(this.ID.ToMmsGuid(), this.GetRunConfiguration(runProfileName), false);

            SyncServer.ThrowExceptionOnReturnError(result);
            return(result);
        }
Example #3
0
        private static string GetImportFlows()
        {
            string result = ws.GetMVData(MVData.MV_IMPORT_ATTR_FLOW);

            SyncServer.ThrowExceptionOnReturnError(result);
            return(result);
        }
Example #4
0
        public static MVObjectCollection GetMVObjects(MVQuery query)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            if (query.ObjectType == null && query.QueryItems.Count == 0)
            {
                throw new InvalidOperationException("Either an object type or attribute queries must be provided");
            }

            StringBuilder resultSet = new StringBuilder();

            resultSet.AppendLine("<results>");

            string results = ws.SearchMV(query.GetXml());

            SyncServer.ThrowExceptionOnReturnError(results);

            if (string.IsNullOrEmpty(results))
            {
                return(new MVObjectCollection(new XmlDocument()));
            }

            resultSet.AppendLine(results);
            resultSet.AppendLine("</results>");

            XmlDocument d = new XmlDocument();

            d.LoadXml(resultSet.ToString());

            return(new MVObjectCollection(d));
        }
Example #5
0
        private static string GetMVData()
        {
            string result = ws.GetMVData(MVData.MV_ALL);

            SyncServer.ThrowExceptionOnReturnError(result);
            return(result);
        }
Example #6
0
        /// <summary>
        /// Sets the state of the connector space object
        /// </summary>
        /// <param name="connectorState">The state to set the connector to</param>
        public void SetConnectorState(ConnectorState connectorState)
        {
            string result = ws.SetConnectorState(this.MAID.ToMmsGuid(), this.ID.ToMmsGuid(), (CONNECTORSTATE)connectorState);

            SyncServer.ThrowExceptionOnReturnError(result);
            this.Refresh();
        }
Example #7
0
        internal string ExportManagementAgent(bool includeIafs, string timestamp)
        {
            string result = this.WebService.ExportManagementAgent(this.Name, true, includeIafs, timestamp);

            SyncServer.ThrowExceptionOnReturnError(result);
            return(result);
        }
Example #8
0
        private CSObjectEnumerator ExportConnectorSpace(string critieria, int pageSize = 10, CSObjectParts csParts = CSObjectParts.AllItems, uint entryParts = 0xFFFFFFFF)
        {
            string token = this.WebService.ExportConnectorSpace(this.Name, critieria, true);

            SyncServer.ThrowExceptionOnReturnError(token);

            return(new CSObjectEnumerator(this.WebService, token, true, pageSize, csParts, entryParts));
        }
Example #9
0
        private CSObjectEnumerator ExecuteCSSearch(string criteria, int pageSize = 10, CSObjectParts csParts = CSObjectParts.AllItems, uint entryParts = 0xFFFFFFFF)
        {
            string token = this.WebService.ExecuteCSSearch(this.ID.ToMmsGuid(), criteria);

            SyncServer.ThrowExceptionOnReturnError(token);

            return(new CSObjectEnumerator(this.WebService, token, false, pageSize, csParts, entryParts));
        }
Example #10
0
        public static DsmlSchema GetMVSchema()
        {
            string schema = ws.GetMVData(MVData.MV_SCHEMA);

            SyncServer.ThrowExceptionOnReturnError(schema);

            return(DsmlSchema.GetMVSchema(schema));
        }
Example #11
0
        public static RunDetails GetRunDetail(Guid maid, int runNumber)
        {
            string query  = $"<execution-history-req ma=\"{maid.ToMmsGuid()}\"><run-number>{runNumber}</run-number></execution-history-req>";
            string result = ws.GetExecutionHistory(query);

            SyncServer.ThrowExceptionOnReturnError(result);

            return(result != null?RunDetails.GetRunDetails(result).FirstOrDefault() : null);
        }
Example #12
0
        /// <summary>
        /// Joins the connector space object to the metaverse object with the specified type and ID
        /// </summary>
        /// <param name="mvObjectType">The type of metaverse object to join</param>
        /// <param name="mvObjectId">The ID of the metaverse object to join</param>
        public void Join(string mvObjectType, Guid mvObjectId)
        {
            SyncServer.ThrowOnInvalidObjectType(mvObjectType);

            string result = ws.Join(this.MAID.ToMmsGuid(), this.ID.ToMmsGuid(), mvObjectType, mvObjectId.ToMmsGuid());

            SyncServer.ThrowExceptionOnReturnError(result);
            this.Refresh();
        }
Example #13
0
        /// <summary>
        /// Gets a value that indicates if the metaverse object will be deleted when this object is disconnected
        /// </summary>
        /// <returns>This method returns true if the object deletion rule of the object will be satisfied as a result of disconnecting the object</returns>
        public bool WillDeleteMVObjectOnDisconnect()
        {
            int    willDelete = 0;
            string result     = ws.CSObjectWillBeDeleted(this.MAID.ToMmsGuid(), this.ID.ToMmsGuid(), ref willDelete);

            SyncServer.ThrowExceptionOnReturnError(result);

            return(willDelete == 1);
        }
Example #14
0
        public IEnumerable <RunSummary> GetRunSummary()
        {
            ulong ts = 0;

            string result = this.WebService.GetExecSummary(ref ts, out _, out _);

            SyncServer.ThrowExceptionOnReturnError(result);

            return(RunSummary.GetRunSummary(result, this.ID));
        }
Example #15
0
        public static SyncServiceRole GetRole()
        {
            string result = ws.GetRole();

            SyncServer.ThrowExceptionOnReturnError(result);

            int role = Convert.ToInt32(result);

            return((SyncServiceRole)role);
        }
Example #16
0
        public static IEnumerable <RunSummary> GetRunSummary()
        {
            ulong ts = 0;

            string result = ws.GetExecSummary(ref ts, out _, out _);

            SyncServer.ThrowExceptionOnReturnError(result);

            return(RunSummary.GetRunSummary(result));
        }
Example #17
0
        internal static XmlNode GetMaData(MMSWebService ws, Guid id, MAData madata, MAPartitionData partitionData, MARunData rundata)
        {
            string result = ws.GetMaData(id.ToMmsGuid(), (uint)madata, (uint)partitionData, (uint)rundata);

            SyncServer.ThrowExceptionOnReturnError(result);

            XmlDocument d = new XmlDocument();

            d.LoadXml(result);
            return(d.SelectSingleNode("/ma-data"));
        }
Example #18
0
        private XmlNode GetMaData(MAData madata, MAPartitionData partitionData, MARunData rundata)
        {
            string result = this.WebService.GetMaData(this.ID.ToMmsGuid(), (uint)madata, (uint)partitionData, (uint)rundata);

            SyncServer.ThrowExceptionOnReturnError(result);

            XmlDocument d = new XmlDocument();

            d.LoadXml(result);
            return(d.SelectSingleNode("/"));
        }
Example #19
0
        public static MVObject GetMVObject(Guid id)
        {
            string result = ws.GetMVObjects(new[] { id.ToMmsGuid() }, 1, 0xffffffff, 0xffffffff, 0, null);

            SyncServer.ThrowExceptionOnReturnError(result);

            XmlDocument d = new XmlDocument();

            d.LoadXml(result);

            return(new MVObject(d.SelectSingleNode("/mv-objects/mv-object")));
        }
Example #20
0
        /// <summary>
        /// Disconnects a connector space object
        /// </summary>
        /// <param name="makeExplicit">A value indicating either an explicit disconnector should be created</param>
        public void Disconnect(bool makeExplicit)
        {
            string result = ws.Disconnect(this.MAID.ToMmsGuid(), this.ID.ToMmsGuid());

            SyncServer.ThrowExceptionOnReturnError(result);

            if (makeExplicit)
            {
                result = ws.SetExplicit(this.MAID.ToMmsGuid(), this.ID.ToMmsGuid(), true);
                SyncServer.ThrowExceptionOnReturnError(result);
            }

            this.Refresh();
        }
Example #21
0
        public RunDetails GetLastRun()
        {
            string query = $"<execution-history-req ma=\"{this.ID.ToMmsGuid()}\"><num-req>1</num-req></execution-history-req>";

            string result = this.WebService.GetExecutionHistory(query);

            SyncServer.ThrowExceptionOnReturnError(result);

            if (result != null)
            {
                return(RunDetails.GetRunDetails(result).FirstOrDefault());
            }

            return(null);
        }
Example #22
0
        /// <summary>
        /// Performs a synchronization of the connector space object, and optionally commits the result of the synchronization to the metaverse
        /// </summary>
        /// <param name="commit">A value indicating if the synchronization should be committed</param>
        /// <param name="delta">A value indicating that a delta synchronization, rather than a full synchronization should be performed</param>
        /// <returns>An object representing the results of the synchronization operation</returns>
        public SyncPreview Sync(bool commit, bool delta)
        {
            string result = ws.Preview(this.MAID.ToMmsGuid(), this.ID.ToMmsGuid(), delta, commit);

            SyncServer.ThrowExceptionOnReturnError(result);
            XmlDocument d = new XmlDocument();

            d.LoadXml(result);

            if (commit)
            {
                this.Refresh();
            }

            return(new SyncPreview(d.SelectSingleNode("/preview")));
        }
Example #23
0
        public RunDetails GetRunDetail(int runNumber)
        {
            string query  = $"<execution-history-req ma=\"{this.ID.ToMmsGuid()}\"><run-number>{runNumber}</run-number></execution-history-req>";
            string result = this.WebService.GetExecutionHistory(query);

            SyncServer.ThrowExceptionOnReturnError(result);

            if (result != null)
            {
                return(RunDetails.GetRunDetails(result).FirstOrDefault());
            }
            else
            {
                return(null);
            }
        }
Example #24
0
        /// <summary>
        /// Projects a connector space object to the metaverse
        /// </summary>
        /// <param name="objectType">The name of the metaverse object type to project the connector space object as</param>
        /// <returns>Returns the newly created metaverse object</returns>
        public MVObject Project(string objectType)
        {
            SyncServer.ThrowOnInvalidObjectType(objectType);

            string result = ws.Project(this.MAID.ToMmsGuid(), objectType, this.ID.ToMmsGuid());

            if (Guid.TryParse(result, out Guid mvid))
            {
                this.Refresh();
                return(SyncServer.GetMVObject(mvid));
            }
            else
            {
                SyncServer.ThrowExceptionOnReturnError(result);
                return(null);
            }
        }
Example #25
0
        public static IEnumerable <CSObjectRef> GetStepDetailCSObjectRefs(Guid stepID, string statisticsType, CancellationToken t, uint pageSize = 10)
        {
            string query = $"<step-object-details-filter step-id='{stepID.ToMmsGuid()}'><statistics type='{statisticsType}'/></step-object-details-filter>";
            string token = null;

            try
            {
                token = ws.ExecuteStepObjectDetailsSearch(query);

                while (!t.IsCancellationRequested)
                {
                    int count = 0;

                    string xml = ws.GetStepObjectResults(token, pageSize);
                    SyncServer.ThrowExceptionOnReturnError(xml);

                    XmlDocument d = new XmlDocument();
                    d.LoadXml(xml);

                    foreach (XmlNode node in d.SelectNodes("step-object-details/cs-object"))
                    {
                        yield return(new CSObjectRef(node));

                        count++;
                    }

                    if (count == 0)
                    {
                        break;
                    }
                }
            }
            finally
            {
                if (token != null)
                {
                    ws.ReleaseSessionObjects(new[] { token });
                }
            }
        }
Example #26
0
        public IEnumerable <RunDetails> GetRunHistory(int count)
        {
            if (count <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(count), "Run history count must be greater than zero");
            }

            string query = $"<execution-history-req ma=\"{this.ID.ToMmsGuid()}\"><num-req>{count}</num-req></execution-history-req>";

            string result = this.WebService.GetExecutionHistory(query);

            SyncServer.ThrowExceptionOnReturnError(result);

            if (result != null)
            {
                return(RunDetails.GetRunDetails(result));
            }
            else
            {
                return(null);
            }
        }
Example #27
0
        public void Stop()
        {
            string result = this.WebService.StopMA(this.ID.ToMmsGuid());

            SyncServer.ThrowExceptionOnReturnError(result);
        }