瀏覽代碼

HPCC-14681 Remove ESP LoggingClient code

The code is not used.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx 8 年之前
父節點
當前提交
b6851c9795

+ 1 - 2
esp/clients/CMakeLists.txt

@@ -13,6 +13,5 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 ################################################################################
-add_subdirectory (LoggingClient)
 add_subdirectory (wsecl)
-add_subdirectory (WUManager)
+add_subdirectory (WUManager)

+ 0 - 68
esp/clients/LoggingClient/CMakeLists.txt

@@ -1,68 +0,0 @@
-################################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-################################################################################
-
-
-# Component: loggingclient 
-#####################################################
-# Description:
-# ------------
-#    Cmake Input File for loggingclient
-#####################################################
-
-project( loggingclient ) 
-
-include(${HPCC_SOURCE_DIR}/esp/scm/espscm.cmake)
-
-set (    SRCS 
-         ../edwin.cpp 
-         ${ESPSCM_GENERATED_DIR}/esploggingservice_esp.cpp 
-         LocalDataLogger.cpp 
-         LogFailSafe.cpp 
-         loggingserviceclient.cpp 
-         LogSerializer.cpp 
-         LogThread.cpp 
-    )
-
-include_directories ( 
-         ./../../platform 
-         ./../../../system/jlib 
-         ./../../../system/security/shared
-         ./../../bindings/SOAP/client 
-         ./../../bindings/SOAP/Platform 
-         ./../../../system/xmllib 
-         ./../../../system/include 
-         ./../../clients 
-         ./../../clients/LoggingClient 
-         ./../../bindings 
-         ./../../bindings/SOAP/xpp 
-    )
-
-ADD_DEFINITIONS( -D_USRDLL -DLOGGINGCLIENT_EXPORTS )
-
-if (RELEASE_BUILD EQUAL 1)
-    ADD_DEFINITIONS( -DISC_NO_MAIN -DLOGGING_EXPORTS )
-endif (RELEASE_BUILD EQUAL 1)
-
-HPCC_ADD_LIBRARY( loggingclient SHARED ${SRCS} )
-add_dependencies( loggingclient espscm )
-install ( TARGETS loggingclient RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
-target_link_libraries ( loggingclient
-         ${XALAN_LIBRARIES} ${XERCES_LIBRARIES}
-         jlib
-         xmllib 
-         esphttp 
-    )
-

+ 0 - 198
esp/clients/LoggingClient/LocalDataLogger.cpp

@@ -1,198 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-
-
-// LocalDataLogger.cpp: implementation of the CLocalDataLogger class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "LocalDataLogger.hpp"
-#include "jutil.hpp"
-#include "jfile.ipp"
-
-#define RETRIES 20
-
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CLocalDataLogger::CLocalDataLogger()
-{
-
-}
-
-CLocalDataLogger::CLocalDataLogger(IPropertyTree *cfg, const char *process, const char *service, const char* UrlRoot)
-{
-    StringBuffer _directoryCache,xpath;
-    
-    xpath.appendf("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]/localCache/", process, service);
-    IPropertyTree* cacheprop = cfg->queryBranch(xpath.str());
-    if(cacheprop==0)
-    {
-        WARNLOG(-1,"No local cache defined for %s service.",service);
-        return;
-    }
-    Init(cacheprop->queryProp("@cache"),cacheprop->queryProp("@fileExtension"),UrlRoot,cacheprop->getPropInt("@timerPeriod"),cacheprop->getPropInt("@cacheTimeout"));
-
-
-
-
-}
-
-CLocalDataLogger::CLocalDataLogger(const char* logDirectory,const char* ext,unsigned TimerPeriod,unsigned CacheTimeoutPeriod) 
-{
-    Init(logDirectory,ext,"",TimerPeriod,CacheTimeoutPeriod);
-}
-
-void CLocalDataLogger::Init(const char* logDirectory,const char* ext,const char* UrlRoot, unsigned TimerPeriod,unsigned CacheTimeoutPeriod)
-{
-    if(!logDirectory || !ext)
-        throw MakeStringException(-1,"Invalid parameters passed to cLocalDataLogger::Init");
-    StringBuffer pathtodir;
-    pathtodir.appendf("%s",logDirectory);
-
-    Owned<IFile> pDirectory = createIFile(pathtodir.str());
-    if(pDirectory->exists() == false)
-        pDirectory->createDirectory();
-
-    m_UrlRoot.appendf("%s",UrlRoot);
-
-    m_logDirectory.append(logDirectory);
-    StringBuffer dirpath;
-    dirpath.appendf("%s",logDirectory);
-    m_CleanupThread.setown(new CFileCleanupThread(dirpath,ext,TimerPeriod,CacheTimeoutPeriod));
-    m_CleanupThread->start();
-}
-
-CLocalDataLogger::~CLocalDataLogger()
-{
-    if (m_CleanupThread.get())
-        m_CleanupThread->finish();
-}
-
-StringBuffer& CLocalDataLogger::generateUniqueName(StringBuffer& returnName) 
-{
-    CriticalBlock b(crit);
-    Owned<IJlibDateTime> _timeNow =  createDateTimeNow();
-    SCMStringBuffer _dateString;
-    _timeNow->getDateString(_dateString);
-    returnName.appendf("%u_%s",getRandom(),_dateString.str());
-    return returnName;
-}
-
-StringBuffer& CLocalDataLogger::getFilePath(const char* fileName,StringBuffer& returnPath)
-{
-    returnPath.appendf("%s/%s.HTML",m_logDirectory.str(),fileName);
-    return returnPath;
-}
-
-StringBuffer& CLocalDataLogger::writeData(const StringBuffer& dataToCache,const StringBuffer& tokenName,StringBuffer& returnPath)
-{
-    DBGLOG("CLocalDataLogger::writeData");
-    StringBuffer tmpFile;
-    getFilePath(tokenName.str(),tmpFile);
-    Owned<IFile> file = createIFile(tmpFile.str());
-    for (int i = 0; i < RETRIES; ++i)
-    {
-        try{
-            Owned<IFileIO> io = file->open(IFOwrite);
-            size32_t filesize = dataToCache.length();
-            void* filedata = (void*)dataToCache.str();
-            io->write(0,filesize ,filedata );
-            if(m_UrlRoot.length()==0)
-                returnPath.appendf("/Cache?Name=%s.HTML",tokenName.str());
-            else
-                returnPath.appendf("/%s/Cache?Name=%s.HTML",m_UrlRoot.str(),tokenName.str());
-            break;
-        }
-        catch(IOSException *ose)
-        {
-            //The web site could be serving up the page as we try to update it...
-            ose->Release();
-            Sleep(10);
-        }
-        catch(...)
-        {
-            DBGLOG("Unknown exception thrown while reading local data logger file");
-        }
-    }
-    
-    return returnPath;
-}
-
-MemoryBuffer& CLocalDataLogger::readData(MemoryBuffer& dataCached,const char* cachedName)
-{
-    DBGLOG("CLocalDataLogger::readData");
-    StringBuffer fileName;
-    if (strstr(cachedName,"files_") != 0)
-    {
-        const char* filestr = strstr(cachedName,"files_") + 7;
-        fileName.append(filestr);
-    }
-    else
-        fileName.append(cachedName);
-
-    
-    StringBuffer filepath;
-    //need to keep it consistant with the files_ method of obtaining files.....
-    filepath.appendf("%s/%s",m_logDirectory.str(),fileName.str());
-    try{
-        DBGLOG("about to create file reference");
-        Owned<IFile> file = createIFile(filepath);
-        if (file)
-        {
-            for (int i = 0; i < RETRIES; ++i)
-            {
-                DBGLOG("Trying to open for the %d time",i);
-                try
-                {
-                    DBGLOG("Trying to open %s",filepath.str());
-                    Owned<IFileIO> io = file->open(IFOread);
-                    if (io)
-                    {
-                        DBGLOG("Managed to open");
-                        offset_t filesize = io->size();
-                        size32_t memfilesize = (size32_t)filesize;
-                        //Check size isn't >= 2^32
-                        assertex(filesize == memfilesize);
-                        io->read(0, memfilesize, dataCached.reserveTruncate(memfilesize));
-                        DBGLOG("Managed to read");
-                        return dataCached;
-                    }
-                }
-                catch(IOSException *ose)
-                {
-                    //The web site could be serving up the page as we try to update it...
-                    ose->Release();
-                    Sleep(10);
-                }
-                catch(...)
-                {
-                    DBGLOG("Unknown exception thrown while reading local data logger file");
-                }
-            }
-        }
-    }
-    catch(...)
-    {
-        DBGLOG("Unknown exception thrown while reading local data logger file2");
-    }
-    return dataCached;
-}
-

+ 0 - 155
esp/clients/LoggingClient/LocalDataLogger.hpp

@@ -1,155 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-// LocalDataLogger.h: interface for the CLocalDataLogger class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#ifndef _LocalDataLogger_HPP__
-#define _LocalDataLogger_HPP__
-
-#ifdef LOGGINGCLIENT_EXPORTS
-    #define WSLOGThread_API DECL_EXPORT
-#else
-    #define WSLOGThread_API DECL_IMPORT
-#endif
-
-#include "jiface.hpp"
-#include "jstring.hpp"
-#include "jthread.hpp"
-#include "jlog.hpp"
-#include "jfile.hpp"
-
-class CFileCleanupThread : public Thread
-{
-private:
-    StringBuffer Directory;
-    StringBuffer Ext;
-    unsigned m_TimerPeriod;
-    long m_CacheTimeoutPeriod;
-    Semaphore* m_sem;
-    bool m_bRun;
-
-    void CleanFiles()
-    {
-        //DBGLOG("directory len %d and ext len: %d",Directory.length(),Ext.length());
-        
-        if (Directory.length() == 0 || Ext.length() == 0)
-            return;
-
-        CDateTime currentTime;
-        currentTime.setNow();
-
-        int fileCounter = 0;
-//      DBGLOG("Directory:%s for files of ext:%s",Directory.str(), Ext.str());
-        Owned<IDirectoryIterator> di = createDirectoryIterator(Directory.str(), Ext.str());
-        ForEach (*di)
-        {
-            IFile &file = di->query();
-        
-            CDateTime createTime, modifiedTime,accessedTime;
-            file.getTime( &createTime,  &modifiedTime, &accessedTime);
-
-            StringBuffer accessedTimeStr,currentTimeStr;
-            accessedTime.getString(accessedTimeStr);
-        
-            accessedTime.adjustTime(+m_CacheTimeoutPeriod);
-            accessedTimeStr.clear();
-
-            accessedTime.getString(accessedTimeStr);
-            
-            currentTime.getString(currentTimeStr);
-
-            if (accessedTime.compare(currentTime) < 0)
-            {
-                const char* fileName = file.queryFilename();
-                DBGLOG("Trying to remove:%s",fileName);
-                if (file.exists() == true)
-                {
-                    fileCounter++;
-                    bool bDeleteOk = file.remove();
-                    if (!bDeleteOk)
-                        WARNLOG("ERROR Removing old cache file %s",fileName);
-                }
-            }
-        }
-    }
-public:
-    CFileCleanupThread()
-    {
-        m_TimerPeriod = 1;
-        m_CacheTimeoutPeriod = 1;
-        m_bRun = true;
-    }
-
-    //CFileCleanupThread(StringBuffer& DirectoryPath , const char* fileExt, unsigned TimerPeriodInNanoSec, unsigned CacheTimeoutPeriodInSec = 36000)
-    CFileCleanupThread(StringBuffer& DirectoryPath , const char* fileExt, unsigned TimerPeriodInMinutes = 1, unsigned CacheTimeoutPeriodInMinutes = 1)
-    {
-        m_sem = new Semaphore();
-        m_TimerPeriod = TimerPeriodInMinutes * 60 * 1000;
-        m_CacheTimeoutPeriod = CacheTimeoutPeriodInMinutes;
-        Ext.appendf("*.%s",fileExt);
-        Directory.append(DirectoryPath.str());
-    }
-
-    ~CFileCleanupThread()
-    {
-       
-        if (m_sem != 0)
-            delete m_sem;
-    }
-
-    virtual int run()
-    {
-        DBGLOG("Started Local Directory Tidyup for %s every %d",Directory.str(),m_TimerPeriod);
-        Link();
-        while(m_bRun)
-        {
-            m_sem->wait(m_TimerPeriod);
-            CleanFiles();
-        }
-        Release();
-        return 0;
-    }
-    virtual void finish()
-    {
-        m_bRun = false;
-        m_sem->signal();
-        this->join();
-    }
-};
-
-class WSLOGThread_API CLocalDataLogger : public CInterface  
-{
-private:
-        StringBuffer m_logDirectory;
-        Owned<CFileCleanupThread> m_CleanupThread;
-        CriticalSection crit;
-        StringBuffer m_UrlRoot;
-public:
-    CLocalDataLogger();
-    CLocalDataLogger(const char* logDirectory,const char* ext="",unsigned TimerPeriod=1000,unsigned CacheTimeoutPeriod=3600);
-    CLocalDataLogger(IPropertyTree *cfg, const char *process, const char *service, const char* UrlRoot);
-    virtual ~CLocalDataLogger();
-    void Init(const char* logDirectory,const char* ext="", const char* UrlRoot="", const unsigned TimerPeriod=1000,const unsigned CacheTimeoutPeriod=3600);
-    StringBuffer &getFilePath(const char* fileName,StringBuffer& returnPath);
-    StringBuffer& generateUniqueName(StringBuffer& returnName);
-    StringBuffer& writeData(const StringBuffer& dataToCache,const StringBuffer& tokenName,StringBuffer& returnPath);
-    MemoryBuffer& readData(MemoryBuffer& dataCached,const char* cachePath);
-};
-
-#endif // !defined(_LocalDataLogger_HPP__)

+ 0 - 225
esp/clients/LoggingClient/LogFailSafe.cpp

@@ -1,225 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-
-// LogFailSafe.cpp: implementation of the CLogFailSafe class.
-//
-//////////////////////////////////////////////////////////////////////
-#pragma warning(disable:4786)
-
-#include "LogFailSafe.hpp"
-#include "jmisc.hpp"
-#include "soapbind.hpp"
-
-const char* const RolloverExt="old";
-
-ILogFailSafe * createFailsafelogger(const char* logType, const char* logsdir)
-{
-    return new CLogFailSafe(logType, logsdir);
-}
-
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-CLogFailSafe::CLogFailSafe()
-{
-    
-}
-
-CLogFailSafe::CLogFailSafe(const char* logType, const char* logsdir) : m_LogType(logType), m_logsdir(logsdir)
-{
-    loadFailed(logType);
-    createNew(logType);
-}
-    
-CLogFailSafe::~CLogFailSafe()
-{
-    DBGLOG("CLogFailSafe::~CLogFailSafe()");
-    m_Added.Close();
-    m_Cleared.Close();
-}
-
-bool CLogFailSafe::FindOldLogs()
-{
-    if(m_UnsentLogs.ordinality())
-        return true;
-    return false;
-}
-
-void CLogFailSafe::LoadOldLogs(StringArray& oldLogData)
-{
-    ForEachItemIn(aidx, m_UnsentLogs)
-    {
-        oldLogData.append(m_UnsentLogs.item(aidx));
-    }
-}
-
-void CLogFailSafe::createNew(const char* logType)
-{
-
-    StringBuffer UniqueID;
-    GenerateGUID(UniqueID);
-    UniqueID.append(".log");
-
-    StringBuffer send(logType),recieve(logType);
-
-    send.append("_sending");
-    recieve.append("_recieving");
-
-    m_Added.Open(m_logsdir.str(),UniqueID,send.str());
-    m_Cleared.Open(m_logsdir.str(),UniqueID,recieve.str());
-}
-
-void CLogFailSafe::loadFailed(const char* logType)
-{
-    StringBuffer fileName;
-    fileName.appendf("%s_sending*.log",logType);
-    DBGLOG("Searching for files of type %s",fileName.str());
-
-    Owned<IDirectoryIterator> di = createDirectoryIterator(m_logsdir.str(), fileName.str());
-    ForEach (*di)
-    {
-
-        IFile &file = di->query();
-        
-        StringBuffer recieveName;
-        
-        
-        GuidMap recieve_map; 
-        
-        getRecieveFileName(file.queryFilename(),recieveName);
-        
-        DBGLOG("Loading %s", recieveName.str());
-        CRecieveLogSerializer recieveLog(recieveName.str());
-        recieveLog.LoadDataMap(recieve_map);
-            
-        DBGLOG("Checking %s", file.queryFilename());
-        CSendLogSerializer sendLog(file.queryFilename());
-        sendLog.LoadDataMap(recieve_map,m_UnsentLogs);
-    }
-}
-
-StringBuffer& CLogFailSafe::getRecieveFileName(const char* sendFileName, StringBuffer& recieveName)
-{
-    DBGLOG("enter getRecieveFileName");
-    if(!sendFileName)
-        return recieveName;
-    recieveName.append(sendFileName);
-    recieveName.replaceString("sending","recieving");
-    DBGLOG("leave getRecieveFileName");
-    return recieveName;
-}
-
-StringBuffer& CLogFailSafe::GenerateGUID(StringBuffer& GUID, const char* seed)
-{
-    GUID.appendf("%u",getRandom());
-    while (GUID.length() < 10)
-    {
-        GUID.insert(0,'0');
-    }
-    addFileTimestamp(GUID);
-    if(seed!=NULL && *seed!='\0')
-        GUID.appendf(".%s",seed);
-    return GUID;
-        
-}
-void CLogFailSafe::SplitLogRecord(const char* requestStr,StringBuffer& GUID, StringBuffer& Cache)
-{
-    SplitRecord(requestStr,GUID,Cache);
-}
-
-void CLogFailSafe::Add(const char* GUID,IInterface& pIn)
-{
-    CSoapRequestBinding* reqObj = dynamic_cast<CSoapRequestBinding*>(&pIn);
-    if (reqObj == 0)
-        throw MakeStringException(-1, "Unable to cast interface to SoapBindind");;      
-    StringBuffer dataStr;
-    reqObj->serializeContent(NULL,dataStr,NULL);
-    dataStr.insert(0,"<cache>");
-    dataStr.append("</cache>");
-    m_Added.Append(GUID,dataStr.str());
-}
-
-void CLogFailSafe::AddACK(const char* GUID)
-{
-    m_Cleared.Append(GUID,"");
-}
-
-void CLogFailSafe::RollCurrentLog()
-{
-    m_Added.Rollover(RolloverExt);
-    m_Cleared.Rollover(RolloverExt);
-}
-
-void CLogFailSafe::SafeRollover()
-{
-    StringBuffer UniqueID;
-    GenerateGUID(UniqueID);
-    UniqueID.append(".log");
-
-    StringBuffer send(m_LogType),recieve(m_LogType);
-
-    send.append("_sending");
-    recieve.append("_recieving");
-    
-    // Rolling over m_Added first is desirable here beccause requests being written to the new tank file before
-    // m_Cleared finishes rolling all haven't been sent yet (because the sending thread is here busy rolling).
-    m_Added.SafeRollover(m_logsdir.str(),UniqueID,send.str(), RolloverExt);
-    m_Cleared.SafeRollover(m_logsdir.str(),UniqueID,recieve.str(), RolloverExt);
-}
-
-void CLogFailSafe::RollOldLogs()
-{
-    StringBuffer filesToFind;
-    filesToFind.appendf("%s*.log",m_LogType.str());
-
-    DBGLOG("Rolling files of type %s",filesToFind.str());
-    Owned<IDirectoryIterator> di = createDirectoryIterator(m_logsdir.str(), filesToFind.str());
-
-    ForEach (*di)
-    {
-        IFile &file = di->query();
-        StringBuffer fileName;
-
-        ExtractFileName(file.queryFilename(),fileName);
-
-        DBGLOG("File Name:%s",fileName.str());
-        
-        //const char* fileNameStr = strstr(file.queryFilename(),"\\")+1;
-
-        if (fileName.length() && strcmp(fileName.str(),m_Added.queryFileName()) != 0 &&  strcmp(fileName.str(),m_Cleared.queryFileName()) != 0 )
-        {
-
-            DBGLOG("Rolling file:%s",fileName.str());
-            fileName.replaceString(".log",".old");
-            file.rename(fileName.str());
-        }
-    }
-}
-
-StringBuffer& CLogFailSafe::ExtractFileName(const char* fileName,StringBuffer& FileName)
-{
-    StringBuffer tmp(fileName);
-    for(int i = tmp.length() - 1; i >=0; i--)
-    {
-        if(tmp.charAt(i) == '\\' || tmp.charAt(i) == '/')
-            break;
-        FileName.insert(0,tmp.charAt(i));
-    }
-    return FileName;
-}

+ 0 - 88
esp/clients/LoggingClient/LogFailSafe.hpp

@@ -1,88 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-
-// LogFailSafe.h: interface for the CLogFailSafe class.
-//
-//////////////////////////////////////////////////////////////////////
-#pragma warning (disable : 4786)
-#ifndef _LOGFAILSAFE_HPP__
-#define _LOGFAILSAFE_HPP__
-
-#ifdef LOGGINGCLIENT_EXPORTS
-    #define WSLOGFAILSAFE_API DECL_EXPORT
-#else
-    #define WSLOGFAILSAFE_API DECL_IMPORT
-#endif
-
-
-#include "jlib.hpp"
-#include "jstring.hpp"
-#include "jutil.hpp" // for StringArray
-#include "LogSerializer.hpp"
-
-
-interface ILogFailSafe : IInterface
-{
-    virtual void Add(const char*,IInterface& pIn)=0;
-    virtual StringBuffer& GenerateGUID(StringBuffer& GUID,const char* seed="") = 0;
-    virtual void AddACK(const char* GUID)=0;
-    virtual void RollCurrentLog()=0;
-    virtual void RollOldLogs()=0;
-    virtual bool FindOldLogs() = 0;
-    virtual void LoadOldLogs(StringArray& oldLogData) = 0;
-    virtual void SplitLogRecord(const char* requestStr,StringBuffer& GUID, StringBuffer& Cache)=0;
-    virtual void SafeRollover() = 0;
-};
-
-extern "C" WSLOGFAILSAFE_API ILogFailSafe * createFailsafelogger(const char* logType="", const char* logsdir="./logs");
-
-//MORE: This should probably be in the cpp file
-class CLogFailSafe : implements ILogFailSafe, public CInterface
-{
-    CLogSerializer m_Added;
-    CLogSerializer m_Cleared;
-    static CLogFailSafe* m_Instance;
-    StringBuffer m_LogType;
-    StringArray m_UnsentLogs;
-    StringBuffer m_logsdir;
-
-private:
-    void createNew(const char* logType);
-    void loadFailed(const char* logType);
-    StringBuffer& getRecieveFileName(const char* sendFileName, StringBuffer& recieveName);
-    StringBuffer& ExtractFileName(const char* fileName,StringBuffer& FileName);
-public:
-    IMPLEMENT_IINTERFACE;
-    CLogFailSafe();
-    CLogFailSafe(const char* logType, const char* logsdir);
-    
-    virtual ~CLogFailSafe();
-    StringBuffer& GenerateGUID(StringBuffer& GUID,const char* seed="");
-    virtual void Add(const char*,IInterface& pIn);
-    virtual void AddACK(const char* GUID);
-    virtual void RollCurrentLog();
-    virtual void RollOldLogs();
-    virtual bool FindOldLogs();
-    virtual void LoadOldLogs(StringArray& oldLogData);
-    virtual void SplitLogRecord(const char* requestStr,StringBuffer& GUID, StringBuffer& Cache);
-
-    virtual void SafeRollover();
-    
-};
-
-#endif // !_LOGFAILSAFE_HPP__

+ 0 - 359
esp/clients/LoggingClient/LogSerializer.cpp

@@ -1,359 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-// LogSerializer.cpp: implementation of the CLogSerializer class.
-//
-//////////////////////////////////////////////////////////////////////
-#pragma warning(disable : 4786)
-#include "LogSerializer.hpp"
-#include "jexcept.hpp"
-#include "jfile.hpp"
-#include "jlog.hpp"
-
-#define TRACE_INTERVAL 100
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CLogSerializer::CLogSerializer()
-{
-    Init();
-}
-
-CLogSerializer::CLogSerializer(const char* fileName)  
-{
-    m_FilePath.append(fileName);
-    Init();
-}
-void CLogSerializer::Init()
-{
-    m_bytesWritten  = 0;
-    m_ItemCount     = 0;
-    m_fileio        = 0;
-    m_file          = 0;
-}
-
-CLogSerializer::~CLogSerializer()
-{
-    DBGLOG("CLogSerializer::~CLogSerializer()");
-    Close();
-}
-
-void CLogSerializer::Append(const char* GUID, const char* Data)
-{
-    //DBGLOG("Appening GUID %s with data %s",GUID,Data);
-    CriticalBlock b(crit);
-    m_ItemCount++;
-
-    StringBuffer toWrite,size;
-    
-    toWrite.appendf("%s\t%s\r\n",GUID,Data);
-    size.appendf("%d",toWrite.length());
-    while (size.length() < 8)
-        size.insert(0,'0');
-
-    size.append("\t");
-    toWrite.insert(0,size.str());
-    m_bytesWritten += m_fileio->write(m_bytesWritten, toWrite.length(), toWrite.str());
-}
-
-
-
-void CLogSerializer::Remove(const char* GUID)
-{
-
-
-}
-
-void CLogSerializer::Open(const char*Directory,const char* NewFileName,const char* Prefix)
-{
-    m_FilePath.clear();
-    m_FilePath.append(Directory);
-    if (!EnsureDirectory(m_FilePath))
-        throw MakeStringException(-1,"Unable to create directory at %s.",m_FilePath.str());
-
-
-    m_FilePath.append("/");
-
-    m_FileName.clear();
-    m_FileName.append(Prefix);
-    m_FileName.append("_");
-    m_FileName.append(NewFileName);
-
-    m_FilePath.append(m_FileName);
-    
-    DBGLOG("Creating tank file %s", m_FilePath.str());
-    m_file = createIFile(m_FilePath.str());
-    m_fileio  =  m_file->open(IFOcreate);
-    if (m_fileio == 0)
-        throw MakeStringException(-1, "Unable to open logging file %s",m_FilePath.str());
-    else
-        DBGLOG("Tank file %s successfully created", m_FilePath.str());
-
-}
-
-bool CLogSerializer::EnsureDirectory(StringBuffer& Dir)
-{
-    try{
-        Owned<IFile> pDirectory = createIFile(Dir.str());
-        if(pDirectory->exists() == true)
-            return true;
-        return pDirectory->createDirectory();
-    }
-    catch(IException *ex)
-    {
-        ex->Release();
-    }
-    return false;
-}
-
-void CLogSerializer::Close()
-{   
-    if(m_fileio)
-    {
-        m_fileio->Release();
-        m_fileio = 0;
-    }
-
-    if(m_file)
-    {
-        m_file->Release();
-        m_file = 0;
-    }
-
-}
-
-void CLogSerializer::Rollover(const char* ClosedPrefix)
-{
-    Close();
-    Owned<IFile> file = createIFile(m_FilePath.str()); 
-    if(file.get() && file->exists() == true)
-    {
-        StringBuffer newFileName;
-        GetRolloverFileName(m_FileName,newFileName,ClosedPrefix);
-        DBGLOG("Rolling over %s to %s", m_FilePath.str(), newFileName.str());
-        file->rename(newFileName.str());
-    }
-
-}
-
-void CLogSerializer::SafeRollover(const char*Directory,const char* NewFileName,const char* Prefix, const char* ClosedPrefix)
-{
-    CriticalBlock b(crit);
-    Rollover(ClosedPrefix);
-    Init();
-    Open(Directory, NewFileName, Prefix);
-}
-
-StringBuffer& CLogSerializer::GetRolloverFileName(StringBuffer& oldFile, StringBuffer& newfile, const char* newExtension)
-{
-    newfile.append(oldFile);
-    newfile.replaceString("log",newExtension);
-    return newfile;
-}
-
-void CLogSerializer::Remove()
-{
-    Close();
-    Owned<IFile> file = createIFile(m_FilePath.str()); 
-    if(file.get() && file->exists() == true)
-        file->remove();
-}
-
-__int64 CLogSerializer::WroteBytes()
-{
-    CriticalBlock b(crit);
-    return m_bytesWritten;
-}
-
-
-void CSendLogSerializer::LoadDataMap(GuidMap& ACKMap,StringArray& MissedLogs)
-{
-    DBGLOG("Loading missed logs, if any");
-    try{
-        m_file = createIFile(m_FilePath.str());
-        m_fileio = m_file->open(IFOread);
-        if (m_fileio == 0)
-            throw MakeStringException(-1, "Unable to open logging file %s",m_FilePath.str());
-        else
-            DBGLOG("File %s successfully opened", m_FilePath.str());
-
-        long finger,bytesRead;
-        finger = bytesRead = 0;
-
-        bool bOk = true;
-        MemoryBuffer dataSize,data;
-        StringBuffer GUID,lostlogStr;
-        int dataLen;
-        unsigned int total = 0;
-        unsigned int total_missed = 0;
-        while(bOk)
-        {
-            bytesRead = m_fileio->read(finger,8,dataSize.reserveTruncate(8));
-            if(bytesRead==0)
-                break;
-
-            finger+=9;
-            dataLen = atoi(dataSize.toByteArray());
-
-            bytesRead = m_fileio->read(finger,dataLen,data.reserveTruncate(dataLen));
-            if(bytesRead==0)
-                break;
-            LoadMap(data,GUID,lostlogStr);
-            if(total % TRACE_INTERVAL == 0)
-            {
-                DBGLOG("Checking log #%u", total);
-                DBGLOG("{%s}", GUID.str());
-            }
-            total++;
-            int i = MissedLogs.find(lostlogStr.str());
-            if (!(*(ACKMap[GUID.str()].c_str())) && MissedLogs.find(lostlogStr.str()) == -1)
-            {
-                if(total_missed % TRACE_INTERVAL == 0)
-                {
-                    DBGLOG("Miss #%u", total_missed);
-                    DBGLOG("<%s>", GUID.str());
-                }
-                MissedLogs.append(lostlogStr.str());
-                total_missed++;
-            }
-            finger+=dataLen;
-            data.clear();
-            dataSize.clear();
-            GUID.clear();
-            lostlogStr.clear();
-        }
-        DBGLOG("Total logs checked %u, total missed %u", total, total_missed);
-    }
-    catch(IException* ex)
-    {
-        StringBuffer errorStr;
-        ex->errorMessage(errorStr);
-        ERRLOG("Exception caught within CSendLogSerializer::LoadDataMap: %s",errorStr.str());
-        ex->Release();
-    }
-    catch(...){
-        DBGLOG("Unknown Exception thrown in CSendLogSerializer::LoadDataMap");
-    }
-    Close();
-}
-
-void CSendLogSerializer::LoadMap(MemoryBuffer& rawdata,StringBuffer& GUID, StringBuffer& line)
-{
-    //StringBuffer line;
-    line.append(rawdata.length() -1, rawdata.toByteArray());
-    const char* strLine = line.str();
-    while(*strLine && *strLine != '\t' && *strLine != '\0')
-    {
-        GUID.append(*strLine);
-        strLine++;
-    }
-}
-
-void SplitRecord(const char*  strLine, StringBuffer& GUID, StringBuffer& Cache)
-{
-    if(strLine==NULL || *strLine=='\0')
-        return;
-
-    while(*strLine && *strLine != '\t' && *strLine != '\0')
-    {
-        GUID.append(*strLine);
-        strLine++;
-    }
-    strLine++;
-    Cache.appendf("%s",strLine);
-}
-
-void CRecieveLogSerializer::LoadMap(MemoryBuffer& rawdata,GuidMap& GUIDmap, bool printTrace)
-{
-    //buffer chould be in the form of 000000030\t2515777767.12_11_03_08_25_29\r
-    //we want to extract the GUID only....
-    StringBuffer line,GUID;
-    line.append(rawdata.length() -1, rawdata.toByteArray());
-    const char* strLine = line.str();
-    while(*strLine && *strLine != '\t' && *strLine != '\0')
-    {
-        GUID.append(*strLine);
-        strLine++;
-    }
-    if(printTrace)
-        DBGLOG("[%s]", GUID.str());
-    GUIDmap[GUID.str()] = "1";
-}
-
-
-
-void CRecieveLogSerializer::LoadDataMap(GuidMap& GUIDmap)
-{
-    DBGLOG("Loading ACKMap");
-    try{
-        m_file = createIFile(m_FilePath.str());
-        m_fileio = m_file->open(IFOread);
-        if (m_fileio == 0)
-            throw MakeStringException(-1, "Unable to open logging file %s",m_FilePath.str());
-        else
-            DBGLOG("File %s successfully opened", m_FilePath.str());
-
-        long finger,bytesRead,dataLen;
-        finger = bytesRead = dataLen = 0;
-
-        MemoryBuffer filecontents,dataSize,data;
-
-        bool bOk = true;
-        unsigned int total = 0;
-        while(bOk)
-        {
-            bytesRead = m_fileio->read(finger,8,dataSize.reserveTruncate(8));
-            if(bytesRead==0)
-                break;
-
-            finger+=9;
-            dataLen = atoi(dataSize.toByteArray());
-
-            bytesRead = m_fileio->read(finger,dataLen,data.reserveTruncate(dataLen));
-            if(bytesRead==0)
-                break;
-            bool printTrace = false;
-            if(total % TRACE_INTERVAL == 0)
-            {
-                DBGLOG("Loading ack #%u", total);
-                printTrace = true;
-            }
-            LoadMap(data,GUIDmap,printTrace);
-            total++;
-
-            finger+=dataLen;
-            data.clear();
-            dataSize.clear();
-        }
-        DBGLOG("Total acks loaded %u", total);
-    }
-    catch(IException* ex)
-    {
-        StringBuffer errorStr;
-        ex->errorMessage(errorStr);
-        ERRLOG("Exception caught within CRecieveLogSerializer::LoadDataMap: %s",errorStr.str());
-        ex->Release();
-    }
-    catch(...){
-        DBGLOG("Unknown Exception thrown in CRecieveLogSerializer::LoadDataMap");
-    }
-    Close();
-}
-
-

+ 0 - 98
esp/clients/LoggingClient/LogSerializer.hpp

@@ -1,98 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-// LogSerializer.h: interface for the CLogSerializer class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#ifndef _LOGSERIALIZER_HPP__
-#define _LOGSERIALIZER_HPP__
-
-#include "jlib.hpp"
-#include "jstring.hpp"
-#include "jutil.hpp" // for StringArray
-#include "jmutex.hpp"
-#include   <map>
-#include   <string>
-
-
-typedef std::map<std::string, std::string> GuidMap;
-
-
-
-class CLogSerializer : public CInterface  
-{
-    long m_ItemCount;
-    __int64 m_bytesWritten;
-    CriticalSection crit;
-protected:
-    IFile* m_file;
-    IFileIO* m_fileio;
-    StringBuffer m_FileName;
-    StringBuffer m_FilePath;
-protected:
-    __int64 WroteBytes();
-    void Init();
-    StringBuffer& GetRolloverFileName(StringBuffer& oldFile, StringBuffer& newfile, const char* newExtension);
-public:
-    bool EnsureDirectory(StringBuffer& Dir);
-public:
-    CLogSerializer();
-    CLogSerializer(const char* fileName);
-    virtual ~CLogSerializer();
-    void Open(const char* Directory,const char* NewFileName,const char* Prefix);
-    void Close();
-    void Remove();
-    void Rollover(const char* ClosedPrefix);
-    void Append(const char* GUID, const char* Data);
-    void Remove(const char* GUID);
-    virtual void SplitRecord(StringBuffer& FullStr, StringBuffer& GUID, StringBuffer& Cache){}
-    const char* queryFileName(){return m_FileName.str();};
-    const char* queryFilePath(){return m_FilePath.str();};
-
-    void SafeRollover(const char* Directory,const char* NewFileName,const char* Prefix, const char* ClosedPrefix);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-//
-//////////////////////////////////////////////////////////////////////////////
-class CSendLogSerializer : public CLogSerializer  
-{
-public:
-    CSendLogSerializer();
-    CSendLogSerializer(const char* fileName) : CLogSerializer(fileName)
-    {
-    }
-    virtual void LoadDataMap(GuidMap& ACKMap,StringArray& MissedLogs);
-    void LoadMap(MemoryBuffer& rawdata,StringBuffer& GUID, StringBuffer& data);
-};
-
-void SplitRecord(const char* FullStr, StringBuffer& GUID, StringBuffer& Cache);
-
-///////////////////////////////////////////////////////////////////////////////
-//
-//////////////////////////////////////////////////////////////////////////////
-class CRecieveLogSerializer : public CLogSerializer  
-{
-public:
-    CRecieveLogSerializer();
-    CRecieveLogSerializer(const char* fileName) : CLogSerializer(fileName){}
-    virtual void LoadDataMap(GuidMap& GUIDmap);
-    void LoadMap(MemoryBuffer& data,GuidMap& GUIDmap, bool printTrace = false);
-};
-
-#endif // !LOGSERIALIZER

File diff suppressed because it is too large
+ 0 - 1322
esp/clients/LoggingClient/LogThread.cpp


+ 0 - 276
esp/clients/LoggingClient/LogThread.h

@@ -1,276 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-#pragma warning (disable : 4786)
-// LogThread.h: interface for the CLogThread class.
-//
-//////////////////////////////////////////////////////////////////////
-#ifndef _LOGTHREAD_HPP__
-#define _LOGTHREAD_HPP__
-
-#ifdef LOGGINGCLIENT_EXPORTS
-    #define WSLOGThread_API DECL_EXPORT
-#else
-    #define WSLOGThread_API DECL_IMPORT
-#endif
-
-#include "jthread.hpp"
-#include "esploggingservice.hpp"
-#include "esp.hpp"
-#include "jqueue.tpp"
-#include "LogFailSafe.hpp"
-#include "esploggingservice_esp.ipp"
-
-interface IClientLogThread : extends IInterface
-{
-    virtual void start() = 0;
-    virtual void finish() = 0;
-    virtual void setTreeFlattening(bool bFlattenTree) = 0;
-    virtual bool queueLog(const char *user, const char *relm, const char *peer, const char* serviceName, const char* GUID, int RecordsReturned, IPropertyTree& logInfo) = 0;
-    virtual bool queueLog(IEspContext & context,const char* serviceName,const char* GUID, int RecordsReturned, IPropertyTree& logInfo) = 0;
-    virtual bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned, StringBuffer& logInfo) = 0;
-    virtual bool queueLog(IEspContext & context,const char* serviceName, const char* request, const char* response) = 0;
-    virtual bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned, IInterface& logInfo) = 0;
-    virtual bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned,  IArrayOf<IEspLogInfo>& LogArray, StringBuffer& logInfo)=0;
-    virtual bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned,bool bBlind,bool bEncrypt, IArrayOf<IEspLogInfo>& LogArray, IInterface& logInfo, IConstModelLogInformation* pModelLogInfo=0)=0; 
-    virtual bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned, IArrayOf<IEspLogInfo>& LogArray) = 0;
-    virtual IClientLogInfo& addLogInfoElement(IArrayOf<IEspLogInfo>& LogArray) = 0;
-    
-    virtual IClientModelLogInformation& getModelLogInformation() = 0;
-    virtual IClientModelLogInfo& getModelLogInfo(IClientModelLogInformation* pModelLogInformation) = 0;
-    virtual IClientAttributeGroupLogInfo& getAttributeGroupLogInfo(IClientModelLogInformation* pModelLogInformation) = 0;
-    virtual IClientAttributeLogInfo& getAttributeLogInfo(IClientAttributeGroupLogInfo* pAttributeGroupLogInfo) = 0;
-    virtual IClientScoreLogInfo& getScoreLogInfo(IClientModelLogInfo* pModelLogInfo) = 0;
-    virtual IClientReasonCodeLogInfo& getReasonCodeLogInfo(IClientScoreLogInfo* pScoreLogInfo) = 0;
-
-    virtual bool IsModelLogging()=0;
-    virtual bool logResponseXml()=0;
-
-    virtual bool GenerateTransactionSeed(StringBuffer& UniqueID,char backendType)=0;
-};
-
-extern "C" WSLOGThread_API IClientLogThread * createLogClient(IPropertyTree *cfg, const char *process, const char *service,bool bFlatten = true);
-extern "C" WSLOGThread_API IClientLogThread * createLogClient3(IPropertyTree *logcfg, const char *service, bool bFlatten = true);
-extern "C" WSLOGThread_API IClientLogThread * createLogClient2(IPropertyTree *cfg, const char *process, const char *service, const char* name, bool bFlatten = true, bool bModelRequest = false);
-extern "C" WSLOGThread_API IClientLogThread * createModelLogClient(IPropertyTree *cfg, const char *process, const char *service,bool bFlatten = true);
-
-
-struct LOG_INFO
-{
-    const char* serviceName;
-    int recordsReturned;
-    bool Blind;
-    bool Encrypt;
-    const char* GUIDSeed;
-    StringBuffer GUID;
-    StringBuffer RequestStr;
-    void init() { memset(this, 0, sizeof(LOG_INFO)); }
-    LOG_INFO() { init(); }
-    LOG_INFO(const char* _seviceName, int _recordsReturned, bool _blind)
-    {
-        init();
-        serviceName=_seviceName;
-        recordsReturned=_recordsReturned;
-        Blind=_blind;
-    }
-    LOG_INFO(const char* _seviceName,const char* _GUID, int _recordsReturned, bool _blind)
-    {
-        init();
-        serviceName=_seviceName;
-        recordsReturned=_recordsReturned;
-        Blind=_blind;
-        GUIDSeed=_GUID;
-    }
-    LOG_INFO(const char* _GUID) 
-    { 
-        init(); 
-        GUID.appendf("%s",_GUID);
-    }
-};
-
-class CPooledLogSendingThread : public CInterface, implements IPooledThread
-{
-private:
-    void * m_request;
-public:
-    IMPLEMENT_IINTERFACE;
-
-    virtual void main()
-    {
-        CClientWsLogService::espWorkerThread((void *)(IRpcRequestBinding *)(m_request));
-    }
-    virtual bool stop()
-    {
-        return true;
-    }
-    virtual void init(void *param)
-    {
-        m_request = param;
-    }
-
-    virtual bool canReuse() { return false;}
-};
-
-class CLogSendingThreadPoolFactory : public CInterface, implements IThreadFactory
-{
-public:
-    IMPLEMENT_IINTERFACE;
-
-    virtual IPooledThread *createNew()
-    {
-        return new CPooledLogSendingThread();
-    }
-};
-
-class CPooledClientWsLogService : public CClientWsLogService
-{
-private:
-    Owned<CLogSendingThreadPoolFactory> m_pool_factory;
-    Owned<IThreadPool> m_thread_pool;
-    int m_poolsize;
-
-public: 
-    CPooledClientWsLogService(int poolsize) : CClientWsLogService(),
-        m_pool_factory(new CLogSendingThreadPoolFactory()),
-        m_poolsize(poolsize),
-        m_thread_pool(createThreadPool("LoggingThreads", m_pool_factory, NULL, poolsize, 10000))
-    {
-        if(poolsize <= 0)
-            throw MakeStringException(-1, "Thread pool size must be a positive integer");
-    }
-
-    virtual void async_UpdateLogService(IClientLOGServiceUpdateRequest *request, IClientWsLogServiceEvents *events,IInterface* state);
-};
-
-class WSLOGThread_API CLogThread : public Thread , implements IClientLogThread , implements IClientWsLogServiceEvents
-{
-    CriticalSection crit;
-    CriticalSection seed_gen_crit;
-
-    Owned<IClientWsLogService> m_pLoggingService;
-    Owned<ILogFailSafe> m_LogFailSafe;
-    SafeQueueOf<IClientLOGServiceUpdateRequest, false> m_pServiceLog;
-
-    Semaphore       m_sem;
-    Semaphore       m_SenderSem;
-    StringBuffer    m_ServiceURL;
-    bool m_bRun;
-    bool m_bFlattenTree;
-    bool m_bFailSafeLogging;
-    bool m_bThrottle;
-    int m_Logcount;
-    int m_LogSend;
-    int m_LogTreshhold;
-    int m_LogSendDelta;
-    int m_MaxLogQueueLength;
-    int m_SignalGrowingQueueAt;
-    int m_BurstWaitInterval;
-    int m_LinearWaitInterval;
-    int m_NiceLevel;
-    int m_ThreadPoolSize;
-
-    unsigned int id_counter;
-    StringBuffer m_InitialTransactionSeedID;
-    bool bSeedAvailable;
-    bool bMadeSeedRequest;
-    bool m_bModelRequest;
-    bool m_logResponse;
-
-    struct tm         m_startTime;
-
-private:    
-    void addLogInfo(IArrayOf<IEspLogInfo>& valueArray,IPropertyTree& logInfo);
-    void deserializeLogInfo(IArrayOf<IEspLogInfo>& valueArray,IPropertyTree& logInfo);
-    void CheckErrorLogs();
-    void SendLog();
-    bool queueLog(IClientLOGServiceUpdateRequest* pRequest,LOG_INFO& _LogStruct);
-    bool queueLog(const char *user, const char *realm, const char *peer, LOG_INFO& _LogStruct ,  IArrayOf<IEspLogInfo>& LogArray);
-
-    StringBuffer& serializeRequest(IEspContext& ctx,IInterface& logInfo, StringBuffer& returnStr);
-    IClientLOGServiceUpdateRequest* DeserializeRequest(const char* requestStr, LOG_INFO& _Info);
-    void setTreeFlattening(bool bFlattenTree){m_bFlattenTree=bFlattenTree;};
-    bool getTreeFlattening(){return m_bFlattenTree;};
-    bool FlattenTree(IArrayOf<IEspLogInfo>& valueArray,IPropertyTree& tree,StringBuffer& Name);
-    bool FlattenArray(IArrayOf<IEspLogInfo>& valueArray,IPropertyTree& tree,StringBuffer& Name);
-    bool IsArray(IPropertyTree& tree);
-    void HandleLoggingServerResponse(IClientLOGServiceUpdateRequest* Request,IClientLOGServiceUpdateResponse *Response);
-
-    virtual int onUpdateLogServiceComplete(IClientLOGServiceUpdateResponse *resp,IInterface* state);
-    virtual int onUpdateLogServiceError(IClientLOGServiceUpdateResponse *resp,IInterface* state);
-
-    virtual int onUpdateModelLogServiceComplete(IClientLOGServiceUpdateResponse *resp,IInterface* state);
-    virtual int onUpdateModelLogServiceError(IClientLOGServiceUpdateResponse *resp,IInterface* state);
-
-    virtual int onTransactionSeedComplete(IClientTransactionSeedResponse *resp,IInterface* state){return -1;}
-    virtual int onTransactionSeedError(IClientTransactionSeedResponse *resp,IInterface* state){return -1;}
-
-
-    bool queueLog(IEspContext & context,LOG_INFO& _InfoStruct,  IArrayOf<IEspLogInfo>& LogArray, IPropertyTree& logInfo);
-    bool queueLog(IEspContext & context,LOG_INFO& _InfoStruct,  IArrayOf<IEspLogInfo>& LogArray, IConstModelLogInformation* pModelLogInfo=0);
-
-    bool FetchTransactionSeed(StringBuffer& TransactionSeedID);
-    void UnserializeModelLogInfo(IPropertyTree* pModelTreeInfo,IClientModelLogInformation* pModelLogInformation);
-    void checkRollOver();
-public:
-    IMPLEMENT_IINTERFACE;
-    CLogThread();
-    CLogThread(IPropertyTree* pServerConfig,  const char* Service, bool bFlatten = true, bool bModelRequest = false);
-    virtual ~CLogThread();
-    int run();
-    void start();
-    void finish();
-    bool queueLog(const char *user, const char *relm, const char *peer, LOG_INFO& _InfoStruct, StringBuffer& logInfo);
-    bool queueLog(const char *user, const char *relm, const char *peer, const char* serviceName, const char* GUID, int RecordsReturned, IPropertyTree& logInfo);
-
-
-    bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned, StringBuffer& logInfo);
-    bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned, const char* logInfo);
-
-    bool queueLog(IEspContext & context,const char* serviceName, const char* request, const char* response);
-
-    bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned, IInterface& logInfo);
-    bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned, IPropertyTree& logInfo);
-    bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned, IArrayOf<IEspLogInfo>& LogArray, IInterface& logInfo);
-    bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned,bool bBlind, bool bEncrypt , IArrayOf<IEspLogInfo>& LogArray, IInterface& logInfo, IConstModelLogInformation* pModelLogInfo=0);
-    
-
-    bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned,IArrayOf<IEspLogInfo>& LogArray, IPropertyTree& logInfo);
-
-    bool queueLog(IEspContext & context,const char* serviceName,const char* GUID, int RecordsReturned, IPropertyTree& logInfo);
-
-
-
-    bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned, IArrayOf<IEspLogInfo>& LogArray);
-    bool queueLog(IEspContext & context,const char* serviceName,int RecordsReturned, IArrayOf<IEspLogInfo>& LogArray, StringBuffer& logInfo);
-
-    IClientLogInfo& addLogInfoElement(IArrayOf<IEspLogInfo>& LogArray);
-    virtual bool GenerateTransactionSeed(StringBuffer& UniqueID,char backendType);
-
-    virtual IClientModelLogInformation& getModelLogInformation();
-    virtual IClientModelLogInfo& getModelLogInfo(IClientModelLogInformation* pIModelLogInformation);
-    virtual IClientAttributeGroupLogInfo& getAttributeGroupLogInfo(IClientModelLogInformation* pIModelLogInformation);
-    virtual IClientAttributeLogInfo& getAttributeLogInfo(IClientAttributeGroupLogInfo* pAttributeGroupLogInfo);
-    virtual IClientScoreLogInfo& getScoreLogInfo(IClientModelLogInfo* pModelLogInfo);
-    virtual IClientReasonCodeLogInfo& getReasonCodeLogInfo(IClientScoreLogInfo* pScoreLogInfo);
-    virtual bool IsModelLogging();
-    virtual bool logResponseXml() {  return m_logResponse; }
-
-    void CleanQueue();
-};
-
-#endif // _LOGTHREAD_HPP__
-

