Ejemplo n.º 1
0
        public void AddBegin(string sKey, TaskResultData oTast, AsyncCallback fCallback, object oParam)
        {
            DelegateAdd oDelegateAdd = new DelegateAdd(Add);

            m_oAdd = oDelegateAdd;
            oDelegateAdd.BeginInvoke(sKey, oTast, fCallback, oParam);
        }
        private ErrorTypes AddToMCWithCas(string sKey, TaskResultData oTast, ulong cas)
        {
            ErrorTypes oError = ErrorTypes.NoError;

            try
            {
                using (MemcachedClient oMc = new MemcachedClient(m_oMcConfig))
                {
                    string sDataToStore = null;

                    XmlSerializer oXmlSerializer = new XmlSerializer(typeof(TaskResultData));
                    using (StringWriter oStringWriter = new StringWriter())
                    {
                        oXmlSerializer.Serialize(oStringWriter, oTast);
                        sDataToStore = oStringWriter.ToString();
                    }

                    if (cas != 0)
                    {
                        oMc.Cas(StoreMode.Set, sKey, sDataToStore, m_oTtl, cas);
                    }
                    else
                    {
                        oMc.Store(StoreMode.Set, sKey, sDataToStore, m_oTtl);
                    }
                }
            }
            catch
            {
                oError = ErrorTypes.TaskResult;
            }

            return(oError);
        }
        private ErrorTypes UpdateInMC(string sKey, TaskResultDataToUpdate oTast)
        {
            ErrorTypes oError = ErrorTypes.NoError;

            try
            {
                TaskResultData oTask = null;
                ulong          cas   = 0;
                GetFromMCWithCas(sKey, out oTask, out cas);

                if (oTask == null)
                {
                    m_oTaskResultDB.Get(sKey, out oTask);
                }

                if (oTask != null && oTask.eStatus != FileStatus.Ok)
                {
                    oTask.Update(oTast);

                    AddToMCWithCas(sKey, oTask, cas);

                    if (oTask.eStatus != FileStatus.Convert)
                    {
                        oError = m_oTaskResultDB.Update(sKey, oTast);
                    }
                }
            }
            catch
            {
                oError = ErrorTypes.TaskResult;
            }

            return(oError);
        }
Ejemplo n.º 4
0
        public void GetOrCreateBegin(string sKey, TaskResultData oDataToAdd, AsyncCallback fCallback, object oParam)
        {
            m_oGetOrCreate           = new TransportClass(fCallback, oParam);
            m_oGetOrCreate.m_oTast   = oDataToAdd;
            m_oGetOrCreate.m_bCreate = true;
            try
            {
                m_oGetOrCreate.m_oSqlCon = GetDbConnection();
                m_oGetOrCreate.m_oSqlCon.Open();

                if (Constants.mc_sPostgreProvider == Utils.GetDbConnectionProviderName(m_sConnectionString))
                {
                    IDbCommand oInsCommand = m_oGetOrCreate.m_oSqlCon.CreateCommand();
                    oInsCommand.CommandText           = GetINSERTString(m_oGetOrCreate.m_oTast);
                    m_oGetOrCreate.m_oCommand         = oInsCommand;
                    m_oGetOrCreate.m_delegateNonQuery = new ExecuteNonQuery(oInsCommand.ExecuteNonQuery);
                    m_oGetOrCreate.m_delegateNonQuery.BeginInvoke(GetOrCreateCallback, null);
                }
                else
                {
                    IDbCommand oSelCommand = m_oGetOrCreate.m_oSqlCon.CreateCommand();
                    oSelCommand.CommandText           = GetUPSERTString(m_oGetOrCreate.m_oTast);
                    m_oGetOrCreate.m_oCommand         = oSelCommand;
                    m_oGetOrCreate.m_delegateNonQuery = new ExecuteNonQuery(oSelCommand.ExecuteNonQuery);
                    m_oGetOrCreate.m_delegateNonQuery.BeginInvoke(GetOrCreateCallback2, null);
                }
            }
            catch
            {
                m_oGetOrCreate.DisposeAndCallback();
            }
        }
 public ErrorTypes GetEnd(IAsyncResult ar, out TaskResultData oTast)
 {
     oTast = null;
     if (m_oGet.m_eError == ErrorTypes.NoError)
     {
         try
         {
             if (m_oGet.m_bReadFromDB)
             {
                 m_oTaskResultDB.GetEnd(ar, out oTast);
                 DelegateAddToMC oDelegateAdd = new DelegateAddToMC(AddToMC);
                 oDelegateAdd.BeginInvoke(m_oGet.m_sKey, oTast, null, null);
             }
             else if (m_oGet.m_oTast != null)
             {
                 oTast = m_oGet.m_oTast.Clone();
             }
         }
         catch
         {
             m_oGet.m_eError = ErrorTypes.TaskResult;
         }
     }
     return(m_oGet.m_eError);
 }
 public ErrorTypes GetOrCreateEnd(IAsyncResult ar, out TaskResultData oDataAdded, out bool bCreate)
 {
     bCreate    = m_oGetOrCreate.m_bCreate;
     oDataAdded = null;
     if (ErrorTypes.NoError == m_oGetOrCreate.m_eError)
     {
         try
         {
             if (m_oGetOrCreate.m_bReadFromDB)
             {
                 m_oTaskResultDB.GetOrCreateEnd(ar, out oDataAdded, out bCreate);
                 if (oDataAdded != null)
                 {
                     DelegateAddToMC oDelegateAddToMC = new DelegateAddToMC(AddToMC);
                     oDelegateAddToMC.BeginInvoke(m_oGetOrCreate.m_sKey, oDataAdded, null, null);
                 }
             }
             else if (null != m_oGetOrCreate.m_oTast)
             {
                 oDataAdded = m_oGetOrCreate.m_oTast.Clone();
             }
         }
         catch
         {
             m_oGetOrCreate.Dispose();
         }
     }
     return(m_oGetOrCreate.m_eError);
 }
