public IGRequestProcessing(IGRequest request, IGServer server)
 {
     m_server = server;
     m_request = request;
     m_xmlNodeRequest = m_request.GetXmlNode();
     XmlNode xmlNodeTypeId = request.GetAttribute(IGRequest.IGREQUEST_NODETYPE);
     if (xmlNodeTypeId != null)
         m_nTypeId = Convert.ToInt32(xmlNodeTypeId.Value);
     XmlNode xmlNodeReqId = request.GetAttribute(IGRequest.IGREQUEST_NODEID);
     if (xmlNodeReqId != null)
         m_nReqId = Convert.ToInt32(xmlNodeReqId.Value);
     XmlNode xmlNodeGuid = request.GetAttribute(IGRequest.IGREQUEST_GUID);
     if (xmlNodeGuid != null)
         m_sGuid = xmlNodeGuid.Value;
     XmlNode xmlNodeUser = request.GetParameter(IGRequest.IGREQUEST_USERLOGIN);
     if (xmlNodeUser != null)
         m_sUser = xmlNodeUser.Value;
     XmlNode xmlNodeFrameId = request.GetParameter(IGRequest.IGREQUEST_FRAMEID);
     if (xmlNodeFrameId != null)
         m_sFrameId = xmlNodeFrameId.Value;
     m_nProgressTime = DateTime.UtcNow.Ticks;
     m_nProgress = 0;
     m_eStatus = IGSMStatusUser.IGState.IGSMSTATUS_WORKING;
     m_timer = new System.Timers.Timer();
     m_timer.Elapsed += new ElapsedEventHandler(OnSurveyProcessingEvent);
     m_timer.Interval = HC.IGREQPROC_PROGRESS_CHECKTIME;
     m_timer.Start();
 }
 public override bool SendRequest(IGRequest request)
 {
     IGRequestProcessing.Add(request, m_igServer);
     IGServerControllerIcePrx serverControllerClient = m_igServer.GetServerControllerClient();
     if (serverControllerClient == null){
         m_serverMgr.AppendError("IGConnectionRemote couldn't send an Ice request");
         return false;
     }
     request.SetResult(serverControllerClient.sendRequest(request.GetXml()));
     return m_serverMgr.CreateAnswer(request).Execute();
 }
 private bool execute(IGRequest request, bool async = false)
 {
     if (m_server == null)
         return false;
     // Send request to appropriate server
     if (!m_server.SendRequest(request))
         return false;
     if (async)
         return true;
     return IGServerManager.Instance.ProcessAnswer(IGServerManager.Instance.CreateAnswer(request.GetResult(), m_server.GetConnection()));
 }
 public static void Add(IGRequest request, IGServer server)
 {
     if (request.GetId() == IGRequest.IGREQUEST_WORKSPACE_DISCONNECT)
     {
         // server does not wait for a disconnection answer
         IGServerManager.Instance.AppendInfo("To server " + server.ToString() + ": Disconnecting User Request " + request.ToString());
         return;
     }
     else
     {
         if (!request.Silent)
             IGServerManager.Instance.AppendInfo("To server " + server.ToString() + ": Processing Request " + request.ToString());
         s_lProcessingRequests.Add(new IGRequestProcessing(request, server));
     }
 }
 private int process(IGRequest request)
 {
     // Server application request
     string sUser = request.GetParameterValue(IGRequest.IGREQUEST_USERLOGIN);
     string sRequestId = request.GetAttributeValue(IGRequest.IGREQUEST_NODEID);
     string sGuid = request.GetAttributeValue(IGRequest.IGREQUEST_GUID);
     if ((sUser == null) ||
         (sRequestId == null) ||
         (sGuid == null))
         return (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_CORRUPTEDREQUEST;
     int nReqId = Convert.ToInt32(sRequestId);
     int nRes = IGSMAnswer.IGSMANSWER_ERROR_NONE;
     IGConnectionLocal userConnection = null;
     switch (nReqId)
     {
         case IGRequest.IGREQUEST_WORKSPACE_CONNECT:
             nRes = ConnectUser(sUser, sGuid, out userConnection);
             if (nRes == (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_USERALREADYCONNECTED)
             {
                 AppendInfo("Reconnecting user: " + sUser);
                 nRes = IGSMAnswer.IGSMANSWER_ERROR_NONE;
             }
             break;
         case IGRequest.IGREQUEST_WORKSPACE_DISCONNECT:
             nRes = DisconnectUser(sUser, sGuid, out userConnection);
             break;
         default:
             IGConnection conn;
             nRes = GetConnection(sUser, out conn);
             userConnection = (IGConnectionLocal)conn;
             break;
     }
     request.Connection = userConnection;
     if (nRes != IGSMAnswer.IGSMANSWER_ERROR_NONE)
         return nRes;
     if (request.GetTypeId() == IGRequest.IGREQUEST_FRAME)
     {
         string sFrameId = request.GetParameterValue(IGRequest.IGREQUEST_FRAMEID);
         string sRetry = request.GetParameterValue(IGRequest.IGREQUEST_RETRY);
         if (sFrameId != null && sRetry == null)
         {
             if (IGRequestProcessing.IsFrameBusy(sUser, sFrameId))
                 return (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_FRAMEBUSY;
         }
     }
     userConnection.GetUserStatus().m_nLastReqId = nReqId;
     return userConnection.SendRequest(request) ? IGSMAnswer.IGSMANSWER_ERROR_NONE : (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_SENDREQUEST;
 }
 public void ProcessRequest(IGRequest request)
 {
     ProcessRequest(request.GetXml(), null);
 }
示例#7
0
 public bool SendRequest(IGRequest request)
 {
     if (request != null)
     {
         if (m_connection != null)
             return m_connection.SendRequest(request);
     }
     IGServerManager.Instance.AppendError("- IGServer failed sending xml to server " + m_sIpEndPoint);
     return false;
 }
示例#8
0
 private bool sendUserRequest(HttpSessionState userSession, IGRequest request)
 {
     if ((request.GetType() != typeof(IGRequestWorkspaceDisconnect)) &&
         request.NeedAccount() &&
         (string)userSession[IGMadam.DatabaseUserSecurityAuthority.IGMADAM_USERPRIVILEGE] == IGMadam.DatabaseUserSecurityAuthority.IGMADAM_USERPRIVILEGE_DEMO)
     {
         AppendError(userSession, IGPEMULTIPLEXING_ERROR_NEEDACCOUNT);
         return false;
     }
     IPEndPoint endPoint = (IPEndPoint)userSession[SESSIONMEMBER_SERVERIP];
     if (endPoint == null)
         return false;
     if (!IGPERequestSender.SendRequest(endPoint, request))
     {
         AppendError(userSession, IGPEMULTIPLEXING_ERROR_SENDREQUEST);
         return false;
     }
     return true;
 }
示例#9
0
 public bool ProcessUserCommand(HttpSessionState userSession, IGRequest request)
 {
     Hearthbeat(userSession);
     string sUser = (string)userSession[DatabaseUserSecurityAuthority.IGMADAM_USERNAME];
     HttpSessionState sessionMatch = getUserSession(sUser);
     if (sessionMatch == null)
     {
         AppendError(userSession, "The current user \"" + sUser + "\" session is corrupted." + IGPEMULTIPLEXING_ERROR_SAFETY);
         return false;
     }
     return sendUserRequest(sessionMatch, request);
 }
示例#10
0
 public static bool SendRequest(string sServerName, IGRequest request)
 {
     IGPERequestSender newRequest = new IGPERequestSender(sServerName);
     return newRequest.execute(request);
 }
示例#11
0
 public static string ProcessUserCommand(HttpSessionState userSession, IGRequest request)
 {
     if (!IsStarted())
         return IGPEMultiplexing.IGPEMULTIPLEXING_ERROR_DISCONNECTED;
     if (!mg_multiplexingMgr.ProcessUserCommand(userSession, request))
         return IGPEWebServer.WEBSERVICE_RESULT_ERROR;
     IGAnswer answer = IGServerManager.Instance.CreateAnswer(request);
     if (userSession != null)
     {
         if (userSession[IGAnswer.IGANSWER_ALLNBLAYERS] != null)
             answer.SetParameter(IGAnswer.IGANSWER_ALLNBLAYERS, (string)userSession[IGAnswer.IGANSWER_ALLNBLAYERS]);
         if (userSession[IGAnswer.IGANSWER_ALLLAYERVISIBILITY] != null)
             answer.SetParameter(IGAnswer.IGANSWER_ALLLAYERVISIBILITY, (string)userSession[IGAnswer.IGANSWER_ALLLAYERVISIBILITY]);
         if (userSession[IGAnswer.IGANSWER_ALLSTEPIDS] != null)
             answer.SetParameter(IGAnswer.IGANSWER_ALLSTEPIDS, (string)userSession[IGAnswer.IGANSWER_ALLSTEPIDS]);
         if (userSession[IGAnswer.IGANSWER_SERVERIP] != null)
             answer.SetParameter(IGAnswer.IGANSWER_SERVERIP, ((IPEndPoint)userSession[IGAnswer.IGANSWER_SERVERIP]).Address.ToString());
     }
     return answer.ToClientOutput();
 }
示例#12
0
 public override bool SendRequest(IGRequest request)
 {
     IGRequestProcessing.Add(request, m_igServer);
     // Send request to appropriate server application
     return request.Send(m_TCPclient);
 }
示例#13
0
 public void SetRequest(IGRequest req)
 {
     if (req.ProcessAnswer(this))
         request = req;
 }
示例#14
0
 public static bool SendRequestAsync(IPEndPoint endPoint, IGRequest request)
 {
     IGPERequestSender newRequest = new IGPERequestSender(endPoint);
     return newRequest.execute(request, true);
 }
示例#15
0
 private void init(IGRequest request)
 {
     SetAttribute(IGANSWER_REQGUID, request.GetGuid());
     SetAttribute(IGANSWER_REQNAME, request.GetTitle());
     string sUser = request.GetAttributeValue(IGRequest.IGREQUEST_USERLOGIN);
     if (sUser != null)
         SetAttribute(IGANSWER_USERLOGIN, sUser);
     XmlNode xmlReqParams = request.GetParameters();
     if (xmlReqParams != null)
     {
         if (xmlReqParams.Attributes.Count > 0)
         {
             foreach (XmlAttribute att in xmlReqParams.Attributes)
                 SetParameter(att.Name, att.Value);
         }
     }
 }
示例#16
0
 public IGSMAnswerError(IGRequest request, IGSMANSWER_ERROR_CODE errorCode)
     : base(IGSMANSWER_ERROR, IGSMANSWERERROR_STRING)
 {
     string sGuid = (request == null ? "##Undefined##" : (request.GetGuid() == null ? "##Undefined##" : request.GetGuid()));
     string sName = (request == null ? "##Undefined##" : (request.GetTitle() == null ? "##Undefined##" : request.GetTitle()));
     string sUser = (request == null ? null : request.GetAttributeValue(IGRequest.IGREQUEST_USERLOGIN));
     SetAttribute(IGANSWER_REQGUID, sGuid);
     SetAttribute(IGANSWER_REQNAME, sName);
     if (sUser != null)
         SetAttribute(IGANSWER_USERLOGIN, sUser);
     SetParameter(IGSMANSWERERROR_CODEPARAM, ((int)errorCode).ToString());
     SetParameter(IGSMANSWERERROR_STRINGPARAM, errorCode.ToString());
 }
示例#17
0
 public abstract bool SendRequest(IGRequest request);