+ 0 - 36
esp/clients/LoggingClient/loggingserviceclient.cpp

@@ -1,36 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-#pragma warning (disable : 4786)
-#ifdef LOGGINGCLIENT_EXPORTS
-    #define WSLOG_API DECL_EXPORT
-#else
-    #define WSLOG_API DECL_IMPORT
-#endif
-
-#include "jliball.hpp"
-#include "esploggingservice.hpp"
-#include "esploggingservice_esp.ipp"
-
-// already defined in generated code 
-/*
-extern WSLOG_API IClientWsLogService * createWsLogServiceClient()
-{
-    DBGLOG("Entering createWsLogServiceClient(...)\n");
-    return new CClientWsLogService();
-}
-*/

+ 0 - 42
esp/clients/LoggingClient/loggingserviceclient.hpp

@@ -1,42 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-#ifndef _LOGGINGSERVICECLIENT_HPP__
-#define _LOGGINGSERVICECLIENT_HPP__
-
-//#include "loggingservicelib.hpp"
-//#include "loggingserviceesp.hpp"
-
-
-
-class CClientLoggingservice : public CInterface,
-   implements IClientLoggingService
-{
-private:
-   char m_url[256];
-public:
-    IMPLEMENT_IINTERFACE;
-    CClientLoggingservice();
-    virtual ~CClientLoggingservice();
-//interface IClientDataProxy
-    void addServiceUrl(const char * url);
-    void removeServiceUrl(const char * url);
-    IClientServiceLogRequest * CreateServiceLogRequest();
-    IClientServiceLogResp * GetServiceLogResponse(IClientServiceLogRequest & request);
-};
-
-#endif