Ejemplo n.º 7
0
        public ErrorTypes GetExpired(int nMaxCount, out List <TaskResultData> aTasts)
        {
            aTasts = null;
            ErrorTypes eErrorTypes = ErrorTypes.NoError;

            try
            {
                using (IDbConnection sqlCon = GetDbConnection())
                {
                    sqlCon.Open();
                    using (IDbCommand oSelCommand = sqlCon.CreateCommand())
                    {
                        oSelCommand.CommandText = GetSELECTExpiredTasksString(nMaxCount);
                        using (IDataReader oReader = oSelCommand.ExecuteReader())
                        {
                            aTasts = new List <TaskResultData>();
                            while (oReader.Read())
                            {
                                TaskResultData oTaskResultData = new TaskResultData();
                                TaskResultFromReader(oTaskResultData, oReader);
                                aTasts.Add(oTaskResultData);
                                eErrorTypes = ErrorTypes.NoError;
                            }
                        }
                    }
                }
            }
            catch
            {
            }
            return(eErrorTypes);
        }
        public ErrorTypes Get(string sKey, out TaskResultData oTaskResultData)
        {
            oTaskResultData = null;
            ErrorTypes oError = ErrorTypes.NoError;

            try
            {
                GetFromMC(sKey, out oTaskResultData);

                if (null == oTaskResultData)
                {
                    oError = m_oTaskResultDB.Get(sKey, out oTaskResultData);
                    if (oError == ErrorTypes.NoError && oTaskResultData != null)
                    {
                        AddToMC(sKey, oTaskResultData);
                    }
                }
            }
            catch
            {
                oError = ErrorTypes.TaskResult;
            }

            return(oError);
        }
Ejemplo n.º 9
0
        public ErrorTypes GetEditing(out TaskResultData[] oTast)
        {
            ErrorTypes eErrorTypes = ErrorTypes.NoError;

            oTast = new TaskResultData[0];
            try
            {
                using (IDbConnection sqlCon = GetDbConnection())
                {
                    sqlCon.Open();
                    using (IDbCommand oSelCommand = sqlCon.CreateCommand())
                    {
                        oSelCommand.CommandText = GetSELECTEditingString();
                        using (IDataReader oReader = oSelCommand.ExecuteReader())
                        {
                            List <TaskResultData> aData = new List <TaskResultData>();
                            while (oReader.Read())
                            {
                                TaskResultData oTaskResultData = new TaskResultData();
                                TaskResultFromReader(oTaskResultData, oReader);
                                aData.Add(oTaskResultData);
                            }
                            oTast = aData.ToArray();
                        }
                    }
                }
            }
            catch
            {
                eErrorTypes = ErrorTypes.TaskResult;
            }
            return(eErrorTypes);
        }
        private ErrorTypes GetFromMCWithCas(string sKey, out TaskResultData oTast, out ulong cas)
        {
            ErrorTypes oError = ErrorTypes.NoError;

            oTast = null;
            cas   = 0;
            try
            {
                using (MemcachedClient oMc = new MemcachedClient(m_oMcConfig))
                {
                    CasResult <string> oGetData = oMc.GetWithCas <string>(sKey);

                    if (oGetData.Result != null)
                    {
                        cas = oGetData.Cas;

                        XmlSerializer oXmlSerializer = new XmlSerializer(typeof(TaskResultData));
                        using (StringReader oStringReader = new StringReader(oGetData.Result))
                        {
                            oTast = (TaskResultData)oXmlSerializer.Deserialize(oStringReader);
                        }
                    }
                }
            }
            catch
            {
                oError = ErrorTypes.TaskResult;
            }

            return(oError);
        }
Ejemplo n.º 11
0
        public ErrorTypes Get(string sKey, out TaskResultData oTaskResultData)
        {
            ErrorTypes eErrorTypes = ErrorTypes.TaskResult;

            oTaskResultData = null;
            try
            {
                using (IDbConnection sqlCon = GetDbConnection())
                {
                    sqlCon.Open();
                    using (IDbCommand oSelCommand = sqlCon.CreateCommand())
                    {
                        oSelCommand.CommandText = GetSELECTString(sKey);
                        using (IDataReader oReader = oSelCommand.ExecuteReader())
                        {
                            if (true == oReader.Read())
                            {
                                oTaskResultData = new TaskResultData();
                                TaskResultFromReader(oTaskResultData, oReader);
                                eErrorTypes = ErrorTypes.NoError;
                            }
                        }
                    }
                }
            }
            catch
            {
            }
            return(eErrorTypes);
        }
        private void GetOrCreateCallback(IAsyncResult ar)
        {
            try
            {
                TaskResultData oTaskResult = null;
                m_oGetOrCreate.m_delegateGet.EndInvoke(out oTaskResult, ar);
                m_oGetOrCreate.m_delegateGet = null;

                if (oTaskResult != null)
                {
                    m_oGetOrCreate.m_bCreate = false;
                    m_oGetOrCreate.m_oTast   = oTaskResult;
                    m_oGetOrCreate.FireCallback();
                }
                else
                {
                    m_oGetOrCreate.m_bReadFromDB = true;
                    m_oTaskResultDB.GetOrCreateBegin(m_oGetOrCreate.m_sKey, m_oGetOrCreate.m_oTast, m_oGetOrCreate.m_fCallback, m_oGetOrCreate.m_oParam);
                }
            }
            catch
            {
                m_oGetOrCreate.DisposeAndCallback();
            }
        }
Ejemplo n.º 13
0
 private void TaskResultFromReader(TaskResultData oTaskResultData, IDataReader oReader)
 {
     oTaskResultData.sKey          = Convert.ToString(oReader["tr_key"]);
     oTaskResultData.sFormat       = Convert.ToString(oReader["tr_format"]);
     oTaskResultData.eStatus       = (FileStatus)Convert.ToByte(oReader["tr_status"]);
     oTaskResultData.nStatusInfo   = Convert.ToInt32(oReader["tr_status_info"]);
     oTaskResultData.oLastOpenDate = Convert.ToDateTime(oReader["tr_last_open_date"]);
     oTaskResultData.sTitle        = Convert.ToString(oReader["tr_title"]);
 }
Ejemplo n.º 14
0
 public ErrorTypes AddRandomKeyEnd(IAsyncResult ar, out TaskResultData oTast)
 {
     oTast = null;
     if (ErrorTypes.NoError == m_oAddRandomKey.m_eError)
     {
         oTast = m_oAddRandomKey.m_oTast;
     }
     return(m_oAddRandomKey.m_eError);
 }
