hasPatch() public method

public hasPatch ( ConnectionSet cxns, string patchId ) : IndexedHashtable
cxns gov.va.medora.mdo.dao.ConnectionSet
patchId string
return IndexedHashtable
Ejemplo n.º 1
0
        public TaggedTextArray sitesHavePatch(string sitelist, string patchId)
        {
            TaggedTextArray result = new TaggedTextArray();
            //if (mySession.ConnectionSet.Count == 0 || !mySession.ConnectionSet.IsAuthorized)
            //{
            //    result.fault = new FaultTO(NO_CONNECTIONS);
            //}
            if (String.IsNullOrEmpty(sitelist))
            {
                result.fault = new FaultTO("Missing sitelist");
            }
            else if (String.IsNullOrEmpty(patchId))
            {
                result.fault = new FaultTO("Missing patchId");
            }
            if (result.fault != null)
            {
                return result;
            }

            try
            {
                AccountLib acctLib = new AccountLib(mySession);
                TaggedTextArray sites = acctLib.visitSites(mySession.MdwsConfiguration.AllConfigs[ConfigFileConstants.PRIMARY_CONFIG_SECTION][MdwsConfigConstants.SERVICE_ACCOUNT_PASSWORD],
                    sitelist, MdwsConstants.CPRS_CONTEXT);

                ToolsApi api = new ToolsApi();
                IndexedHashtable t = api.hasPatch(mySession.ConnectionSet, patchId);
                result = new TaggedTextArray(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            finally
            {
                mySession.ConnectionSet.disconnectAll();
            }
            return result;
        }