+ 0 - 26
esp/clients/LoggingClient/sourcedoc.xml

@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-################################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-################################################################################
--->
-<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
-<section>
-    <title>esp/clients/LoggingClient</title>
-
-    <para>
-        The esp/clients/LoggingClient directory contains the sources for the esp/clients/LoggingClient library.
-    </para>
-</section>

+ 0 - 1
esp/logging/loggingagent/cassandraloggingagent/cassandralogagent.cpp

@@ -16,7 +16,6 @@
 ############################################################################## */
 
 #include "LoggingErrors.hpp"
-#include "esploggingservice_esp.ipp"
 #include "cassandralogagent.hpp"
 
 static const int defaultMaxTriesGTS = -1;

+ 0 - 1
esp/logging/logginglib/loggingagentbase.cpp

@@ -16,7 +16,6 @@
 ############################################################################## */
 
 #include "LoggingErrors.hpp"
-#include "esploggingservice_esp.ipp"
 #include "loggingagentbase.hpp"
 
 static const char* const defaultTransactionTable = "transactions";

+ 0 - 129
esp/scm/esploggingservice.ecm

@@ -1,129 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-//  ===========================================================================
-ESPStruct LogInfo
-{
-    string Name;
-    string Value;
-    string Data;
-};
-
-////////////////////////////////////////////////////////////
-
-ESPstruct ReasonCodeLogInfo
-{
-    string Value;
-    int Sequence;
-    string Description;
-};
-
-ESPstruct ScoreLogInfo
-{
-    string Name;
-    int Value;
-    int LogIdentifier;
-    int Sequence;
-    ESParray<ESPstruct ReasonCodeLogInfo, ReasonCode> ReasonCodes;
-};
-
-ESPstruct AttributeLogInfo
-{
-    string Name;
-    string Value;
-};
-
-ESPstruct AttributeGroupLogInfo 
-{
-    string Name;
-    int LogIdentifier;
-    ESParray<ESPstruct AttributeLogInfo, Attribute> Attributes;
-};
-
-ESPstruct ModelLogInfo
-{
-    string Name;
-    ESParray<ESPstruct ScoreLogInfo, Score> Scores;
-};
-
-
-ESPstruct ModelLogInformation
-{
-    ESParray<ESPstruct ModelLogInfo, Model> Models;
-    ESParray<ESPstruct AttributeGroupLogInfo, AttributeGroup> AttributeGroups;
-};
-
-
-ESPrequest
-[
-
-]
-LOGServiceUpdateRequest
-{
-    string ServiceName;
-    string UserName;
-    string DomainName;
-    string IP;
-    int RecordCount;
-    string GUID;
-    bool BlindLogging;
-    bool EncryptedLogging;
-    string RawLogInformation;
-    ESParray<ESPstruct LogInfo> LogInformation;
-};
-
-ESPrequest[] LOGServiceUpdateModelRequest : LOGServiceUpdateRequest
-{
-    ESPstruct ModelLogInformation ModelLogInformation;  
-};
-
-
-ESPresponse
-[
-    encode(0),
-    ns_var("")
-] 
-LOGServiceUpdateResponse
-{
-    int UpdateLogStatus;
-    string GUID;
-};
-
-ESPrequest[]
-TransactionSeedRequest
-{
-};
-
-ESPresponse[]
-TransactionSeedResponse
-{
-    string SeedId;
-    bool SeedAvailable;
-};
-
-ESPService [auth_feature("NONE"),noforms] WsLogService
-{
-    ESPuses ESPStruct LogInfo;
-    ESPmethod UpdateLogService(LOGServiceUpdateRequest, LOGServiceUpdateResponse);
-    ESPmethod UpdateModelLogService(LOGServiceUpdateModelRequest, LOGServiceUpdateResponse);
-    ESPmethod TransactionSeed(TransactionSeedRequest,TransactionSeedResponse);
-};
-
-
-SCMexportdef(WSLOG);
-
-SCMapi(WSLOG) IClientWsLogService *createWsLogServiceClient();

+ 0 - 1
esp/scm/espscm.cmake

@@ -30,7 +30,6 @@ set ( ESPSCM_SRCS
       ecllib.ecm
       esp.ecm
       ws_access.ecm
-      esploggingservice.ecm
       soapesp.ecm
       ws_ecl_client.ecm
       ws_fs.ecm