Ejemplo n.º 15
0
    public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
    {
        TransportClassMainAshx oTransportClassMainAshx = new TransportClassMainAshx(context, cb);
        ErrorTypes eError = ErrorTypes.NoError;
        try
        {
            _log.Info("Starting process request...");
            _log.Info(context.Request.QueryString.ToString());
            
            InputParams oInputParams = new InputParams();
            oInputParams.m_sKey = context.Request.QueryString["key"];
            oInputParams.m_svKey = context.Request.QueryString["vkey"];
            oInputParams.m_sUrl = context.Request.QueryString["url"];
            oInputParams.m_sEmbeddedfonts = context.Request.QueryString["embeddedfonts"];

            int nIndexSep = oInputParams.m_sUrl.IndexOf(',');
            if (-1 != nIndexSep)
                oInputParams.m_sUrl = oInputParams.m_sUrl.Substring(0, nIndexSep);
            oInputParams.m_sTitle = context.Request.QueryString["title"];
            if (string.IsNullOrEmpty(oInputParams.m_sTitle))
                oInputParams.m_sTitle = "convert";
            oInputParams.m_sFiletype = context.Request.QueryString["filetype"];
            oInputParams.m_nOutputtype = FileFormats.FromString(context.Request.QueryString["outputtype"]);
            oInputParams.m_bAsyncConvert = Convert.ToBoolean(context.Request.QueryString["async"]);
            oInputParams.m_sCodepage = context.Request.QueryString["codePage"];
            oInputParams.m_sDelimiter = context.Request.QueryString["delimiter"];

            if (ErrorTypes.NoError == eError)
            {
                ITaskResultInterface oTaskResult = TaskResult.NewTaskResult();
                TaskResultData oToAdd = new TaskResultData();
                
                oInputParams.m_sKey = "conv_" + oInputParams.m_sKey;
                oToAdd.sKey = oInputParams.m_sKey;
                oToAdd.sFormat = oInputParams.m_sFiletype;
                oToAdd.eStatus = FileStatus.WaitQueue;
                oToAdd.sTitle = oInputParams.m_sTitle;
                TransportClass1 oTransportClass1 = new TransportClass1(oTransportClassMainAshx, oTaskResult, new CTaskQueue(), oInputParams);
                oTaskResult.GetOrCreateBegin(oInputParams.m_sKey, oToAdd, GetOrCreateCallback, oTransportClass1);
            }
        }
        catch(Exception e)
        {
            eError = ErrorTypes.Unknown;
            
            _log.Error(context.Request.QueryString.ToString());
            _log.Error("Exeption: ", e);
        }
        finally
        {
            if( ErrorTypes.NoError != eError )
                WriteOutputCommand(oTransportClassMainAshx, new OutputCommand(null, null, null, eError));
        }
        return new AsyncOperationData(extraData);
    }
Ejemplo n.º 16
0
 private string GetUPSERTString(TaskResultData oTast)
 {
     return(string.Format("INSERT INTO tast_result ( tr_key, tr_format, tr_status, tr_status_info, tr_last_open_date, tr_title ) VALUES ('{0}', '{1}', '{2}' , '{3}', '{4}', '{5}') ON DUPLICATE KEY UPDATE tr_last_open_date = '{6}';",
                          Utils.MySqlEscape(oTast.sKey, m_sConnectionString),
                          Utils.MySqlEscape(oTast.sFormat, m_sConnectionString),
                          oTast.eStatus.ToString("d"),
                          oTast.nStatusInfo.ToString(),
                          DateTime.UtcNow.ToString(Constants.mc_sDateTimeFormat),
                          Utils.MySqlEscape(oTast.sTitle, m_sConnectionString),
                          DateTime.UtcNow.ToString(Constants.mc_sDateTimeFormat)));
 }
Ejemplo n.º 17
0
 public TaskResultData Clone()
 {
     TaskResultData oRes = new TaskResultData();
     oRes.sFormat = sFormat;
     oRes.sKey = sKey;
     oRes.eStatus = eStatus;
     oRes.nStatusInfo = nStatusInfo;
     oRes.oLastOpenDate = oLastOpenDate;
     oRes.sTitle = sTitle;
     return oRes;
 }
Ejemplo n.º 18
0
        public TaskResultData Clone()
        {
            TaskResultData oRes = new TaskResultData();

            oRes.sFormat       = sFormat;
            oRes.sKey          = sKey;
            oRes.eStatus       = eStatus;
            oRes.nStatusInfo   = nStatusInfo;
            oRes.oLastOpenDate = oLastOpenDate;
            oRes.sTitle        = sTitle;
            return(oRes);
        }
Ejemplo n.º 19
0
        public ErrorTypes GetEditingEnd(IAsyncResult ar, out TaskResultData[] oTast)
        {
            ErrorTypes eErrorTypes = ErrorTypes.NoError;

            oTast = new TaskResultData[0];
            try
            {
                eErrorTypes = m_oGetEditing.EndInvoke(out oTast, ar);
            }
            catch
            {
                eErrorTypes = ErrorTypes.TaskResult;
            }
            return(eErrorTypes);
        }
Ejemplo n.º 20
0
        public ErrorTypes GetEnd(IAsyncResult ar, out TaskResultData oTast)
        {
            oTast = null;
            ErrorTypes eErrorTypes = ErrorTypes.NoError;

            try
            {
                eErrorTypes = m_oGet.EndInvoke(out oTast, ar);
            }
            catch
            {
                eErrorTypes = ErrorTypes.TaskResult;
            }
            return(eErrorTypes);
        }
 public void GetOrCreateBegin(string sKey, TaskResultData oDataToAdd, AsyncCallback fCallback, object oParam)
 {
     m_oGetOrCreate           = new TransportClass(fCallback, oParam);
     m_oGetOrCreate.m_oTast   = oDataToAdd;
     m_oGetOrCreate.m_bCreate = true;
     m_oGetOrCreate.m_sKey    = sKey;
     try
     {
         TaskResultData oTast = null;
         m_oGetOrCreate.m_delegateGet = new DelegateGet(GetFromMC);
         m_oGetOrCreate.m_delegateGet.BeginInvoke(sKey, out oTast, GetOrCreateCallback, null);
     }
     catch
     {
         m_oGetOrCreate.DisposeAndCallback();
     }
 }
Ejemplo n.º 22
0
        public ErrorTypes Get(string[] aKeys, out TaskResultData[] sTaskResults)
        {
            ErrorTypes eErrorTypes = ErrorTypes.NoError;

            sTaskResults = new TaskResultData[aKeys.Length];
            for (int i = 0, length = sTaskResults.Length; i < length; ++i)
            {
                sTaskResults[i] = null;
            }
            try
            {
                using (IDbConnection sqlCon = GetDbConnection())
                {
                    sqlCon.Open();
                    using (IDbCommand oSelCommand = sqlCon.CreateCommand())
                    {
                        oSelCommand.CommandText = GetSELECTString(aKeys);
                        using (IDataReader oReader = oSelCommand.ExecuteReader())
                        {
                            Dictionary <string, int> mapKeyToIndex = new Dictionary <string, int>();
                            for (int i = 0, length = aKeys.Length; i < length; ++i)
                            {
                                mapKeyToIndex[aKeys[i]] = i;
                            }

                            while (oReader.Read())
                            {
                                TaskResultData oTaskResultData = new TaskResultData();
                                TaskResultFromReader(oTaskResultData, oReader);
                                int nIndex;
                                if (mapKeyToIndex.TryGetValue(oTaskResultData.sKey, out nIndex))
                                {
                                    sTaskResults[nIndex] = oTaskResultData;
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                eErrorTypes = ErrorTypes.TaskResult;
            }
            return(eErrorTypes);
        }
Ejemplo n.º 23
0
        public ErrorTypes AddRandomKey(string sKey, TaskResultData oTastToAdd, out TaskResultData oTastAdded)
        {
            ErrorTypes eError = ErrorTypes.TaskResult;

            oTastAdded = oTastToAdd.Clone();
            try
            {
                using (IDbConnection sqlCon = GetDbConnection())
                {
                    sqlCon.Open();
                    while (true)
                    {
                        string sNewKey = sKey + "_" + m_oRandom.Next(mc_nRandomMaxNumber);
                        oTastAdded.sKey = sNewKey;
                        using (IDbCommand oAddCommand = sqlCon.CreateCommand())
                        {
                            oAddCommand.CommandText = GetINSERTString(oTastAdded);
                            bool bExist = false;
                            try
                            {
                                oAddCommand.ExecuteNonQuery();
                            }
                            catch
                            {
                                bExist = true;
                            }
                            if (false == bExist)
                            {
                                eError = ErrorTypes.NoError;
                                break;
                            }
                        }
                    }
                }
            }
            catch
            {
                eError = ErrorTypes.TaskResult;
            }
            if (ErrorTypes.NoError != eError)
            {
                oTastAdded = null;
            }
            return(eError);
        }
Ejemplo n.º 24
0
 public void GetOrCreateBegin(string sKey, TaskResultData oDataToAdd, AsyncCallback fCallback, object oParam)
 {
     m_oGetOrCreate           = new TransportClass(fCallback, oParam);
     m_oGetOrCreate.m_oTast   = oDataToAdd;
     m_oGetOrCreate.m_bCreate = true;
     try
     {
         m_oGetOrCreate.m_oSqlCon = GetDbConnection();
         m_oGetOrCreate.m_oSqlCon.Open();
         IDbCommand oSelCommand = m_oGetOrCreate.m_oSqlCon.CreateCommand();
         oSelCommand.CommandText         = GetSELECTString(sKey);
         m_oGetOrCreate.m_oCommand       = oSelCommand;
         m_oGetOrCreate.m_delegateReader = new ExecuteReader(oSelCommand.ExecuteReader);
         m_oGetOrCreate.m_delegateReader.BeginInvoke(GetOrCreateCallback, null);
     }
     catch
     {
         m_oGetOrCreate.DisposeAndCallback();
     }
 }
Ejemplo n.º 25
0
 public ErrorTypes Add(string sKey, TaskResultData oTast)
 {
     ErrorTypes eError = ErrorTypes.NoError;
     try
     {
         using (IDbConnection sqlCon = GetDbConnection())
         {
             sqlCon.Open();
             using (IDbCommand oSelCommand = sqlCon.CreateCommand())
             {
                 oSelCommand.CommandText = GetINSERTString(oTast);
                 oSelCommand.ExecuteNonQuery();
             }
         }
     }
     catch
     {
         eError = ErrorTypes.TaskResult;
     }
     return eError;
 }
Ejemplo n.º 26
0
 public void AddRandomKeyBegin(string sKey, TaskResultData oTastToAdd, AsyncCallback fCallback, object oParam)
 {
     m_oAddRandomKey         = new TransportClass(fCallback, oParam);
     m_oAddRandomKey.m_oTast = oTastToAdd.Clone();
     try
     {
         m_oAddRandomKey.m_oSqlCon = GetDbConnection();
         m_oAddRandomKey.m_oSqlCon.Open();
         string sNewKey = sKey + "_" + m_oRandom.Next(mc_nRandomMaxNumber);
         m_oAddRandomKey.m_oTast.sKey = sNewKey;
         IDbCommand oSelCommand = m_oAddRandomKey.m_oSqlCon.CreateCommand();
         m_oAddRandomKey.m_oCommand         = oSelCommand;
         oSelCommand.CommandText            = GetINSERTString(m_oAddRandomKey.m_oTast);
         m_oAddRandomKey.m_delegateNonQuery = new ExecuteNonQuery(oSelCommand.ExecuteNonQuery);
         m_oAddRandomKey.m_delegateNonQuery.BeginInvoke(AddRandomKeyCallback, null);
     }
     catch
     {
         m_oAddRandomKey.DisposeAndCallback();
     }
 }
Ejemplo n.º 27
0
        public ErrorTypes Add(string sKey, TaskResultData oTast)
        {
            ErrorTypes eError = ErrorTypes.NoError;

            try
            {
                using (IDbConnection sqlCon = GetDbConnection())
                {
                    sqlCon.Open();
                    using (IDbCommand oSelCommand = sqlCon.CreateCommand())
                    {
                        oSelCommand.CommandText = GetINSERTString(oTast);
                        oSelCommand.ExecuteNonQuery();
                    }
                }
            }
            catch
            {
                eError = ErrorTypes.TaskResult;
            }
            return(eError);
        }
Ejemplo n.º 28
0
 public ErrorTypes GetOrCreateEnd(IAsyncResult ar, out TaskResultData oDataAdded, out bool bCreate)
 {
     bCreate    = m_oGetOrCreate.m_bCreate;
     oDataAdded = null;
     if (ErrorTypes.NoError == m_oGetOrCreate.m_eError)
     {
         try
         {
             if (null != m_oGetOrCreate.m_delegateReader)
             {
                 using (IDataReader oReader = m_oGetOrCreate.m_delegateReader.EndInvoke(ar))
                 {
                     if (true == oReader.Read())
                     {
                         m_oGetOrCreate.m_oTast = new TaskResultData();
                         TaskResultFromReader(m_oGetOrCreate.m_oTast, oReader);
                     }
                     else
                     {
                         m_oGetOrCreate.m_eError = ErrorTypes.TaskResult;
                     }
                 }
             }
             m_oGetOrCreate.Close();
             if (null != m_oGetOrCreate.m_oTast)
             {
                 oDataAdded = m_oGetOrCreate.m_oTast.Clone();
             }
         }
         catch (Exception e)
         {
             _log.Error("Exception catch in GetOrCreateEnd:", e);
             m_oGetOrCreate.Dispose();
         }
     }
     return(m_oGetOrCreate.m_eError);
 }
Ejemplo n.º 29
0
 private ErrorTypes AddToMC(string sKey, TaskResultData oTast)
 {
     return AddToMCWithCas(sKey, oTast, 0);
 }
Ejemplo n.º 30
0
 public void GetOrCreateBegin(string sKey, TaskResultData oDataToAdd, AsyncCallback fCallback, object oParam)
 {
     m_oGetOrCreate = new TransportClass(fCallback, oParam);
     m_oGetOrCreate.m_oTast = oDataToAdd;
     m_oGetOrCreate.m_bCreate = true;
     m_oGetOrCreate.m_sKey = sKey;
     try
     {
         TaskResultData oTast = null;
         m_oGetOrCreate.m_delegateGet = new DelegateGet(GetFromMC);
         m_oGetOrCreate.m_delegateGet.BeginInvoke(sKey, out oTast, GetOrCreateCallback, null);
     }
     catch
     {
         m_oGetOrCreate.DisposeAndCallback();
     }
 }
Ejemplo n.º 31
0
 public ErrorTypes GetEditingEnd(IAsyncResult ar, out TaskResultData[] oTast)
 {
     return m_oTaskResultDB.GetEditingEnd(ar, out oTast);
 }
Ejemplo n.º 32
0
 public ErrorTypes GetEnd(IAsyncResult ar, out TaskResultData[] sTaskResults)
 {
     return m_oTaskResultDB.GetEnd(ar, out sTaskResults);
 }
Ejemplo n.º 33
0
        public ErrorTypes GetEnd(IAsyncResult ar, out TaskResultData oTast)
        {
            oTast = null;
            if (m_oGet.m_eError == ErrorTypes.NoError)
            {
                try
                {
                    if (m_oGet.m_bReadFromDB)
                    {
                        m_oTaskResultDB.GetEnd(ar, out oTast);
                        DelegateAddToMC oDelegateAdd = new DelegateAddToMC(AddToMC);
                        oDelegateAdd.BeginInvoke(m_oGet.m_sKey, oTast, null, null);
                    }
                    else if (m_oGet.m_oTast != null)
                        oTast = m_oGet.m_oTast.Clone();

                }
                catch
                {
                    m_oGet.m_eError = ErrorTypes.TaskResult;
                }
            }
            return m_oGet.m_eError;
        }
Ejemplo n.º 34
0
        public ErrorTypes AddRandomKeyEnd(IAsyncResult ar, out TaskResultData oTast)
        {

            return m_oTaskResultDB.AddRandomKeyEnd(ar, out oTast);
        }
 private ErrorTypes AddToMC(string sKey, TaskResultData oTast)
 {
     return(AddToMCWithCas(sKey, oTast, 0));
 }
Ejemplo n.º 36
0
    private void CreateCommand(TransportClassContextRead oTransportClassContextRead, InputCommand cmd)
    {
        try
        {
            TaskResultData oTaskResultData = new TaskResultData();
            oTaskResultData.sKey = cmd.id;

            if (false == string.IsNullOrEmpty(cmd.format))
                oTaskResultData.sFormat = cmd.format;

            oTaskResultData.eStatus = FileStatus.Ok;

            if (false == string.IsNullOrEmpty(cmd.title))
                oTaskResultData.sTitle = cmd.title;

            ITaskResultInterface oTaskResult = TaskResult.NewTaskResult();
            TransportClassTaskResult oTransportClassTaskResult = new TransportClassTaskResult(oTransportClassContextRead, cmd, oTaskResult);

            oTaskResult.GetOrCreateBegin(cmd.id, oTaskResultData, TaskResultGetOrCreateCallback2, oTransportClassTaskResult);
        }
        catch
        {
            WriteOutputCommand(oTransportClassContextRead, new OutputCommand(ErrorTypes.Unknown));
        }
    }
Ejemplo n.º 37
0
 private void TaskResultFromReader(TaskResultData oTaskResultData, IDataReader oReader)
 {
     oTaskResultData.sKey = Convert.ToString(oReader["tr_key"]);
     oTaskResultData.sFormat = Convert.ToString(oReader["tr_format"]);
     oTaskResultData.eStatus = (FileStatus)Convert.ToByte(oReader["tr_status"]);
     oTaskResultData.nStatusInfo = Convert.ToInt32(oReader["tr_status_info"]);
     oTaskResultData.oLastOpenDate = Convert.ToDateTime(oReader["tr_last_open_date"]);
     oTaskResultData.sTitle = Convert.ToString(oReader["tr_title"]);
 }
        private ErrorTypes GetFromMC(string sKey, out TaskResultData oTast)
        {
            ulong cas = 0;

            return(GetFromMCWithCas(sKey, out oTast, out cas));
        }
Ejemplo n.º 39
0
 private ErrorTypes GetFromMC(string sKey, out TaskResultData oTast)
 {
     ulong cas = 0;
     return GetFromMCWithCas(sKey, out oTast, out cas);
 }
Ejemplo n.º 40
0
 private void OpenCommand(TransportClassMainAshx oTransportClassMainAshx, InputCommand cmd)
 {
     try
     {
         TaskResultData oTaskResultData = new TaskResultData();
         oTaskResultData.sKey = cmd.id;
         
         if (false == string.IsNullOrEmpty(cmd.format))
             oTaskResultData.sFormat = cmd.format;
         
         oTaskResultData.eStatus = FileStatus.WaitQueue;
         
         if (false == string.IsNullOrEmpty(cmd.title))
             oTaskResultData.sTitle = cmd.title;
         
         ITaskResultInterface oTaskResult = TaskResult.NewTaskResult();
         TransportClassTaskResult oTransportClassClearCache = new TransportClassTaskResult(oTransportClassMainAshx, cmd, oTaskResult);
         
         oTaskResult.GetOrCreateBegin(cmd.id, oTaskResultData, TaskResultGetOrCreateCallback, oTransportClassClearCache);
     }
     catch
     {
         WriteOutputCommand(oTransportClassMainAshx, new OutputCommand(ErrorTypes.Unknown));
     }
 }
 public ErrorTypes AddRandomKeyEnd(IAsyncResult ar, out TaskResultData oTast)
 {
     return(m_oTaskResultDB.AddRandomKeyEnd(ar, out oTast));
 }
Ejemplo n.º 42
0
    private void TaskResultGetProcess(TaskResultData oTaskInfo, bool bDataCreate, InputCommand cmd, TransportClassMainAshx oTransportClassMainAshx)
    {
        switch (oTaskInfo.eStatus)
        {
            case FileStatus.Ok:
                {
                    string sAffiliateId = null;
                    Signature.getVKeyStringParam(cmd.vkey, ConfigurationSettings.AppSettings["keyKeyID"], out sAffiliateId);
                    if (null != sAffiliateId)
                    {
                        string sTag = null;
                        switch (cmd.editorid)
                        {
                            case (int)LicenseInfo.EditorType.Spreadsheet: sTag = "open_sheet"; break;
                            case (int)LicenseInfo.EditorType.Presentation: sTag = "open_presentation"; break;
                            default: sTag = "open_word"; break;
                        }
                        FileConverterUtils2.FileStatistic oFileStat = new FileStatistic();
                        oFileStat.insert(sAffiliateId, cmd.id, DateTime.UtcNow, sTag);
                    }

					ITaskResultInterface oTaskResult = TaskResult.NewTaskResult();
					TransportClassTaskResult oTransportClassTaskResult = new TransportClassTaskResult(
						oTransportClassMainAshx, cmd, oTaskResult);
					
					string sOutputCommand = ("create" == cmd.c)? "create": "open";
					
					WriteOutputCommand(oTransportClassTaskResult, 
						new OutputCommand(sOutputCommand, cmd.id + "/Editor.bin"));
                }
                break;
            case FileStatus.Convert:
            case FileStatus.WaitQueue:
                {
                    if (bDataCreate)
                    {
                        AddTask(cmd, oTransportClassMainAshx);
                    }
                    else
                    {
                        
                        WriteOutputCommand(oTransportClassMainAshx, new OutputCommand("waitopen", oTaskInfo.nStatusInfo.ToString()));
                    }
                }
                break;
            case FileStatus.None:
                {

                    if (bDataCreate)
                    {
                        TaskResultDataToUpdate oToUpdate = new TaskResultDataToUpdate();
                        oToUpdate.eStatus = FileStatus.WaitQueue;
                        ITaskResultInterface oTaskResult = TaskResult.NewTaskResult();
                        TransportClassTaskResult oTransportClassTaskResult = new TransportClassTaskResult(oTransportClassMainAshx, cmd, oTaskResult);
                        oTaskResult.UpdateBegin(cmd.id, oToUpdate, TaskResultUpdateCallback, oTransportClassTaskResult);

                    }
                    else
                    {
                        
                        WriteOutputCommand(oTransportClassMainAshx, new OutputCommand("waitopen", oTaskInfo.nStatusInfo.ToString()));
                    }
                }
                break;
            case FileStatus.NeedParams:
                string sUrl = Constants.mc_sResourceServiceUrlRel + HttpUtility.UrlEncode(cmd.id + "/settings.json");
                WriteOutputCommand(oTransportClassMainAshx, new OutputCommand("needparams", sUrl));
                break;
            case FileStatus.ErrToReload:
                {
                    
                    AsyncClearCacheOperation oAsyncClearCacheOperation = new AsyncClearCacheOperation();
                    TransportClassClearCache oTempTransportClassClearCache = new TransportClassClearCache(oTransportClassMainAshx, cmd, oAsyncClearCacheOperation, oTaskInfo.nStatusInfo);
                    oAsyncClearCacheOperation.ClearCacheBegin(cmd.id, TaskResultRemoveCallback2, oTempTransportClassClearCache);
                }
                break;
            case FileStatus.Err:
                WriteOutputCommand(oTransportClassMainAshx, new OutputCommand((ErrorTypes)oTaskInfo.nStatusInfo));
                break;
            case FileStatus.SaveVersion:
                {
                    if (cmd.viewmode)
                        WriteOutputCommand(oTransportClassMainAshx, new OutputCommand("updateversion", cmd.id + "/Editor.bin"));
                    else
                    {
                        ITaskResultInterface oTaskResult = TaskResult.NewTaskResult();
                        TaskResultDataToUpdate oTask = new TaskResultDataToUpdate();
                        oTask.eStatus = FileStatus.Ok;
                        TaskResultDataToUpdate oMask = new TaskResultDataToUpdate();
                        oMask.eStatus = FileStatus.SaveVersion;
                        TransportClassTaskResult oTransportClassTaskResult = new TransportClassTaskResult(oTransportClassMainAshx, cmd, oTaskResult);
                        oTaskResult.UpdateIfBegin(cmd.id, oMask, oTask, TaskResultUpdateIfCallback2, oTransportClassTaskResult);
                    }
                }
                break;
            case FileStatus.UpdateVersion:
                WriteOutputCommand(oTransportClassMainAshx, new OutputCommand("updateversion", cmd.id + "/Editor.bin"));
                break;
            default:
                WriteOutputCommand(oTransportClassMainAshx, new OutputCommand(ErrorTypes.Unknown));
                break;
        }
    }
Ejemplo n.º 43
0
 public void AddRandomKeyBegin(string sKey, TaskResultData oTastToAdd, AsyncCallback fCallback, object oParam)
 {
     
     m_oTaskResultDB.AddRandomKeyBegin(sKey, oTastToAdd, fCallback, oParam);
 }
Ejemplo n.º 44
0
 private void TaskResultUpdateCallback2(IAsyncResult ar)
 {
     TransportClassSaveChanges1 oTransportClassSaveChanges = ar.AsyncState as TransportClassSaveChanges1;
     try
     {
         InputCommand cmd = oTransportClassSaveChanges.m_oInputCommand;
         _log.DebugFormat("Enter TaskResultUpdateCallback2(id={0})", cmd.id);
         ErrorTypes eError = oTransportClassSaveChanges.m_oTaskResult.UpdateEnd(ar);
         if (ErrorTypes.NoError == eError)
         {
             TaskResultData oTaskResultData = new TaskResultData();
             oTaskResultData.sKey = cmd.id;
             oTaskResultData.sFormat = "bin";
             oTaskResultData.eStatus = FileStatus.WaitQueue;
             oTransportClassSaveChanges.m_oTaskResult.AddRandomKeyBegin(cmd.id, oTaskResultData, TaskResultAddRandomKeyAsyncCallback3, oTransportClassSaveChanges);
         }
         else
         {
             _log.ErrorFormat("Error in TaskResultUpdateCallback2(code={0})", (int)eError);
             WriteOutputCommand(oTransportClassSaveChanges, new OutputCommand(eError));
         }
     }
     catch (Exception e)
     {
         _log.Error("Exception catched in TaskResultUpdateCallback2:", e);
         WriteOutputCommand(oTransportClassSaveChanges, new OutputCommand(ErrorTypes.Unknown));
     }
 }
Ejemplo n.º 45
0
        public ErrorTypes Get(string sKey, out TaskResultData oTaskResultData)
        {
            oTaskResultData = null;
            ErrorTypes oError = ErrorTypes.NoError;
            try
            {
                GetFromMC(sKey, out oTaskResultData);

                if (null == oTaskResultData)
                {
                    oError = m_oTaskResultDB.Get(sKey, out oTaskResultData);
                    if (oError == ErrorTypes.NoError && oTaskResultData != null)
                    {
                        AddToMC(sKey, oTaskResultData);
                    }
                }
            }
            catch
            {
                oError = ErrorTypes.TaskResult;
            }

            return oError;
        }
Ejemplo n.º 46
0
 private void SaveFormOriginCommand(TransportClassContextRead oTransportClassContextRead, InputCommand cmd)
 {
     TaskResultData oTaskResultData = new TaskResultData();
     oTaskResultData.sKey = cmd.id;
     oTaskResultData.sFormat = cmd.format;
     oTaskResultData.eStatus = FileStatus.WaitQueue;
     ITaskResultInterface oTaskResult = TaskResult.NewTaskResult();
     TransportClassTaskResult oTransportClassTaskResult = new TransportClassTaskResult(oTransportClassContextRead, cmd, oTaskResult);
     oTaskResult.AddRandomKeyBegin(cmd.id, oTaskResultData, TaskResultAddRandomKeyAsyncCallback2, oTransportClassTaskResult);
 }
Ejemplo n.º 47
0
 public ErrorTypes Get(string[] aKeys, out TaskResultData[] sTaskResults)
 {
     
     return m_oTaskResultDB.Get(aKeys, out sTaskResults);
 }
Ejemplo n.º 48
0
    private void SaveCommand(TransportClassContextRead oTransportClassContextRead, InputCommand cmd)
    {
		_log.DebugFormat("SaveCommand, savetype={0}.", cmd.savetype);
        switch (cmd.savetype)
        {
            case c_sSaveTypePartStart:
            case c_sSaveTypeCompleteAll:
                {
					_log.Debug("cmd.savetype = SaveTypes.PartStart or SaveTypes.CompleteAll.");
                    TaskResultData oTaskResultData = new TaskResultData();
                    oTaskResultData.sKey = cmd.id;
                    oTaskResultData.sFormat = cmd.format;
                    oTaskResultData.eStatus = FileStatus.WaitQueue;
                    ITaskResultInterface oTaskResult = TaskResult.NewTaskResult();
                    TransportClassTaskResult oTransportClassTaskResult = new TransportClassTaskResult(oTransportClassContextRead, cmd, oTaskResult);
                    oTaskResult.AddRandomKeyBegin(cmd.id, oTaskResultData, TaskResultAddRandomKeyAsyncCallback, oTransportClassTaskResult);
                    break;
                }
            case c_sSaveTypePart:
            case c_sSaveTypeComplete:
            default:
                {

					_log.Debug("cmd.savetype = SaveTypes.Part or SaveTypes.Complete or default.");
                    JavaScriptSerializer serializer = new JavaScriptSerializer();
                    OutputSavePartData oOutputSavePartData = new OutputSavePartData(cmd.savekey, cmd.outputformat.Value);
                    OutputCommand oOutputCommand = new OutputCommand("savepart", serializer.Serialize(oOutputSavePartData));
                    string sFilename = "Editor";
                    string sExt = ".bin";
                    Storage oStorage = new Storage();
                    TransportClassStorage2 oTransportClassStorage2 = new TransportClassStorage2(oTransportClassContextRead, cmd, oStorage, null, cmd.savekey, sFilename, sExt, oOutputCommand);
                    oStorage.GetTreeNodeBegin(cmd.savekey, GetTreeNodeCallback, oTransportClassStorage2);
                    break;
                }
        }
    }
Ejemplo n.º 49
0
 public ErrorTypes GetEditing(out TaskResultData[] oTast)
 {
     return m_oTaskResultDB.GetEditing(out oTast);
 }
Ejemplo n.º 50
0
 private void EditorBinWriteCallback(IAsyncResult ar)
 {
     TransportClassStorage oTransportClassStorage = ar.AsyncState as TransportClassStorage;
     try
     {
         int nReadWriteBytes;
         ErrorTypes eErrorTypes = oTransportClassStorage.m_oStorage.WriteFileEnd(ar, out nReadWriteBytes);
         if (null != oTransportClassStorage.m_oStream)
             oTransportClassStorage.m_oStream.Dispose();
         if (ErrorTypes.NoError == eErrorTypes)
         {
             TaskResultData oTaskResultData = new TaskResultData();
             oTaskResultData.eStatus = FileStatus.Ok;
             oTaskResultData.nStatusInfo = (int)ErrorTypes.NoError;
             TaskResultGetProcess(oTaskResultData, false, oTransportClassStorage.m_oInputCommand, oTransportClassStorage);
         }
         else
             WriteOutputCommand(oTransportClassStorage, new OutputCommand(eErrorTypes));
     }
     catch
     {
         WriteOutputCommand(oTransportClassStorage, new OutputCommand(ErrorTypes.Unknown));
     }
 }
Ejemplo n.º 51
0
 public ErrorTypes GetOrCreate(string sKey, TaskResultData oDefaultTast, out TaskResultData oTaskResultData, out bool bCreate)
 {
     return m_oTaskResultDB.GetOrCreate(sKey, oDefaultTast, out oTaskResultData, out bCreate);
 }
 public void AddRandomKeyBegin(string sKey, TaskResultData oTastToAdd, AsyncCallback fCallback, object oParam)
 {
     m_oTaskResultDB.AddRandomKeyBegin(sKey, oTastToAdd, fCallback, oParam);
 }
Ejemplo n.º 53
0
 public ErrorTypes GetOrCreateEnd(IAsyncResult ar, out TaskResultData oDataAdded, out bool bCreate)
 {
     bCreate = m_oGetOrCreate.m_bCreate;
     oDataAdded = null;
     if (ErrorTypes.NoError == m_oGetOrCreate.m_eError)
     {
         try
         {
             if (m_oGetOrCreate.m_bReadFromDB)
             {
                 m_oTaskResultDB.GetOrCreateEnd(ar, out oDataAdded, out bCreate);
                 if (oDataAdded != null)
                 {
                     DelegateAddToMC oDelegateAddToMC = new DelegateAddToMC(AddToMC);
                     oDelegateAddToMC.BeginInvoke(m_oGetOrCreate.m_sKey, oDataAdded, null, null);
                 }
             }
             else if (null != m_oGetOrCreate.m_oTast)
                 oDataAdded = m_oGetOrCreate.m_oTast.Clone();
         }
         catch
         {
             m_oGetOrCreate.Dispose();
         }
     }
     return m_oGetOrCreate.m_eError;
 }
Ejemplo n.º 54
0
        public ErrorTypes Add(string sKey, TaskResultData oTast)
        {
            AddToMC(sKey, oTast);

            return m_oTaskResultDB.Add(sKey, oTast);
        }
Ejemplo n.º 55
0
        private ErrorTypes AddToMCWithCas(string sKey, TaskResultData oTast, ulong cas)
        {
            ErrorTypes oError = ErrorTypes.NoError;
            try
            {
                using (MemcachedClient oMc = new MemcachedClient(m_oMcConfig))
                {
                    string sDataToStore = null;

                    XmlSerializer oXmlSerializer = new XmlSerializer(typeof(TaskResultData));
                    using (StringWriter oStringWriter = new StringWriter())
                    {
                        oXmlSerializer.Serialize(oStringWriter, oTast);
                        sDataToStore = oStringWriter.ToString();
                    }

                    if (cas != 0)
                        oMc.Cas(StoreMode.Set, sKey, sDataToStore, m_oTtl, cas);
                    else
                        oMc.Store(StoreMode.Set, sKey, sDataToStore, m_oTtl);
                }
            }
            catch
            {
                oError = ErrorTypes.TaskResult;
            }
                
            return oError;
        }
Ejemplo n.º 56
0
        public void AddBegin(string sKey, TaskResultData oTast, AsyncCallback fCallback, object oParam)
        {
            DelegateAdd oDelegateAdd = new DelegateAdd(AddToMC);

            oDelegateAdd.BeginInvoke(sKey, oTast, null, null);

            m_oTaskResultDB.AddBegin(sKey, oTast, fCallback, oParam);
        }
Ejemplo n.º 57
0
        private ErrorTypes GetFromMCWithCas(string sKey, out TaskResultData oTast, out ulong cas)
        {
            ErrorTypes oError = ErrorTypes.NoError;
            oTast = null;
            cas = 0;
            try
            {
                using (MemcachedClient oMc = new MemcachedClient(m_oMcConfig))
                {
                    CasResult<string> oGetData = oMc.GetWithCas<string>(sKey);

                    if (oGetData.Result != null)
                    {
                        cas = oGetData.Cas;

                        XmlSerializer oXmlSerializer = new XmlSerializer(typeof(TaskResultData));
                        using (StringReader oStringReader = new StringReader(oGetData.Result))
                        {
                            oTast = (TaskResultData)oXmlSerializer.Deserialize(oStringReader);
                        }
                    }
                }
            }
            catch
            {
                oError = ErrorTypes.TaskResult;
            }

            return oError;
        }
Ejemplo n.º 58
0
 public ErrorTypes AddRandomKey(string sKey, TaskResultData oTastToAdd, out TaskResultData oTastAdded)
 {
     return m_oTaskResultDB.AddRandomKey(sKey, oTastToAdd, out oTastAdded);
 }
Ejemplo n.º 59
0
 private void TaskResultGetOrCreateCallback2(IAsyncResult ar)
 {
     TransportClassTaskResult oTransportClassTaskResult = ar.AsyncState as TransportClassTaskResult;
     try
     {
         TaskResultData oTaskResultData;
         bool bCreate;
         ErrorTypes eError = oTransportClassTaskResult.m_oTaskResult.GetOrCreateEnd(ar, out oTaskResultData, out bCreate);
         if (ErrorTypes.NoError == eError)
         {
             if (bCreate)
             {
                 InputCommand cmd = oTransportClassTaskResult.m_oInputCommand;
                 Storage oStorage = new Storage();
                 TransportClassStorage oTransportClassStorage = new TransportClassStorage(oTransportClassTaskResult, oTransportClassTaskResult.m_oInputCommand, oStorage, null, null);
                 oStorage.CreateDirectoryBegin(cmd.id + "/media", CreateDirectoryCallback, oTransportClassStorage);
             }
             else
             {
                 TaskResultData oTaskResultDataTemp = new TaskResultData();
                 oTaskResultDataTemp.eStatus = FileStatus.Ok;
                 oTaskResultDataTemp.nStatusInfo = (int)ErrorTypes.NoError;
                 TaskResultGetProcess(oTaskResultDataTemp, false, oTransportClassTaskResult.m_oInputCommand, oTransportClassTaskResult);
             }
                 
         }
         else
             WriteOutputCommand(oTransportClassTaskResult, new OutputCommand(eError));
     }
     catch
     {
         WriteOutputCommand(oTransportClassTaskResult, new OutputCommand(ErrorTypes.Unknown));
     }
 }
 public ErrorTypes GetOrCreate(string sKey, TaskResultData oDefaultTast, out TaskResultData oTaskResultData, out bool bCreate)
 {
     return(m_oTaskResultDB.GetOrCreate(sKey, oDefaultTast, out oTaskResultData, out bCreate));
 }