Bläddra i källkod

HPCC-9494 Clean up unused roxiemanager code

Unused component, whcih would likely not work any more because of Roxie
changes.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 år sedan
förälder
incheckning
33cd7c0514

+ 0 - 1
baseaddr.txt

@@ -103,7 +103,6 @@ icudata         0x01300000 0x00810000
 snmputils       0x014A0000 0x00040000
 schedulectrl    0x014E0000 0x00040000
 
-roxiemanager    0x01560000 0x00080000
 roxiecommlib    0x01600000 0x00080000
 
 ; plugins.

+ 0 - 1
common/CMakeLists.txt

@@ -20,7 +20,6 @@ HPCC_ADD_SUBDIRECTORY (fileview2 "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (monitoring "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (remote)
 HPCC_ADD_SUBDIRECTORY (roxiecommlib)
-HPCC_ADD_SUBDIRECTORY (roxiemanager "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (thorhelper)
 HPCC_ADD_SUBDIRECTORY (workunit)
 HPCC_ADD_SUBDIRECTORY (wuwebview "PLATFORM")

+ 0 - 90
common/roxiemanager/CMakeLists.txt

@@ -1,90 +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: roxiemanager 
-#####################################################
-# Description:
-# ------------
-#    Cmake Input File for roxiemanager
-#####################################################
-
-project( roxiemanager ) 
-
-include(${HPCC_SOURCE_DIR}/esp/scm/espscm.cmake)
-
-set (    SRCS 
-         ../../dali/dfu/dfuutil.cpp 
-         ${ESPSCM_GENERATED_DIR}/roxiecommlibscm_esp.cpp 
-         ${ESPSCM_GENERATED_DIR}/roxiemanagerscm_esp.cpp 
-         roxiequerycompiler.cpp 
-         roxiequerymanager.cpp 
-         roxiewuprocessor.cpp 
-                 
-                 roxiemanager.hpp
-                 roxiequerycompiler.hpp
-                 roxiewuprocessor.hpp
-                 
-                ${HPCC_SOURCE_DIR}/esp/scm/roxiemanagerscm.ecm
-    )
-
-include_directories ( 
-         ./../../system/security/shared
-         ./../../common/remote 
-         ./../../system/mp 
-         ./../../common/workunit 
-         ./../../dali/dfu 
-         ./../../common/environment 
-         ./../../roxie/roxie
-         ./../../roxie/ccd
-         ./../../common/fileview2 
-         ./../../system/include 
-         ./../../dali/base 
-         ./../../rtl/include 
-         ./../../common/dllserver 
-         ./../../system/xmllib
-         ./../../esp/clients 
-         ./../../esp/platform 
-         ./../../esp/bindings 
-         ./../../esp/bindings/SOAP/xpp 
-         ./../../system/jlib 
-         ./../../rtl/eclrtl 
-    )
-
-ADD_DEFINITIONS( -D_USRDLL -DROXIEMANAGER_EXPORTS )
-
-HPCC_ADD_LIBRARY( roxiemanager SHARED ${SRCS} )
-add_dependencies( roxiemanager espscm )
-install ( TARGETS roxiemanager RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
-target_link_libraries ( roxiemanager
-         jlib 
-         roxiecommlib 
-         mp 
-         hrpc 
-         remote 
-         dalibase 
-         environment 
-         dllserver 
-         nbcd 
-         eclrtl 
-         deftype 
-         workunit 
-         jhtree 
-         hql 
-         fileview2 
-    )
-
-

+ 0 - 50
common/roxiemanager/roxiemanager.hpp

@@ -1,50 +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 ROXIEQUERYMANAGER_INCL
-#define ROXIEQUERYMANAGER_INCL
-
-#ifdef _WIN32
-    #ifdef ROXIEMANAGER_EXPORTS
-        #define ROXIEMANAGER_API __declspec(dllexport)
-    #else
-        #define ROXIEMANAGER_API __declspec(dllimport)
-    #endif
-#else
-    #define ROXIEMANAGER_API
-#endif
-
-#include "roxiemanagerscm.hpp"
-
-#include "errorlist.h"
-
-#define ROXIEMANAGER_IGNORE_EXCEPTION   0   // not a real exception
-
-#define ROXIEMANAGER_UNRESOLVED_FILE    ROXIE_MGR_START
-#define ROXIEMANAGER_MISSING_FILE_PARTS ROXIE_MGR_START+1
-#define ROXIEMANAGER_MISSING_ID         ROXIE_MGR_START+2
-#define ROXIEMANAGER_SOCKET_ERROR       ROXIE_MGR_START+3
-#define ROXIEMANAGER_UNEXPECTION_WU_ERROR ROXIE_MGR_START+4
-#define ROXIEMANAGER_FILE_MISMATCH      ROXIE_MGR_START+5
-#define ROXIEMANAGER_DEPLOY_FAILED      ROXIE_MGR_START+6
-#define ROXIEMANAGER_DALI_LOOKUP_ERROR  ROXIE_MGR_START+7
-#define ROXIEMANAGER_ROD_NOT_SUPPORTED  ROXIE_MGR_START+8
-#define ROXIEMANAGER_FILE_PERMISSION_ERR ROXIE_MGR_START+9
-#define ROXIEMANAGER_FILE_SIZE_ERROR    ROXIE_MGR_START+10
-
-#endif
-

+ 0 - 323
common/roxiemanager/roxiequerycompiler.cpp

@@ -1,323 +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)
-
-#include "jlib.hpp"
-#include "roxiequerycompiler.hpp"
-
-class CRoxieQueryCompileInfo : public CInterface, implements IRoxieQueryCompileInfo
-{
-private:
-    unsigned memoryLimit;
-    unsigned wuTimeOut;
-    unsigned timeLimit;
-    unsigned warnTimeLimit;
-
-    bool poolGraphs;
-    bool highPriority;
-
-    StringBuffer repositoryLabel;
-    StringBuffer moduleName;
-    StringBuffer defaultStyleName;
-    StringBuffer wuDebugOptions;
-
-    StringBuffer userName;
-    StringBuffer password;
-    StringBuffer jobName;
-    StringBuffer ecl;
-    StringBuffer appName;
-    StringBuffer clusterName;
-    int queryPriority;
-
-public:
-    IMPLEMENT_IINTERFACE;
-
-    CRoxieQueryCompileInfo(const char *_ecl, const char *_jobName, const char *_clusterName, const char *_appName)
-        :ecl(_ecl), jobName(_jobName), clusterName(_clusterName)
-    {
-        memoryLimit = 0;
-        wuTimeOut = 0;
-        timeLimit = 0;
-        warnTimeLimit = 0;
-        poolGraphs = false;
-        highPriority = false;
-        queryPriority = UNKNOWN_PRIORITY;
-        
-        if (_appName && *_appName)
-            appName.append(_appName);
-        else
-            appName.append("RoxieManager");
-    }
-
-    virtual void setMemoryLimit(unsigned val) { memoryLimit = val; }
-    virtual unsigned getMemoryLimit() { return memoryLimit; }
-    
-    virtual void setWuTimeOut(unsigned val) { wuTimeOut = val; }
-    virtual unsigned getWuTimeOut() { return wuTimeOut; }
-
-    virtual void setTimeLimit(unsigned val) { timeLimit = val; }
-    virtual unsigned getTimeLimit() { return timeLimit; }
-
-    virtual void setWarnTimeLimit(unsigned val) { warnTimeLimit = val; }
-    virtual unsigned getWarnTimeLimit() { return warnTimeLimit; }
-
-    virtual void setPoolGraphs(bool val) { poolGraphs = val; }
-    virtual bool getPoolGraphs() { return poolGraphs; }
-
-    virtual void setHighPriority(bool val) { highPriority = val; }
-    virtual bool getHighPriority() { return highPriority; }
-
-    virtual void setRepositoryLabel(const char *val) { repositoryLabel.append(val); }
-    virtual const char * queryRepositoryLabel() { return repositoryLabel.str(); }
-
-    virtual void enableWebServiceInfoRetrieval(const char *_moduleName, const char *_defaultStyleName) 
-        { moduleName.append(_moduleName); defaultStyleName.append(_defaultStyleName);}
-
-    virtual void setQueryPriority(int val) { queryPriority = val; }
-    virtual int getQueryPriority() { return queryPriority; }
-
-    virtual void setWuDebugOptions(const char *val) { wuDebugOptions.append(val); }
-    virtual const char * queryWuDebugOptions() { return wuDebugOptions.str(); }
-
-    virtual const char * queryUserId() { return userName.str(); }
-    virtual const char * queryPassword() { return password.str(); }
-    virtual const char * queryJobName() { return jobName.str(); }
-    virtual const char * queryEcl() { return ecl.str(); }
-    virtual const char * queryAppName() { return appName.str(); }
-    virtual const char * queryClusterName() { return clusterName.str(); }
-    virtual const char * queryDefaultStyleName() { return defaultStyleName.str(); }
-    virtual const char * queryModuleName() { return moduleName.str(); }
-};
-
-
-
-
-class CRoxieQueryCompiler : public CInterface, implements IRoxieQueryCompiler
-{
-private:
-    SocketEndpoint ep;
-
-    void processCompilationErrors(IConstWorkUnit *workunit, SCMStringBuffer &errors)
-    {
-        if (workunit->getExceptionCount())
-        {
-            Owned<IConstWUExceptionIterator> exceptions = &workunit->getExceptions();
-            StringArray errorStr;
-            StringArray warnStr;
-            ForEach (*exceptions)
-            {
-                IConstWUException &exception = exceptions->query();
-
-                unsigned exceptCode = exception.getExceptionCode();
-                SCMStringBuffer name;
-                exception.getExceptionFileName(name);
-
-                unsigned lineNo = exception.getExceptionLineNo();
-                unsigned column = exception.getExceptionColumn();
-
-                SCMStringBuffer source, message;
-                exception.getExceptionSource(source);
-                exception.getExceptionMessage(message);
-
-                if (exception.getSeverity() == ExceptionSeverityWarning)
-                {
-                    StringBuffer err;
-                    if ( (lineNo != 0) || (column != 0))
-                        err.appendf("WARNING: %s (%d, %d): %d %s", name.str(), lineNo, column, exceptCode, message.str());
-                    else
-                        err.appendf("WARNING: %s: %d %s", name.str(), exceptCode, message.str());
-                    warnStr.append(err.str());
-                }
-                else if (exception.getSeverity() == ExceptionSeverityError)
-                {
-                    StringBuffer err;
-                    if ( (lineNo != 0) || (column != 0))
-                        err.appendf("ERROR: %s (%d, %d): %d %s", name.str(), lineNo, column, exceptCode, message.str());
-                    else
-                        err.appendf("ERROR: %s: %d %s", name.str(), exceptCode, message.str());
-                    errorStr.append(err.str());
-                }
-            }
-
-            ForEachItemIn(err_idx, errorStr)
-            {
-                const char *err = errorStr.item(err_idx);
-                errors.s.appendf("%s\n", err);
-            }
-
-            ForEachItemIn(warn_idx, warnStr)
-            {
-                const char *err = warnStr.item(warn_idx);
-                errors.s.appendf("%s\n", err);
-            }
-
-            errors.s.appendf("%d error(s),  %d warning(s)\n", errorStr.ordinality(), warnStr.ordinality());
-        }
-    }
-
-public:
-    IMPLEMENT_IINTERFACE;
-
-    CRoxieQueryCompiler()
-    {
-    }
-
-    IConstWorkUnit *createWorkunit(SCMStringBuffer &wuid, const char *userName, const char *queryAppName)
-    {
-        Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
-        Owned<IWorkUnit> workunit = factory->createWorkUnit(NULL, queryAppName, userName);
-        workunit->getWuid(wuid);
-        workunit->setState(WUStateUnknown);
-        workunit->setUser(userName);
-        return workunit.getClear();
-    }
-
-    IConstWorkUnit *compileEcl(SCMStringBuffer &wuid, const char *userName, const char *password, IRoxieQueryCompileInfo &compileInfo, IRoxieQueryProcessingInfo &processingInfo, SCMStringBuffer &status)
-    {
-        Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
-        {
-            Owned<IWorkUnit> workunit;
-            
-            if (wuid.length())
-                workunit.setown(factory->updateWorkUnit(wuid.str()));
-            else
-                workunit.setown(factory->createWorkUnit(NULL, compileInfo.queryAppName(), userName));
-
-            workunit->setDebugValue("RoxieConfigStatus", "Compiling...", true);
-
-            Owned<IWUQuery> query = workunit->updateQuery();
-            query->setQueryText(compileInfo.queryEcl());
-            query->setQueryType(QueryTypeEcl);
-
-            const char *queryJobName = compileInfo.queryJobName();
-            if (queryJobName && *queryJobName)
-                workunit->setJobName(queryJobName);
-
-            workunit->setAction(WUActionCompile);
-            workunit->setUser(userName);
-            workunit->getWuid(wuid);
-
-            // set generic debug options
-            StringBuffer options(compileInfo.queryWuDebugOptions());
-            if (options.length())
-            {
-                Owned<IPropertyTree> dbgOptions = createPTreeFromXMLString(options, ipt_caseInsensitive);
-                Owned<IPropertyTreeIterator> iter = dbgOptions->getElements("Option");
-                ForEach(*iter)
-                {
-                    IPropertyTree &item = iter->query();
-                    const char *name = item.queryProp("@name");
-                    const char *value = item.queryProp("@value");
-                    workunit->setDebugValue(name, value, true);
-                }
-            }
-
-            // set specific debug options
-            workunit->setDebugValueInt("forceRoxie", 1, true);
-            workunit->setDebugValueInt("traceRowXml", 1, true);
-            workunit->setDebugValue("targetClusterType", "roxie", true);
-
-            workunit->setClusterName(compileInfo.queryClusterName()); // MORE - eclserver should not require cluster set for roxy compiles (probably)
-
-            if (compileInfo.getHighPriority())
-                workunit->setPriority(PriorityClassHigh);
-
-            int queryPriority = compileInfo.getQueryPriority();
-            if (queryPriority != UNKNOWN_PRIORITY)  // MORE - if set use queryPriority to set wu priority
-            {
-                workunit->setDebugValueInt("queryPriority", queryPriority, true);
-                if (queryPriority == LOW_PRIORITY)
-                    workunit->setPriority(PriorityClassLow);
-                else
-                    workunit->setPriority(PriorityClassHigh);
-            }
-            else
-            {
-                if (!compileInfo.getHighPriority())
-                    workunit->setDebugValue("queryPriority", "High", true);
-            }
-
-            workunit->setDebugValueInt("memoryLimit", compileInfo.getMemoryLimit(), true);
-            workunit->setDebugValueInt("timeLimit", compileInfo.getTimeLimit(), true);
-            workunit->setDebugValueInt("warnTimeLimit", compileInfo.getWarnTimeLimit(), true);
-            workunit->setDebugValueInt("poolGraphs", compileInfo.getPoolGraphs(), true);
-
-            workunit->setDebugValue("comment", processingInfo.queryComment(), true);
-            workunit->setDebugValue("package", processingInfo.queryPackageName(), true);
-
-            const char *label = compileInfo.queryRepositoryLabel();
-            if (label && *label)
-                workunit->setSnapshot(label);
-        }
-        submitWorkUnit(wuid.str(), userName, password);
-        if (waitForWorkUnitToCompile(wuid.str(), compileInfo.getWuTimeOut()))
-        {
-            IConstWorkUnit *workunit = factory->openWorkUnit(wuid.str(), false);
-            Owned<IWorkUnit> wu = &workunit->lock();
-            SCMStringBuffer jn;
-            wu->getJobName(jn);
-            if (jn.length() == 0)
-            {
-                SCMStringBuffer name;
-                wu->getDebugValue("name", name);
-                if (name.length())
-                    wu->setJobName(name.str());
-                else
-                    wu->setJobName(wuid.str());
-            }
-            processCompilationErrors(workunit, status);
-            return workunit;
-        }
-        else
-        {
-            Owned<IConstWorkUnit> workunit = factory->openWorkUnit(wuid.str(), false);
-            WUState wu_state = workunit->getState();
-
-            // there was a problem, just report it - either compilation problems, eclserver timeout, etc
-            processCompilationErrors(workunit, status);
-            if (!status.length())  // no compilations errors so it must be something else
-            {
-                //StringBuffer errStr;
-                if (wu_state == WUStateCompiling)
-                    status.s.append("Time out trying to compile query - need to increase the wuTimeOut");
-                else
-                {
-                    SCMStringBuffer state;
-                    workunit->getStateDesc(state);
-                    status.s.appendf("Unknown error: Could not compile query - make sure eclserver is running - workunit status = %s", state.str());
-                }
-            }
-            return NULL;
-        }
-    }
-
-};
-
-
-
-IRoxieQueryCompileInfo *createRoxieQueryCompileInfo(const char *_ecl, const char *_jobName, const char *_clusterName, const char *_appName)
-{
-    return new CRoxieQueryCompileInfo(_ecl, _jobName, _clusterName, _appName);
-}
-
-
-IRoxieQueryCompiler *createRoxieQueryCompiler()
-{
-    return new CRoxieQueryCompiler();
-}
-

+ 0 - 42
common/roxiemanager/roxiequerycompiler.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 _ROXIEQUERYCOMPILER_HPP__
-#define _ROXIEQUERYCOMPILER_HPP__
-
-
-interface IConstWorkUnit;
-interface IWorkUnit;
-interface IEmbeddedXslTransformer;
-interface IAttributeMetaDataResolver;
-
-#include "jptree.hpp"
-#include "esp.hpp"
-
-#include "roxiemanager.hpp"
-
-
-interface IRoxieQueryCompiler : extends IInterface
-{
-    virtual IConstWorkUnit *createWorkunit(SCMStringBuffer &wuid, const char *userName, const char *queryAppName) = 0;
-    virtual IConstWorkUnit *compileEcl(SCMStringBuffer &wuid, const char *userName, const char *password, IRoxieQueryCompileInfo &compileInfo, IRoxieQueryProcessingInfo &processingInfo, SCMStringBuffer &status) = 0;
-};
-
-extern IRoxieQueryCompiler *createRoxieQueryCompiler();
-
-#endif
-

+ 0 - 637
common/roxiemanager/roxiequerymanager.cpp

@@ -1,637 +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)
-
-#include "jlib.hpp"
-#include "roxiemanager.hpp"
-#include "roxiequerycompiler.hpp"
-#include "roxiewuprocessor.hpp"
-
-#include "roxiecommlibscm.hpp"
-
-#include "daclient.hpp"
-#include "dadfs.hpp"
-
-
-/////////////////////////////////////////////////////////////////////////////////// 
-class CRoxieQueryManager : public CInterface, implements IRoxieQueryManager
-{
-private:
-    SocketEndpoint ep;
-    unsigned roxieTimeout;
-    StringBuffer roxieName;
-    StringBuffer workunitDali;
-    Owned<IPropertyTree> xml;
-    Owned<IRoxieCommunicationClient> queryCommClient;
-    StringBuffer user;
-    StringBuffer password;
-    int logLevel;
-
-private:
-
-    const char *resolveQuerySetName(const char *querySetName)
-    {
-        return (querySetName && *querySetName) ? querySetName : roxieName.str();
-    }
-
-    IConstWorkUnit *getWorkUnit(const char *wuid)
-    {
-        Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
-        IConstWorkUnit *workunit = factory->openWorkUnit(wuid, false);
-        if (!workunit)
-            throw MakeStringException(ROXIEMANAGER_MISSING_ID, "Unknown workunit id %s", wuid);
-            
-        return workunit;
-    }
-
-    void setWUException(IException* e, IWorkUnit *wu, SCMStringBuffer &status, bool &warningsOnly)
-    {
-        StringBuffer msg;
-        e->errorMessage(msg);
-        Owned<IWUException> we = wu->createException();
-
-        if (e->errorCode() == ROXIEMANAGER_UNRESOLVED_FILE)
-        {
-            DBGLOG("WARNING %s", msg.str());
-            we->setSeverity(ExceptionSeverityWarning);
-        }
-        else
-        {
-            DBGLOG("ERROR %s", msg.str());
-            we->setSeverity(ExceptionSeverityError);
-            warningsOnly = false;
-        }
-
-        status.s.appendf("%s\n", msg.str());
-
-        we->setExceptionMessage(msg);
-        StringBuffer s;
-        s.append("roxiequerymanager.cpp");
-        we->setExceptionSource(s.str());
-    }
-
-
-    IConstWorkUnit *processQuerySetWorkunit(SCMStringBuffer &wuid, 
-                                            IRoxieQueryCompileInfo &compileInfo, 
-                                            IRoxieQueryProcessingInfo &processingInfo,
-                                            SCMStringBuffer &status
-                                            )
-    {
-        Owned<IConstWorkUnit> workunit;
-        try
-        {
-            Owned<IRoxieQueryCompiler> compiler = createRoxieQueryCompiler();
-            workunit.setown(compiler->compileEcl(wuid, user, password, compileInfo, processingInfo, status));
-            if (!workunit)
-            {
-                DBGLOG("ERROR compiling query %s", status.str());
-                return NULL;
-            }
-        }
-        catch(IException *e)
-        {
-            // don't try and update a workunit - eclserver already did it
-            StringBuffer msg;
-            e->errorMessage(msg);
-            status.set(msg.str());
-
-            DBGLOG("ERROR compiling query %s", msg.str());
-            e->Release();
-            
-            return NULL;
-        }
-
-        Owned<IWorkUnit> wu = &workunit->lock();
-        wu->setState(WUStateCompiled);
-        return workunit.getClear();
-    }
-
-    void processWorkunit(IConstWorkUnit *workunit, SCMStringBuffer &queryName, IRoxieQueryProcessingInfo &processingInfo, WUQueryActivationOptions activateOption, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status, SCMStringBuffer &roxieDeployStatus)
-    {
-        Owned<IWorkUnit> wu = &workunit->lock();
-
-        SCMStringBuffer jobName;
-        wu->getJobName(jobName);
-
-        if (stricmp(jobName.str(),queryName.str())!=0)
-            wu->setJobName(queryName.str());
-
-        try
-        {
-            // look up data file info
-            Owned<IRoxieWuProcessor> wuProcessor = createRoxieWuProcessor(roxieName, queryCommClient, logLevel);
-            wuProcessor->lookupFileNames(wu, processingInfo, status);
-            IPropertyTree *pkgInfo = wuProcessor->queryPackageInfo();
-            StringBuffer newQueryId;
-            const char *qsName = resolveQuerySetName(querySetName);
-            addQueryToQuerySet(wu, qsName, queryName.str(), pkgInfo, activateOption, newQueryId, NULL);
-
-            const char *queryComment = processingInfo.queryComment();
-            if (queryComment)
-                setQueryCommentForNamedQuery(qsName, newQueryId.str(), queryComment);
-        }
-        catch(IException *e)
-        {
-            int errCode = e->errorCode();
-            StringBuffer err;
-            e->errorMessage(err);
-            status.s.appendf("%d %s", errCode, err.str());
-            DBGLOG("ERROR updating query list %s", status.str());
-            e->Release();
-        }
-
-        if (notifyRoxie)
-        {
-            queryCommClient->sendRoxieReloadControlRequest();
-        }
-    }
-
-public:
-    IMPLEMENT_IINTERFACE;
-
-    CRoxieQueryManager(SocketEndpoint& _ep, const char *_roxieName, const char *_workunitDali, unsigned _roxieTimeout, const char *_user, const char *_password, int _logLevel)
-        :ep(_ep), roxieTimeout(_roxieTimeout), workunitDali(_workunitDali), roxieName(_roxieName), user(_user), password(_password), logLevel(_logLevel)
-    {
-        queryCommClient.setown(createRoxieCommunicationClient(ep, roxieTimeout));
-    }
-
-    void getNewQueryWorkunitId(SCMStringBuffer &wuid, SCMStringBuffer &roxieQueryName, const char *queryAppName)
-    {
-        Owned<IRoxieQueryCompiler> compiler = createRoxieQueryCompiler();
-        Owned<IConstWorkUnit> workunit = compiler->createWorkunit(wuid, user, queryAppName);
-        if (!workunit)
-        {
-            DBGLOG("ERROR creating workunit");
-            return;
-        }
-    }
-
-
-    bool compileQuery(SCMStringBuffer &wuid, SCMStringBuffer &roxieQueryName, IRoxieQueryCompileInfo &compileInfo, IRoxieQueryProcessingInfo &processingInfo, const char *targetClusterName, SCMStringBuffer &status)
-    {
-        Owned<IConstWorkUnit> workunit = processQuerySetWorkunit(wuid, compileInfo, processingInfo, status);
-
-        if (workunit)
-            return true;
-        else
-            return false;
-    }
-
-    bool deployQuery(SCMStringBuffer &wuid, SCMStringBuffer &roxieQueryName, IRoxieQueryCompileInfo &compileInfo, IRoxieQueryProcessingInfo &processingInfo, const char *userId, WUQueryActivationOptions activateOption, bool allowNewRoxieOnDemandQuery, const char *targetClusterName, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status, SCMStringBuffer &roxieDeployStatus)
-    {
-        Owned<IConstWorkUnit> workunit = processQuerySetWorkunit(wuid, compileInfo, processingInfo, status);
-        if (!workunit)
-            return false;
-
-        processWorkunit(workunit, roxieQueryName, processingInfo, activateOption, querySetName, notifyRoxie, status, roxieDeployStatus);
-        return true;
-    }
-
-    bool deployWorkunit(SCMStringBuffer &wuid,  SCMStringBuffer &roxieQueryName, IRoxieQueryProcessingInfo &processingInfo, const char *userId, WUQueryActivationOptions activateOption, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status, SCMStringBuffer &roxieDeployStatus)
-    {
-        if (!wuid.length())
-            throw MakeStringException(ROXIEMANAGER_MISSING_ID, "Missing workunit id");
-
-        Owned<IConstWorkUnit> workunit = getWorkUnit(wuid.str());
-        return publishWorkunit(workunit, roxieQueryName, processingInfo, userId, activateOption, querySetName, notifyRoxie, status, roxieDeployStatus);
-    }
-
-    bool publishWorkunit(IConstWorkUnit *workunit,  SCMStringBuffer &roxieQueryName, IRoxieQueryProcessingInfo &processingInfo, const char *userId, WUQueryActivationOptions activateOption, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status, SCMStringBuffer &roxieDeployStatus)
-    {
-        if (!workunit)
-            throw MakeStringException(ROXIEMANAGER_MISSING_ID, "Missing workunit id");
-
-        if (!roxieQueryName.length()) {
-            SCMStringBuffer jobName;
-            roxieQueryName.set(workunit->getJobName(jobName).str());
-        }
-
-        processWorkunit(workunit, roxieQueryName, processingInfo, activateOption, querySetName, notifyRoxie, status, roxieDeployStatus);
-        return true;
-    }
-
-    const char *getQuerySetWuId(const char *name, const char *sourceQuerySetName, SCMStringBuffer &querySetWuId)
-    {
-        Owned<IPropertyTree> tree = getQueryRegistry(sourceQuerySetName, true);
-        if (!tree)
-        {
-            DBGLOG("Could not find query %s in queryset %s", name, sourceQuerySetName);
-            return NULL;
-        }
-        StringBuffer xpath;
-        xpath.appendf("Query[@wuid='%s']", name);
-        IPropertyTree *query = tree->queryPropTree(xpath.str());
-        if (!query)
-        {
-            StringBuffer id;
-            StringBuffer aliasxpath;
-            aliasxpath.appendf("Alias[@name='%s']", name);
-            IPropertyTree *alias = tree->queryPropTree(aliasxpath.str());
-            if (alias)
-                id.append(alias->queryProp("@id"));
-            else
-                id.append(name);
-            xpath.clear().appendf("Query[@id='%s']", id.str());
-            query = tree->queryPropTree(xpath.str());
-
-            if (!query)
-                return NULL;
-
-            querySetWuId.set(query->queryProp("@wuid"));
-        }
-        else
-            querySetWuId.set(name);
-
-        return querySetWuId.str();
-    }
-
-    bool publishFromQuerySet(SCMStringBuffer &name, SCMStringBuffer &roxieQueryName, IRoxieQueryProcessingInfo &processingInfo, const char *userId, WUQueryActivationOptions activateOption, const char *sourceQuerySetName, const char *targetQuerySetName, const char *sourceDaliIP, const char *queryComment, bool notifyRoxie, SCMStringBuffer &status, SCMStringBuffer &roxieDeployStatus)
-    {
-        if (!name.length())
-            throw MakeStringException(ROXIEMANAGER_MISSING_ID, "Missing id");
-
-        SCMStringBuffer wuid;
-        getQuerySetWuId(name.str(), sourceQuerySetName, wuid);
-
-        SCMStringBuffer jobName;
-        Owned<IConstWorkUnit> workunit;
-        try
-        {
-            workunit.setown(getWorkUnit(wuid.str()));
-            roxieQueryName.set(workunit->getJobName(jobName).str());
-        }
-        catch(IException *e)
-        {
-            e->Release();
-        }
-
-        processWorkunit(workunit, name, processingInfo, activateOption, targetQuerySetName, notifyRoxie, status, roxieDeployStatus);
-    
-        return true;
-    }
-
-    IPropertyTree *retrieveQueryList(const char *filter, bool excludeQueryNames, bool excludeAliasNames, bool excludeLibraryNames, bool excludeDataOnlyNames, unsigned version)
-    {
-        Owned<IPropertyTree> queryRegistry = getQueryRegistry(roxieName.str(), false);
-
-        StringBuffer xml;
-        xml.append("<QueryNames>");
-
-        Owned<IPropertyTreeIterator> queries = queryRegistry->getElements("Query");
-        ForEach(*queries)
-        {
-            IPropertyTree &query = queries->query();
-            const char *id = query.queryProp("@id");
-
-            if (!filter || WildMatch(id, filter, true))
-            {
-                const char *wuid = query.queryProp("@wuid");
-                if (!wuid)
-                    continue;
-
-                try
-                {
-                    Owned<IConstWorkUnit> wu = getWorkUnit(wuid);
-
-                    unsigned libraryInterfaceHash = wu->getApplicationValueInt("LibraryModule", "interfaceHash", 0);
-                    if (libraryInterfaceHash && excludeLibraryNames)
-                        continue;
-
-                    bool isDataOnlyQuery = query.getPropBool("@loadDataOnly");
-                    if (isDataOnlyQuery && excludeDataOnlyNames)
-                        continue;
-
-                    if (!libraryInterfaceHash && !isDataOnlyQuery && excludeQueryNames)
-                        continue;
-
-                    StringBuffer err;
-                    xml.appendf(" <Query id='%s'", id);
-
-                    xml.appendf(" wuid='%s'", wuid);
-                    Owned<IConstWUQuery> q = wu->getQuery();
-            
-                    Owned<IConstWUAssociatedFile> associatedFile = q->getAssociatedFile(FileTypeDll, 0);
-                    if (associatedFile)
-                    {
-                        SCMStringBuffer associateFileName;
-                        associatedFile->getName(associateFileName);
-                        xml.appendf(" associatedName='%s'", associateFileName.str());
-                    }
-                                    
-                    SCMStringBuffer label;
-                    wu->getSnapshot(label);
-                    if (label.length())
-                        xml.appendf(" label ='%s'", label.str());
-
-                    SCMStringBuffer user;
-                    wu->getDebugValue("created_for", user);
-                    if (user.length())
-                        xml.appendf(" deployedBy='%s'", user.str());
-
-                    SCMStringBuffer comment;
-                    wu->getDebugValue("comment", comment);
-                    if (comment.length())
-                        xml.appendf(" comment='%s'", comment.str());
-
-                    xml.appendf(" priority='%d'", wu->getDebugValueInt("querypriority", 0));
-
-                    if (libraryInterfaceHash != 0)
-                    {
-                        xml.appendf(" isLibrary='1'");
-                        xml.appendf(" libraryInterfaceHash='%u'", libraryInterfaceHash);
-                    }
-
-                    // Must be from the queryset
-                    if (query.getPropBool("@suspended", false))
-                    {
-                        const char *user = query.queryProp("@updatedByUserId");
-                        xml.appendf(" suspendedBy='%s'", (user) ? user : "Roxie");
-                        xml.append(" suspended='1'");
-                    }
-                    err.append(query.queryProp("@error"));
-                    if (err.length())
-                    {
-                        StringBuffer temp;
-                        encodeXML(err.str(), temp);
-                        xml.appendf(" error='%s'", temp.str());
-                    }
-
-                    if (isDataOnlyQuery)
-                        xml.appendf(" isLoadDataOnly='1'");
-
-                    Owned<IPropertyTreeIterator> libraries = query.getElements("Library");
-                    xml.append(">\n");
-                    xml.append(" <librariesUsed>");
-                    ForEach(*libraries)
-                    {
-                        IPropertyTree &library = libraries->query();
-                        const char *libName = library.queryProp("@name");
-                        xml.appendf("<library>%s</library>", libName);
-                    }
-                    xml.append("</librariesUsed>\n");
-                    xml.append("</Query>\n");
-                }
-                catch(IException *e)
-                {
-                    StringBuffer err;
-                    e->errorMessage(err);
-                    xml.appendf(" <Query id='%s'", id);
-                    xml.appendf(" wuid='%s'", wuid);
-                    xml.appendf(" error='%s'", err.str());
-                    xml.appendf(" comment='%s'", err.str());
-                    xml.append(">\n");
-                    xml.append("</Query>\n");
-                    e->Release();
-                }
-            }
-        }
-        if (!excludeAliasNames)
-        {
-            Owned<IPropertyTreeIterator> aliases = queryRegistry->getElements("Alias");
-            ForEach(*aliases)
-            {
-                IPropertyTree &alias = aliases->query();
-                const char *id = alias.queryProp("@id");
-                const char *name = alias.queryProp("@name");
-                if (!filter || WildMatch(name, filter, true) || WildMatch(id, filter, true))
-                    xml.appendf(" <Alias id='%s' name='%s'/>\n", id, name);
-            }
-        }
-        xml.append("</QueryNames>");
-
-        Owned<IPropertyTree> tree = createPTreeFromXMLString(xml);
-        return tree.getClear();
-    }
-
-    void addAlias(const char *alias, const char *queryId, const char *querySetName, bool notifyRoxie, SCMStringBuffer &oldActive)
-    {
-        try
-        {
-            addQuerySetAlias(resolveQuerySetName(querySetName), alias, queryId);
-        }
-        catch(IException *e)
-        {
-            int errCode = e->errorCode();
-            StringBuffer err;
-            e->errorMessage(err);
-            DBGLOG("ERROR addingAlias %d %s", errCode, err.str());
-            e->Release();
-        }
-
-        if (notifyRoxie)
-            queryCommClient->sendRoxieReloadControlRequest();
-    }
-
-    void suspendQuery(const char *id, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status)
-    {
-        try
-        {
-            setSuspendQuerySetQuery(resolveQuerySetName(querySetName), id, true, NULL);
-            status.s.appendf("successfully suspended query %s", id);
-        }
-        catch(IException *e)
-        {
-            int errCode = e->errorCode();
-            StringBuffer err;
-            e->errorMessage(err);
-            status.s.appendf("%d %s", errCode, err.str());
-            DBGLOG("ERROR suspending query %s", status.str());
-            e->Release();
-        }
-        if (notifyRoxie)
-            queryCommClient->sendRoxieReloadControlRequest();
-    }
-
-    void unsuspendQuery(const char *id, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status)
-    {
-        try
-        {
-            setSuspendQuerySetQuery(resolveQuerySetName(querySetName), id, false, NULL);
-            status.s.appendf("successfully unsuspended query %s", id);
-        }
-        catch(IException *e)
-        {
-            int errCode = e->errorCode();
-            StringBuffer err;
-            e->errorMessage(err);
-            status.s.appendf("%d %s", errCode, err.str());
-            DBGLOG("ERROR unsuspending query %s", status.str());
-            e->Release();
-        }
-        if (notifyRoxie)
-            queryCommClient->sendRoxieReloadControlRequest();
-    }
-
-    void deleteQuery(const char *id, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status)
-    {
-        try
-        {
-            deleteQuerySetQuery(resolveQuerySetName(querySetName), id);
-            status.s.appendf("successfully deleted:\n query %s", id);
-        }
-        catch(IException *e)
-        {
-            int errCode = e->errorCode();
-            StringBuffer err;
-            e->errorMessage(err);
-            status.s.appendf("%d %s", errCode, err.str());
-            DBGLOG("ERROR deleting query %s", status.str());
-            e->Release();
-        }
-        if (notifyRoxie)
-            queryCommClient->sendRoxieReloadControlRequest();
-
-    }
-
-    void removeAllAliasForQuery(const char *queryId, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status)
-    {
-        try
-        {
-            removeQuerySetAliasesFromNamedQuery(resolveQuerySetName(querySetName), queryId);
-            status.s.appendf("successfully removed all aliases for query %s", queryId);
-        }
-        catch(IException *e)
-        {
-            int errCode = e->errorCode();
-            StringBuffer err;
-            e->errorMessage(err);
-            status.s.appendf("%d %s", errCode, err.str());
-            DBGLOG("ERROR deleting query %s", status.str());
-            e->Release();
-        }
-
-        if (notifyRoxie)
-                queryCommClient->sendRoxieReloadControlRequest();
-    }
-
-    void removeAlias(const char *alias, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status)
-    {
-        try
-        {
-            removeQuerySetAlias(resolveQuerySetName(querySetName), alias);
-            status.s.appendf("successfully removed alias %s", alias);
-        }
-        catch(IException *e)
-        {
-            int errCode = e->errorCode();
-            StringBuffer err;
-            e->errorMessage(err);
-            status.s.appendf("%d %s", errCode, err.str());
-            DBGLOG("ERROR removing alias %s", status.str());
-            e->Release();
-        }
-
-        if (notifyRoxie)
-            queryCommClient->sendRoxieReloadControlRequest();
-    }
-
-    const char * runQuery(IConstWorkUnit *workunit, const char *roxieQueryName, bool outputToSocket, bool allowNewRoxieOnDemandQuery, SCMStringBuffer &response)
-    {
-        StringBuffer query;
-        SCMStringBuffer wuid;
-        query.appendf("<%s wuid='%s' roxieOnDemand='%d' outputToSocket='%d'/>", roxieQueryName, workunit->getWuid(wuid).str(), (int) allowNewRoxieOnDemandQuery, (int) outputToSocket);
-        try
-        {
-            queryCommClient->sendRoxieOnDemandRequest(query.str(), response, false);
-        }
-        catch (IException *E)
-        {
-            Owned<IWorkUnit> wu = &workunit->lock();
-            Owned<IWUException> we = wu->createException();
-            we->setExceptionCode(E->errorCode());
-            StringBuffer msg;
-            we->setExceptionMessage(E->errorMessage(msg).str());
-            we->setExceptionSource("Roxie");
-            we->setSeverity(ExceptionSeverityError);
-            wu->setState(WUStateFailed);
-            throw;
-        }
-        return response.str();
-    }
-
-
-    void setQueryWarningTime(const char *id, unsigned warnTime, SCMStringBuffer &status)
-    {
-    }
-
-    unsigned getQueryWarningTime(const char *id)
-    {
-        return 0;
-    }
-
-    bool updateACLInfo(bool allow, const char *restrict_ip, const char *mask, const char *query, const char *errorMsg, int errorCode, int port, SCMStringBuffer &status)
-    {
-        if (port == 0)   // use the default
-            queryCommClient->updateACLInfo(allow, restrict_ip, mask, query, errorMsg, errorCode, NULL, status);
-        else if (port == -1)  // use all ports
-        {
-            IntArray portNumbers;  // store unique ports
-            Owned<IPropertyTree> topology = queryCommClient->retrieveTopology();
-
-            Owned<IPropertyTreeIterator> servers = topology->getElements("Endpoint/RoxieTopology/RoxieServerProcess");
-            ForEach (*servers)
-            {
-                IPropertyTree &server = servers->query();
-                int serverPort = server.getPropInt("@port");
-                const char *netAddress = server.queryProp("@netAddress");
-
-                portNumbers.append(port);
-                StringBuffer roxieAddress;
-                roxieAddress.appendf("%s:%d", netAddress, serverPort);
-                queryCommClient->updateACLInfo(allow, restrict_ip, mask, query, errorMsg, errorCode, roxieAddress.str(), status);
-            }       
-        }
-        else  // use only the specific port passed in
-        {
-            Owned<IPropertyTree> topology = queryCommClient->retrieveTopology();
-            StringBuffer xpath;
-            xpath.appendf("Endpoint/RoxieTopology/RoxieServerProcess[@port='%d']", port);
-            bool foundIt = false;
-
-            Owned<IPropertyTreeIterator> servers = topology->getElements(xpath.str());
-            ForEach (*servers)
-            {
-                IPropertyTree &server = servers->query();
-                int serverPort = server.getPropInt("@port");
-                const char *netAddress = server.queryProp("@netAddress");
-
-                StringBuffer roxieAddress;
-                roxieAddress.appendf("%s:%d", netAddress, serverPort);
-                queryCommClient->updateACLInfo(allow, restrict_ip, mask, query, errorMsg, errorCode, roxieAddress.str(), status);
-                foundIt = true;
-                break;  // only need to send 1
-            }
-
-            if (!foundIt)
-                status.s.appendf("Could not find port %d in the roxie configuration", port);
-        }
-
-
-        return true;
-    }
-
-    IRoxieCommunicationClient * queryRoxieCommunicationClient() { return queryCommClient; }
-
-};
-
-
-IRoxieQueryManager* createRoxieQueryManager(SocketEndpoint &roxieEP, const char *roxieName, const char *workunitDali, unsigned roxieTimeout, const char *_user, const char *_password, int logLevel)
-{
-    return new CRoxieQueryManager(roxieEP, roxieName, workunitDali, roxieTimeout, _user, _password, logLevel);
-}
-

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 1729
common/roxiemanager/roxiewuprocessor.cpp


+ 0 - 56
common/roxiemanager/roxiewuprocessor.hpp

@@ -1,56 +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 _ROXIEWUPROCESSOR_HPP__
-#define _ROXIEWUPROCESSOR_HPP__
-
-
-interface IConstWorkUnit;
-interface IWorkUnit;
-interface IEmbeddedXslTransformer;
-interface IAttributeMetaDataResolver;
-
-#include "jptree.hpp"
-#include "esp.hpp"
-#include "roxie.hpp"
-
-#include "roxiemanager.hpp"
-
-interface IRoxieCommunicationClient;
-
-#define GET_LOCK_FAILURE            1100
-//#define DALI_FILE_LOOKUP_TIMEOUT (1000*60*1)  // 1 minute
-#define DALI_FILE_LOOKUP_TIMEOUT (1000*15*1)  // 15 seconds
-
-enum QueryAction { DEPLOY_ATTR, DEPLOY_WU, COMPILE, ROXIE_ON_DEMAND };
-
-interface IRoxieWuProcessor : extends IInterface
-{
-    virtual void retrieveFileNames(IPropertyTree *remoteQuery, IPropertyTree *remoteTopology, bool copyFileLocationInfo, const char *lookupDaliIp, const char *user, const char *password) = 0;
-    virtual void retrieveFileNames(IPropertyTree *xml, IPropertyTree *remoteQuery, IPropertyTree *remoteState, IPropertyTree *remoteTopology, bool copyFileLocationInfo, const char *lookupDaliIp, const char *user, const char *password) = 0;
-    virtual bool lookupFileNames(IWorkUnit *wu, IRoxieQueryProcessingInfo &processingInfo, SCMStringBuffer &status) = 0;
-
-    virtual bool processAddRoxieFileInfoToDali(const char *src_filename, const char *dest_filename, const char *lookupDaliIp, IUserDescriptor *userdesc, StringBuffer &status) = 0;
-    virtual bool processAddRoxieFileRelationshipsToDali(const char *src_filename, const char *remoteRoxieClusterName, const char *lookupDaliIp, IUserDescriptor *userdesc, StringBuffer &msg) = 0;
-    virtual IPropertyTree *queryPackageInfo() = 0;
-
-};
-
-extern IRoxieWuProcessor *createRoxieWuProcessor(const char *roxieClusterName, IRoxieCommunicationClient *_roxieCommClient, int logLevel);
-
-#endif
-

+ 0 - 26
common/roxiemanager/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>common/roxiemanager</title>
-
-    <para>
-        The common/roxiemanager directory contains the sources for the common/roxiemanager library.
-    </para>
-</section>

+ 0 - 1
common/sourcedoc.xml

@@ -32,7 +32,6 @@
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="remote/sourcedoc.xml"/>
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="roxiecommlib/sourcedoc.xml"/>
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="roxiehelper/sourcedoc.xml"/>
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="roxiemanager/sourcedoc.xml"/>
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="thorhelper/sourcedoc.xml"/>
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="workunit/sourcedoc.xml"/>
 </section>

+ 0 - 1
esp/scm/espscm.cmake

@@ -34,7 +34,6 @@ set ( ESPSCM_SRCS
       ws_access.ecm
       esploggingservice.ecm
       roxiecommlibscm.ecm
-      roxiemanagerscm.ecm
       soapesp.ecm
       ws_ecl_client.ecm
       ws_fs.ecm

+ 0 - 171
esp/scm/roxiemanagerscm.ecm

@@ -1,171 +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 ROXIEMANAGER_API
-#define ROXIEMANAGER_API __declspec(dllimport)
-#endif
-
-#include "esp.hpp"
-#include "jptree.hpp"
-#include "jsocket.hpp"
-#include "workunit.hpp"
-
-interface IUserDescriptor;
-interface IRoxieCommunicationClient;
-
-SCMenum ActivationOptions1
-{
-    NO_ACTIVATE = 0,
-    ACTIVATE = 1,
-    ACTIVATE_SUSPEND = 2,
-    ACTIVATE_DELETE = 3,
-    LOAD_DATA_ONLY = 4,
-    ACTIVATE_LOAD_DATA_ONLY = 5
-};
-
-enum RoxieQueryPriorities
-{
-    UNKNOWN_PRIORITY = -1,
-    LOW_PRIORITY = 0,
-    HIGH_PRIORITY = 1,
-    SLA_PRIORITY = 2
-};
-
-SCMenum LayoutTranslationEnabledType
-{
-    RLT_OFF,
-    RLT_ON,
-    RLT_UNKNOWN
-};
-
-
-SCMinterface IConstRoxieQueryCompileInfo(IInterface)
-{
-    unsigned getMemoryLimit();
-    unsigned getWuTimeOut();
-    unsigned getTimeLimit();
-    unsigned getWarnTimeLimit();
-    bool getPoolGraphs();
-    bool getHighPriority();
-    int getQueryPriority();
-    const char *queryRepositoryLabel();
-    const char *queryJobName();
-    const char *queryEcl();
-    const char *queryAppName();
-    const char *queryClusterName();
-    const char *queryDefaultStyleName();
-    const char *queryModuleName();
-    const char *queryWuDebugOptions();
-};
-
-
-SCMinterface IRoxieQueryCompileInfo(IConstRoxieQueryCompileInfo)
-{
-    void setMemoryLimit(unsigned val);
-    void setWuTimeOut(unsigned val);
-    void setTimeLimit(unsigned val);
-    void setWarnTimeLimit(unsigned val);
-    void setPoolGraphs(bool val);
-    void setHighPriority(bool val);
-    void setQueryPriority(int val);
-    void setRepositoryLabel(const char *val);
-    void enableWebServiceInfoRetrieval(const char *_moduleName, const char *_defaultStyleName);
-    void setWuDebugOptions(const char *val);
-};
-
-
-SCMinterface IConstRoxieQueryProcessingInfo(IInterface)
-{
-    bool getLoadDataOnly();
-    bool getResolveFileInfo();
-    bool getNoForms();
-    bool getUseRenamedFileInfo();
-    const char *queryComment();
-    const char *queryPackageName();
-    const char *queryDfsDaliIp();
-    const char *querySourceRoxieClusterName();
-    bool getGeneratePackageFileInfo();
-    const char *queryScope();
-    IUserDescriptor *queryUserDescriptor();
-    int getLayoutTranslationEnabled();
-    bool getResolveKeyDiffInfo();
-    bool getCopyKeyDiffLocationInfo();
-};
-
-
-SCMinterface IRoxieQueryProcessingInfo(IConstRoxieQueryProcessingInfo)
-{
-    void setLoadDataOnly(bool val);
-    void setResolveFileInfo(bool val);
-    void setUseRenamedFileInfo(bool val);
-    void setComment(const char *val);
-    void setPackageName(const char *val);
-    void setNoForms(bool val);
-    void setDfsDaliIp(const char *val);
-    void setSourceRoxieClusterName(const char *val);
-    void setGeneratePackageFileInfo(bool val);
-    void setScope(const char *val);
-    void setUserDescriptor(IUserDescriptor *val);
-    void setLayoutTranslationEnabled(int val);
-    void setResolveKeyDiffInfo(bool val);
-    void setCopyKeyDiffLocationInfo(bool val);
-};
-
-
-SCMinterface IRoxieQueryManager(IInterface)
-{
-    bool compileQuery(SCMStringBuffer &wuid, SCMStringBuffer &roxieQueryName, IRoxieQueryCompileInfo &compileInfo,
-                      IRoxieQueryProcessingInfo&processingInfo, const char *targetClusterName, SCMStringBuffer &status);
-
-    bool deployQuery(SCMStringBuffer &wuid, SCMStringBuffer &roxieQueryName, IRoxieQueryCompileInfo &compileInfo,
-                     IRoxieQueryProcessingInfo &processingInfo, const char *userId, WUQueryActivationOptions activateOption, bool allowNewRoxieOnDemandQuery, const char *targetClusterName, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status, SCMStringBuffer &roxieDeployStatus);
-
-    bool deployWorkunit(SCMStringBuffer &wuid,  SCMStringBuffer &roxieQueryName, IRoxieQueryProcessingInfo &processingInfo, const char *userId, WUQueryActivationOptions activateOption, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status, SCMStringBuffer &roxieDeployStatus);
-    bool publishWorkunit(IConstWorkUnit *workunit,  SCMStringBuffer &roxieQueryName, IRoxieQueryProcessingInfo &processingInfo, const char *userId, WUQueryActivationOptions activateOption, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status, SCMStringBuffer &roxieDeployStatus);
-    
-    bool publishFromQuerySet(SCMStringBuffer &name, SCMStringBuffer &roxieQueryName, IRoxieQueryProcessingInfo &processingInfo, const char *userId, WUQueryActivationOptions activateOption, const char *sourceQuerySetName, const char *targetQuerySetName, const char *sourceDaliIP, const char *queryComment, bool notifyRoxie, SCMStringBuffer &status, SCMStringBuffer &roxieDeployStatus);
-    
-    void getNewQueryWorkunitId(SCMStringBuffer &wuid, SCMStringBuffer &roxieQueryName, const char *queryAppName);
-
-    const char *runQuery(IConstWorkUnit *workunit, const char *roxieQueryName, bool resultsToSocket, bool allowNewRoxieOnDemandQuery, SCMStringBuffer &response);
-
-    void addAlias(const char *alias, const char *queryId, const char *querySetName, bool notifyRoxie, SCMStringBuffer &oldActive);
-    void suspendQuery(const char *id, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status);
-    void unsuspendQuery(const char *id, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status);
-    void deleteQuery(const char *id, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status);
-    void removeAlias(const char *alias, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status);
-    void removeAllAliasForQuery(const char *id, const char *querySetName, bool notifyRoxie, SCMStringBuffer &status);
-    
-    IPropertyTree *retrieveQueryList(const char *filter, bool excludeQueryNames, bool excludeAliasNames, bool excludeLibraryNames, bool excludeDataOnlyNames, unsigned version);
-
-    void setQueryWarningTime(const char *id, unsigned warnTime, SCMStringBuffer &status);
-    unsigned getQueryWarningTime(const char *id);
-
-    bool updateACLInfo(bool allow, const char *restrict_ip, const char *mask, const char *query, const char *errorMsg, int errorCode, int port, SCMStringBuffer &status);
-};
-
-
-
-
-extern "C" ROXIEMANAGER_API IRoxieQueryManager *createRoxieQueryManager(SocketEndpoint &roxieEP, const char *roxieName, const char *workunitDali, unsigned roxieTimeout, const char *_userName, const char *_password, int logLevel);
-
-
-extern "C" ROXIEMANAGER_API IRoxieQueryCompileInfo *createRoxieQueryCompileInfo(const char *_ecl, const char *_jobName, const char *_clusterName, const char *_appName);
-extern "C" ROXIEMANAGER_API IRoxieQueryProcessingInfo *createRoxieQueryProcessingInfo();
-
-
-

+ 0 - 1
esp/scm/smcscm.cmake

@@ -32,7 +32,6 @@ set ( ESPSCM_SRCS
       ws_dfuXref.ecm
       ws_fs.ecm
       ws_roxie.ecm
-      ws_roxiequery.ecm
       ws_smc.ecm
       ws_topology.ecm
       ws_workunits.ecm

+ 0 - 198
esp/scm/ws_roxiequery.ecm

@@ -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.
-############################################################################## */
-
-#include "xslprocessor.hpp" 
-//  ===========================================================================
-
-ESPStruct RoxieQueryAlias
-{
-    string ID;
-    string Original;
-};
-
-ESPStruct RoxieQuery
-{
-    string ID;
-    [min_ver("1.02")] string WUID;
-    //string Cluster;
-    //string Label;
-    //string AssociatedName;
-    [min_ver("1.01")] string DeployedBy;
-    [min_ver("1.01")] string UpdatedBy;
-    string Error;
-    string Comment;
-    string Extra;
-    string HighPriority;
-    string HasAliases;
-    string Suspended;
-};
-
-ESPrequest 
-[
-]
-RoxieQuerySearchRequest
-{
-};
-
-ESPresponse 
-[
-   exceptions_inline
-]
-RoxieQuerySearchResponse
-{
-    ESParray<string, ClusterName> ClusterNames;
-    ESParray<string, SuspendedSelection> SuspendedSelections;
-};
-
-
-ESPrequest 
-[
-]
-RoxieQueryListRequest
-{
-    ESParray<string> IDs;
-
-    string LogicalName;
-    string Cluster;
-    string Suspended;
-    int PageSize;
-    int PageStartFrom;
-    string Sortby;
-    bool Descending(false);
-};
-
-ESPresponse 
-[
-    exceptions_inline,
-    encode(0)
-]
-RoxieQueryListResponse
-{
-    ESParray<ESPstruct RoxieQuery> RoxieQueries;
-
-    int PageSize(100);
-    int64 PageStartFrom(1);
-    int64 LastPageFrom(-1);
-    int64 PageEndAt;
-    int64 PrevPageFrom(-1);
-    int64 NextPageFrom(-1);
-    int64 NumFiles;
-    string Sortby;
-    bool Descending(false);
-    string LogicalName;
-    string Cluster;
-    string ParametersForPaging;
-    string ParametersForSorting;
-};
-
-ESPrequest 
-[
-]
-RoxieQueryDetailsRequest
-{
-    string QueryID;
-    string Cluster;
-};
-
-ESPresponse 
-[
-   exceptions_inline
-]
-RoxieQueryDetailsResponse
-{
-    string QueryID;
-    string Cluster;
-    string WUID;
-    string AssociatedName;
-    string HighPriority;
-    string Suspended;
-    string Label;
-    string Error;
-    string Comment;
-    string Extra;
-    [min_ver("1.01")] string DeployedBy;
-    [min_ver("1.01")] string UpdatedBy;
-    
-    ESParray<ESPStruct RoxieQueryAlias> Aliases;
-};
-
-ESPrequest GVCAjaxGraphRequest
-{
-    string Cluster;
-    string Name;
-    string GraphName;
-};
-
-ESPresponse [exceptions_inline, http_encode(0)] GVCAjaxGraphResponse
-{
-    string Cluster;
-    string Name;
-    string GraphName;
-    string GraphType;
-};
-
-ESPrequest ShowGVCGraphRequest
-{
-    string Cluster;
-    string QueryId;
-    string GraphName;
-};
-
-ESPresponse [exceptions_inline, http_encode(0)] ShowGVCGraphResponse
-{
-    string Cluster;
-    string QueryId;
-    string GraphName;
-    ESParray<string> GraphNames;
-    string TheGraph;
-};
-
-ESPrequest RoxieQueryProcessGraphRequest
-{
-    string  Cluster;
-    string  QueryId;
-    string  GraphName;
-    bool    XmlGraph;
-    bool    Stats;
-};
-
-ESPresponse  [encode(0), exceptions_inline] RoxieQueryProcessGraphResponse
-{
-    string theGraph;
-};
-
-
-//  ===========================================================================
-ESPservice [
-    version("1.10"), default_client_version("1.10"),
-    noforms, 
-    exceptions_inline("./smc_xslt/exceptions.xslt")] WsRoxieQuery
-{
-    ESPuses ESPStruct RoxieQueryAlias;
-    ESPuses ESPStruct RoxieQuery;
-
-    ESPmethod [resp_xsl_default("/esp/xslt/roxiequery_search.xslt")] RoxieQuerySearch(RoxieQuerySearchRequest, RoxieQuerySearchResponse);
-    ESPmethod [resp_xsl_default("/esp/xslt/roxiequery.xslt")] RoxieQueryList(RoxieQueryListRequest, RoxieQueryListResponse);
-    ESPmethod [resp_xsl_default("/esp/xslt/roxiequerydetails.xslt")] QueryDetails(RoxieQueryDetailsRequest, RoxieQueryDetailsResponse);
-    ESPmethod [description("Stub for Ajax GVC Graph."), help(""), resp_xsl_default("/esp/xslt/GvcGraph.xslt")] GVCAjaxGraph(GVCAjaxGraphRequest, GVCAjaxGraphResponse);
-    ESPmethod [description("Show GVC graph for a Roxie query"), help(""), resp_xsl_default("/esp/xslt/RoxieGVCGraph.xslt")] ShowGVCGraph(ShowGVCGraphRequest, ShowGVCGraphResponse);
-    ESPmethod [resp_xsl_default("/esp/xslt/graphStats.xslt")] RoxieQueryProcessGraph(RoxieQueryProcessGraphRequest, RoxieQueryProcessGraphResponse);
-};
-
-SCMexportdef(WsRoxieQuery);
-
-SCMapi(WsRoxieQuery) IClientWsRoxieQuery *createWsRoxieQueryClient();

+ 0 - 1
esp/services/CMakeLists.txt

@@ -24,7 +24,6 @@ HPCC_ADD_SUBDIRECTORY (ws_ecl "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_fileio "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_fs "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_machine "PLATFORM")
-HPCC_ADD_SUBDIRECTORY (ws_roxiequery "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_smc "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_topology "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_workunits "PLATFORM")

+ 0 - 2
esp/services/ws_packageprocess/CMakeLists.txt

@@ -40,7 +40,6 @@ include_directories (
          ${HPCC_SOURCE_DIR}/common/environment
          ${HPCC_SOURCE_DIR}/dali/dfu
          ${HPCC_SOURCE_DIR}/common/remote
-         ${HPCC_SOURCE_DIR}/common/roxiemanager
          ${HPCC_SOURCE_DIR}/common/workunit
          ${HPCC_SOURCE_DIR}/rtl/include
     )
@@ -57,6 +56,5 @@ target_link_libraries ( ws_packageprocess
          securesocket
          dalibase
          ws_fs
-         roxiemanager
     )
 

+ 0 - 93
esp/services/ws_roxiequery/CMakeLists.txt

@@ -1,93 +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: ws_roxiequery 
-#####################################################
-# Description:
-# ------------
-#    Cmake Input File for ws_roxiequery
-#####################################################
-
-project( ws_roxiequery ) 
-
-include(${HPCC_SOURCE_DIR}/esp/scm/smcscm.cmake)
-
-set (    SRCS 
-         ${ESPSCM_GENERATED_DIR}/ws_roxiequery_esp.cpp 
-         ws_roxiequeryplugin.cpp 
-         ws_roxiequeryservice.cpp 
-         
-         ws_roxiequeryservice.cpp
-         
-         ${HPCC_SOURCE_DIR}/esp/scm/ws_roxiequery.ecm
-    )
-
-include_directories ( 
-         ./../../../dali/dfu 
-         ./../../../system/mp 
-         ./../../platform 
-         ./../../../system/jlib 
-         ./../../../common/environment 
-         ./../../services 
-         ./../../../dali/ft 
-         ./../common 
-         ./../../../system/xmllib 
-         ./../../../esp/bindings/http/platform 
-         ./../../../system/security/securesocket 
-         ./../../../system/security/shared 
-         ./../../../system/include 
-         ./../../../common/workunit 
-         ./../../../common/remote 
-         ./../../clients 
-         ./../../../esp/esplib 
-         ./../../../dali/base 
-         ./../../bindings/SOAP/scrubbed 
-         ./../ws_workunits 
-         ./../../../rtl/include 
-         ./../../../common/dllserver 
-         ./../../bindings 
-         ./../../smc/SMCLib 
-         ./../../bindings/SOAP/xpp 
-         ./../../../common/fileview2 
-         ./../../../rtl/eclrtl 
-    )
-
-ADD_DEFINITIONS( -D_USRDLL )
-
-HPCC_ADD_LIBRARY( ws_roxiequery SHARED ${SRCS} )
-add_dependencies ( ws_roxiequery espscm )
-install ( TARGETS ws_roxiequery RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
-target_link_libraries ( ws_roxiequery 
-         jlib
-         fileview2
-         remote 
-         ${XALAN_LIBRARIES} ${XERCES_LIBRARIES}
-         xmllib 
-         esphttp 
-         dalibase 
-         environment 
-         dalift 
-         dllserver 
-         nbcd 
-         eclrtl 
-         deftype 
-         workunit 
-         SMCLib 
-         roxiecommlib 
-         roxiemanager
-    )
-

+ 0 - 26
esp/services/ws_roxiequery/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/services/ws_roxiequery</title>
-
-    <para>
-        The esp/services/ws_roxiequery directory contains the sources for the esp/services/ws_roxiequery library.
-    </para>
-</section>

+ 0 - 91
esp/services/ws_roxiequery/ws_roxiequeryplugin.cpp

@@ -1,91 +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)
-
-#ifndef WsRoxieQuery_API
-#ifdef _WIN32
-#define WsRoxieQuery_API __declspec(dllexport)
-#else
-#define WsRoxieQuery_API
-#endif //_WIN32
-#endif //WsRoxieQuery_API
-
-#include "ws_roxiequery_esp.ipp"
-
-//ESP Bindings
-#include "http/platform/httpprot.hpp"
-
-//ESP Service
-#include "ws_roxiequeryservice.hpp"
-
-#include "espplugin.hpp"
-
-extern "C"
-{
-//when we aren't loading dynamically
-// Change the function names when we stick with dynamic loading.
-ESP_FACTORY IEspService * esp_service_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
-{
-    if (strcmp(type, "WsRoxieQuery")==0)
-    {
-        CWsRoxieQueryEx* service = new CWsRoxieQueryEx;
-        service->init(cfg, process, name);
-        return service;
-    }
-    return NULL;
-}
-
-
-
-ESP_FACTORY IEspRpcBinding * esp_binding_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
-{
-    if (strcmp(type, "WsRoxieQuery")==0)
-    {
-#ifdef _DEBUG
-        http_soap_log_level log_level_ = hsl_all;
-#else
-        http_soap_log_level log_level_ = hsl_none;
-#endif
-        return new CWsRoxieQuerySoapBindingEx(cfg, name, process, log_level_);
-    }
-
-    return NULL;
-}
-
-
-
-ESP_FACTORY IEspProtocol * esp_protocol_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
-{
-    if (strcmp(type, "http_protocol")==0)
-    {
-        return new CHttpProtocol;
-    }
-    else if(strcmp(type, "secure_http_protocol") == 0)
-    {
-        IPropertyTree *sslSettings;
-        sslSettings = cfg->getPropTree(StringBuffer("Software/EspProcess[@name=\"").append(process).append("\"]").append("/EspProtocol[@name=\"").append(name).append("\"]").str());
-        if(sslSettings != NULL)
-        {
-            return new CSecureHttpProtocol(sslSettings);
-        }
-    }
-    
-    return NULL;
-}
-
-};

+ 0 - 812
esp/services/ws_roxiequery/ws_roxiequeryservice.cpp

@@ -1,812 +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)
-
-#include <math.h>
-#include "jfile.hpp"
-#include "wshelpers.hpp"
-#include "portlist.h"
-#include "jiface.hpp"
-#include "environment.hpp"
-#include "TpWrapper.hpp"
-
-#include "jstring.hpp"
-
-#include "dautils.hpp"
-#include "eclrtl.hpp"
-#include "fverror.hpp"
-#include "exception_util.hpp"
-
-#include "ws_roxiequeryservice.hpp"
-
-const unsigned int  ROXIEQUERYID                    = 1;
-const unsigned int  ROXIEQUERYWUID                  = 2;
-const unsigned int  ROXIEQUERYCLUSTER               = 3;
-const unsigned int  ROXIEQUERYLABEL             = 4;
-const unsigned int  ROXIEQUERYSUSPENDED         = 5;
-const unsigned int  ROXIEQUERYHIGHPRIORITY      = 6;
-const unsigned int  ROXIEQUERYERROR             = 7;
-const unsigned int  ROXIEQUERYCOMMENT               = 8;
-const unsigned int  ROXIEQUERYASSOCIATEDNAME    = 9;
-const unsigned int  ROXIEQUERYHASALIASES            = 10;
-const unsigned int  ROXIEQUERYDEPLOYEDBY            = 11;
-const unsigned int  ROXIEQUERYUPDATEDBY         = 12;
-const unsigned int  ROXIEMANAGER_TIMEOUT        = 60000;
-
-static const char* FEATURE_URL="RoxieQueryAccess";
-static const char* ROXIE_CLUSTER="RoxieCluster";
-static const char* ROXIE_FARMERPROCESS1="RoxieServerProcess[1]";
-
-__int64 findPositionInRoxieQueryList(int type, const char *value, bool descend, IArrayOf<IEspRoxieQuery>& queries)
-{
-    if (!value || (strlen(value) < 1))
-    {
-        if (descend)
-            return -1;
-        else
-            return 0;
-    }
-
-    __int64 addToPos = -1;
-    ForEachItemIn(i, queries)
-    {
-        IEspRoxieQuery& query = queries.item(i);
-        char *Value = NULL;
-        switch (type)
-        {
-        case ROXIEQUERYID:
-            Value = (char *) query.getID();
-            break;
-        case ROXIEQUERYDEPLOYEDBY:
-            Value = (char *) query.getDeployedBy();
-            break;
-        case ROXIEQUERYUPDATEDBY:
-            Value = (char *) query.getUpdatedBy();
-            break;
-        case ROXIEQUERYWUID:
-            Value = (char *) query.getWUID();
-            break;
-        case ROXIEQUERYSUSPENDED:
-            Value = (char *) query.getSuspended();
-            break;
-        case ROXIEQUERYHIGHPRIORITY:
-            Value = (char *) query.getHighPriority();
-            break;
-        case ROXIEQUERYERROR:
-            Value = (char *) query.getError();
-            break;
-        case ROXIEQUERYCOMMENT:
-            Value = (char *) query.getComment();
-            break;
-        case ROXIEQUERYHASALIASES:
-            Value = (char *) query.getHasAliases();
-            break;
-        }
-
-        if (!Value)
-            continue;
-
-        if (type != ROXIEQUERYID)
-        {
-            if (descend && strcmp(value, Value)>0)
-            {
-                addToPos = i;
-                break;
-            }
-            if (!descend && strcmp(value, Value)<0)
-            {
-                addToPos = i;
-                break;
-            }
-        }
-        else
-        {
-            if (descend && stricmp(value, Value)>0)
-            {
-                addToPos = i;
-                break;
-            }
-            if (!descend && stricmp(value, Value)<0)
-            {
-                addToPos = i;
-                break;
-            }
-        }
-    }
-
-    return addToPos;
-}
-
-void getUserInformation(IEspContext &context, StringBuffer &username, StringBuffer &password)
-{
-    context.getUserID(username);
-    context.getPassword(password);
-}
-
-void CWsRoxieQueryEx::init(IPropertyTree *cfg, const char *process, const char *service)
-{
-
-    IPropertyTree* pStyleSheets = cfg->queryPropTree("StyleSheets");
-    const char* xslt = cfg->queryProp("xslt[@name='atts']");
-    m_attsXSLT.append(getCFD()).append( xslt && *xslt ? xslt : "smc_xslt/atts.xslt");
-
-    xslt = cfg->queryProp("xslt[@name='graphStats']");
-    m_graphStatsXSLT.append(getCFD()).append( xslt && *xslt ? xslt : "smc_xslt/graphStats.xslt");
-}
-
-void CWsRoxieQueryEx::addToQueryString(StringBuffer &queryString, const char *name, const char *value)
-{
-    if (queryString.length() > 0)
-    {
-        queryString.append("&amp;");
-    }
-
-    queryString.append(name);
-    queryString.append("=");
-    queryString.append(value);
-}
-
-void CWsRoxieQueryEx::addToQueryStringFromInt(StringBuffer &queryString, const char *name, int value)
-{
-    if (queryString.length() > 0)
-    {
-        queryString.append("&amp;");
-    }
-
-    queryString.append(name);
-    queryString.append("=");
-    queryString.append(value);
-}
-
-void CWsRoxieQueryEx::getClusterConfig(char const * clusterType, char const * clusterName, char const * processName, StringBuffer& netAddress, int& port)
-{
-    Owned<IEnvironmentFactory> factory = getEnvironmentFactory();
-#if 0
-    Owned<IConstEnvironment> environment = factory->openEnvironment();
-#else
-    Owned<IConstEnvironment> environment = factory->openEnvironmentByFile();
-#endif
-
-    Owned<IPropertyTree> pRoot = &environment->getPTree();
-
-    StringBuffer xpath;
-    xpath.appendf("Software/%s[@name='%s']", clusterType, clusterName);
-
-    IPropertyTree* pCluster = pRoot->queryPropTree( xpath.str() );
-    if (!pCluster)
-        throw MakeStringException(ECLWATCH_CLUSTER_NOT_IN_ENV_INFO, "Failed to get environment information for the cluster '%s %s'.", clusterType, clusterName);
-    xpath.clear().append(processName);
-    xpath.append("@computer");
-    const char* computer = pCluster->queryProp(xpath.str());
-    if (!computer || strlen(computer) < 1)
-        throw MakeStringException(ECLWATCH_CLUSTER_NOT_IN_ENV_INFO, "Failed to get the 'computer' information for the process '%s'. Please check environment settings for the cluster '%s %s'.", processName, clusterType, clusterName);
-
-    xpath.clear().append(processName);
-    xpath.append("@port");
-    const char* portStr = pCluster->queryProp(xpath.str());
-    port = ROXIE_SERVER_PORT;
-    if (portStr && *portStr)
-    {
-        port = atoi(portStr);
-    }
-
-    Owned<IConstMachineInfo> pMachine = environment->getMachine(computer);
-    if (pMachine)
-    {
-        SCMStringBuffer scmNetAddress;
-        pMachine->getNetAddress(scmNetAddress);
-        netAddress = scmNetAddress.str();
-#ifdef MACHINE_IP
-        if (!strcmp(netAddress.str(), "."))
-            netAddress = MACHINE_IP;
-#endif
-    }
-    
-    return;
-}
-
-bool CWsRoxieQueryEx::onRoxieQuerySearch(IEspContext &context, IEspRoxieQuerySearchRequest & req, IEspRoxieQuerySearchResponse & resp)
-{
-    try
-    {
-        if (!context.validateFeatureAccess(FEATURE_URL, SecAccess_Read, false))
-            throw MakeStringException(ECLWATCH_ROXIE_QUERY_ACCESS_DENIED, "Failed to Search Roxie Queries. Permission denied.");
-
-        StringBuffer username;
-        context.getUserID(username);
-        DBGLOG("CWsRoxieQueryEx::onRoxieQuerySearch User=%s",username.str());
-
-        CTpWrapper dummy;
-        IArrayOf<IEspTpCluster> clusters;
-        dummy.getClusterProcessList(eqRoxieCluster, clusters);
-
-        if (clusters.length() <= 0)
-            throw MakeStringException(ECLWATCH_CLUSTER_NOT_IN_ENV_INFO, "Roxie cluster not found.");
-
-        StringArray roxieclusters;
-        ForEachItemIn(k, clusters)
-        {
-            IEspTpCluster& cluster = clusters.item(k);
-            roxieclusters.append(cluster.getName());
-        }
-
-        StringArray ftarray;
-        ftarray.append("Suspended and Non-Suspended");
-        ftarray.append("Non-Suspended Only");
-        ftarray.append("Suspended Only");
-
-        resp.setClusterNames(roxieclusters);
-        resp.setSuspendedSelections(ftarray);
-    }
-    catch(IException* e)
-    {   
-        FORWARDEXCEPTION(context, e, ECLWATCH_INTERNAL_ERROR);
-    }
-    return true;
-}
-
-bool CWsRoxieQueryEx::getAllRoxieQueries(IEspContext &context, const char* cluster, const char* suspended, const char* sortBy, bool descending, __int64 displayEnd, IArrayOf<IEspRoxieQuery>& RoxieQueryList, __int64& totalFiles)
-{
-    int port;
-    StringBuffer netAddress;
-    SocketEndpoint ep;
-    getClusterConfig(ROXIE_CLUSTER, cluster, ROXIE_FARMERPROCESS1, netAddress, port);
-
-    int suspendedFlag = 0;
-    if (suspended && *suspended)
-    {
-        if (stricmp(suspended, "Suspended Only") == 0)
-        {
-            suspendedFlag = 2;
-        }
-        else if (stricmp(suspended, "Non-Suspended Only") == 0)
-        {
-            suspendedFlag = 1;
-        }
-    }
-
-    ep.set(netAddress.str(), port);
-
-    StringBuffer username, password;
-    getUserInformation(context, username, password);
-
-    StringBuffer currentDaliIp;
-    const SocketEndpoint &ep1 = queryCoven().queryComm().queryGroup().queryNode(0).endpoint();
-    ep1.getUrlStr(currentDaliIp);
-
-    LogLevel loglevel = getEspLogLevel(&context);
-    Owned<IRoxieQueryManager> queryManager = createRoxieQueryManager(ep, cluster, currentDaliIp, ROXIEMANAGER_TIMEOUT, username.str(), password.str(), loglevel);
-    Owned<IPropertyTree> result = queryManager->retrieveQueryList("*", false, false, false, false, 0);
-
-    Owned<IPropertyTreeIterator> queries = result->getElements("Query");
-    ForEach(*queries)
-    {
-        IPropertyTree &query = queries->query();
-        const char* id = query.queryProp("@id");
-        const char* wuid = query.queryProp("@wuid");
-        const char* deployedby = query.queryProp("@deployedBy");
-        const char* updatedby = query.queryProp("@suspendedBy");
-        const char* comment = query.queryProp("@comment");
-        const char* error = query.queryProp("@error");
-        bool bSuspended = query.getPropBool("@suspended", false);
-        bool bHighPriority = query.getPropBool("@priority", false);
-        bool bHasAliases = query.getPropBool("@hasAlias", false);
-
-        if (suspendedFlag > 1)
-        {
-            if (!bSuspended) //Suspended Only
-                continue;
-        }
-        else    if (suspendedFlag > 0)
-        {
-            if (bSuspended) //Non-Suspended Only
-                continue;
-        }
-
-        StringBuffer strSuspended, strHighPriority, strHasAliases;
-        if (bSuspended)
-            strSuspended.append("Yes");
-        else
-            strSuspended.append("No");
-        if (bHighPriority)
-            strHighPriority.append("Yes");
-        else
-            strHighPriority.append("No");
-        if (bHasAliases)
-            strHasAliases.append("Yes");
-        else
-            strHasAliases.append("No");
-
-        Owned<IEspRoxieQuery> roxieQuery = createRoxieQuery("","");
-        if (id && *id)
-            roxieQuery->setID(id);
-        if (comment && *comment)
-            roxieQuery->setComment(comment);
-        if (error && *error)
-            roxieQuery->setError("Yes");
-        else
-            roxieQuery->setError("No");
-
-        roxieQuery->setHasAliases(strHasAliases.str());
-        roxieQuery->setSuspended(strSuspended.str());
-        roxieQuery->setHighPriority(strHighPriority.str());
-
-        double version = context.getClientVersion();
-        if (version > 1.00)
-        {
-            if (deployedby && *deployedby)
-                roxieQuery->setDeployedBy(deployedby);
-            if (updatedby && *updatedby)
-                roxieQuery->setUpdatedBy(updatedby);
-        }
-        if (version > 1.01)
-        {
-            if (wuid && *wuid)
-                roxieQuery->setWUID(wuid);
-        }
-
-        __int64 addToPos = -1; //Add to tail
-        if (!sortBy)
-        {
-            addToPos = findPositionInRoxieQueryList(ROXIEQUERYID, id, false, RoxieQueryList);
-        }
-        else if (stricmp(sortBy, "ID")==0)
-        {
-            addToPos = findPositionInRoxieQueryList(ROXIEQUERYID, id, descending, RoxieQueryList);
-        }
-        else if (stricmp(sortBy, "DeployedBy")==0)
-        {
-            if (version > 1.00)
-            {
-                addToPos = findPositionInRoxieQueryList(ROXIEQUERYDEPLOYEDBY, deployedby, descending, RoxieQueryList);
-            }
-        }
-        else if (stricmp(sortBy, "UpdatedBy")==0)
-        {
-            if (version > 1.00)
-            {
-                addToPos = findPositionInRoxieQueryList(ROXIEQUERYUPDATEDBY, updatedby, descending, RoxieQueryList);
-            }
-        }
-        else if (stricmp(sortBy, "WUID")==0)
-        {
-            if (version > 1.01)
-            {
-                addToPos = findPositionInRoxieQueryList(ROXIEQUERYWUID, wuid, descending, RoxieQueryList);
-            }
-        }
-        else if (stricmp(sortBy, "Suspended")==0)
-        {
-            addToPos = findPositionInRoxieQueryList(ROXIEQUERYSUSPENDED, strSuspended.str(), descending, RoxieQueryList);
-        }
-        else if (stricmp(sortBy, "HighPriority")==0)
-        {
-            addToPos = findPositionInRoxieQueryList(ROXIEQUERYHIGHPRIORITY, strHighPriority.str(), descending, RoxieQueryList);
-        }
-        else if (stricmp(sortBy, "Error")==0)
-        {
-            addToPos = findPositionInRoxieQueryList(ROXIEQUERYERROR, error, descending, RoxieQueryList);
-        }
-        else if (stricmp(sortBy, "Comment")==0)
-        {
-            addToPos = findPositionInRoxieQueryList(ROXIEQUERYCOMMENT, comment, descending, RoxieQueryList);
-        }
-        else if (stricmp(sortBy, "HasAliases")==0)
-        {
-            addToPos = findPositionInRoxieQueryList(ROXIEQUERYHASALIASES, strHighPriority.str(), descending, RoxieQueryList);
-        }
-        else
-        {
-            addToPos = findPositionInRoxieQueryList(ROXIEQUERYID, id, false, RoxieQueryList);
-        }
-
-        totalFiles++;
-
-        if (addToPos < 0)
-            RoxieQueryList.append(*roxieQuery.getClear());
-        else
-            RoxieQueryList.add(*roxieQuery.getClear(), (int) addToPos);
-    }
-
-    return true;
-}
-
-bool CWsRoxieQueryEx::onRoxieQueryList(IEspContext &context, IEspRoxieQueryListRequest & req, IEspRoxieQueryListResponse & resp)
-{
-    try
-    {
-        if (!context.validateFeatureAccess(FEATURE_URL, SecAccess_Read, false))
-            throw MakeStringException(ECLWATCH_ROXIE_QUERY_ACCESS_DENIED, "Failed to List Roxie Queries. Permission denied.");
-
-        StringBuffer username;
-        context.getUserID(username);
-        DBGLOG("CWsRoxieQueryEx::onRoxieQueryList User=%s",username.str());
-
-        const char* sortBy = req.getSortby();
-        bool descending = req.getDescending();
-
-        unsigned pagesize = req.getPageSize();
-        if (pagesize < 1)
-        {
-            pagesize = 100;
-        }
-
-        __int64 displayStartReq = 1;
-        if (req.getPageStartFrom() > 0)
-            displayStartReq = req.getPageStartFrom();
-
-        __int64 displayStart = displayStartReq - 1;
-        __int64 displayEnd = displayStart + pagesize;
-
-        StringBuffer size;
-        __int64 totalFiles = 0;
-        IArrayOf<IEspRoxieQuery> RoxieQueryList;
-
-        const char* name = req.getLogicalName();
-        const char* cluster = req.getCluster();
-
-        if (!cluster || !*cluster)
-            throw MakeStringException(ECLWATCH_INVALID_INPUT,"Cluster is not specified for retrieving Roxie queries.");
-
-        getAllRoxieQueries(context, cluster, req.getSuspended(), sortBy, descending, displayEnd, RoxieQueryList, totalFiles);
-
-        resp.setNumFiles(totalFiles);
-        resp.setPageSize(pagesize);
-        resp.setPageStartFrom(displayStart+1);
-        resp.setPageEndAt(displayEnd);
-
-        if (displayStart - pagesize > 0)
-            resp.setPrevPageFrom(displayStart - pagesize + 1);
-        else if(displayStart > 0)
-            resp.setPrevPageFrom(1);
-
-        if(displayEnd < totalFiles)
-        {
-            resp.setNextPageFrom(displayEnd+1);
-            resp.setLastPageFrom(pagesize * (int) floor((double) totalFiles/pagesize) + 1);
-        }
-
-        
-        StringBuffer ParametersForSorting;
-        addToQueryString(ParametersForSorting, "Cluster", cluster);
-        resp.setCluster(cluster);
-
-        if (name && *name)
-        {
-            addToQueryString(ParametersForSorting, "LogicalName", name);
-            resp.setLogicalName(name);
-        }
-        if (req.getSuspended() && *req.getSuspended())
-            addToQueryString(ParametersForSorting, "Suspended", req.getSuspended());
-
-        StringBuffer ParametersForPaging;
-        addToQueryStringFromInt(ParametersForPaging, "PageSize", pagesize);
-
-        descending = false;
-        if (sortBy && *sortBy)
-        {
-            if (req.getDescending())
-                descending = req.getDescending();
-
-            resp.setSortby(sortBy);
-            resp.setDescending(descending);
-
-            addToQueryString(ParametersForPaging, "Sortby", sortBy);
-            if (descending)
-            {
-                addToQueryString(ParametersForPaging, "Descending", "1");
-            }
-        }
-
-        if (ParametersForSorting.length() > 0)
-            resp.setParametersForSorting(ParametersForSorting.str());
-        if (ParametersForPaging.length() > 0)
-            resp.setParametersForPaging(ParametersForPaging.str());
-
-        resp.setRoxieQueries(RoxieQueryList);
-    }
-    catch(IException* e)
-    {   
-        FORWARDEXCEPTION(context, e, ECLWATCH_INTERNAL_ERROR);
-    }
-    return true;
-}
-
-bool CWsRoxieQueryEx::onQueryDetails(IEspContext &context, IEspRoxieQueryDetailsRequest & req, IEspRoxieQueryDetailsResponse & resp)
-{
-    try
-    {
-        if (!context.validateFeatureAccess(FEATURE_URL, SecAccess_Read, false))
-            throw MakeStringException(ECLWATCH_ROXIE_QUERY_ACCESS_DENIED, "Failed to get Query Details. Permission denied.");
-
-        StringBuffer username, password;
-        getUserInformation(context, username, password);
-        DBGLOG("CWsRoxieQueryEx::onQueryDetails User=%s",username.str());
-
-        const char* queryID = req.getQueryID();
-        const char* cluster = req.getCluster();
-        if (!queryID || !*queryID || !cluster || !*cluster)
-        {
-            throw MakeStringException(ECLWATCH_INVALID_INPUT,"Query ID or Cluster is not specified for retrieving query information.");
-        }
-
-        int port;
-        StringBuffer netAddress;
-        SocketEndpoint ep;
-        getClusterConfig(ROXIE_CLUSTER, cluster, ROXIE_FARMERPROCESS1, netAddress, port);
-
-        ep.set(netAddress.str(), port);
-
-        StringBuffer currentDaliIp;
-        const SocketEndpoint &ep1 = queryCoven().queryComm().queryGroup().queryNode(0).endpoint();
-        ep1.getUrlStr(currentDaliIp);
-
-        LogLevel loglevel = getEspLogLevel(&context);
-        Owned<IRoxieQueryManager> queryManager = createRoxieQueryManager(ep, cluster, currentDaliIp, ROXIEMANAGER_TIMEOUT, username.str(), password.str(), loglevel);
-        Owned<IPropertyTree> result = queryManager->retrieveQueryList(queryID, false, false, false, false, 0);
-
-        if (result)
-        {
-            Owned<IPropertyTreeIterator> queries = result->getElements("Query");
-            ForEach(*queries)
-            {
-                IPropertyTree &query = queries->query();
-                const char* wuid = query.queryProp("@wuid");
-                const char* label = query.queryProp("@label");
-                const char* associatedName = query.queryProp("@associatedName");
-                const char* comment = query.queryProp("@comment");
-                const char* error = query.queryProp("@error");
-                const char* deployedby = query.queryProp("@deployedBy");
-                const char* updatedby = query.queryProp("@suspendedBy");
-                bool bSuspended = query.getPropBool("@suspended", false);
-                bool bHighPriority = query.getPropBool("@priority", false);
-                StringBuffer strSuspended, strHighPriority;
-                if (bSuspended)
-                    resp.setSuspended("Yes");
-                else
-                    resp.setSuspended("No");
-                if (bHighPriority)
-                    resp.setHighPriority("Yes");
-                else
-                    resp.setHighPriority("No");
-
-                resp.setQueryID(queryID);
-                resp.setCluster(cluster);
-                if (wuid && *wuid)
-                    resp.setWUID(wuid);
-                if (associatedName && *associatedName)
-                    resp.setAssociatedName(associatedName);
-                if (label && *label)
-                    resp.setLabel(label);
-                if (error && *error)
-                    resp.setError(error);
-                if (comment && *comment)
-                    resp.setComment(comment);
-                    
-                double version = context.getClientVersion();
-                if (version > 1.00)
-                {
-                    if (deployedby && *deployedby)
-                        resp.setDeployedBy(deployedby);
-                    if (updatedby && *updatedby)
-                        resp.setUpdatedBy(updatedby);
-                }
-                break;
-            }
-
-            IArrayOf<IEspRoxieQueryAlias> AliasList;
-            Owned<IPropertyTreeIterator> queries1 = result->getElements("Alias");
-            ForEach(*queries1)
-            {
-                IPropertyTree &query = queries1->query();
-                const char* id = query.queryProp("@id");
-                const char* original = query.queryProp("@original");
-
-                Owned<IEspRoxieQueryAlias> alias = createRoxieQueryAlias("","");
-
-                if (id && *id)
-                    alias->setID(id);
-                if (original && *original)
-                    alias->setOriginal(original);
-
-                AliasList.append(*alias.getClear());
-            }
-
-            resp.setAliases(AliasList);
-        }
-    }
-    catch(IException* e)
-    {   
-        FORWARDEXCEPTION(context, e, ECLWATCH_INTERNAL_ERROR);
-    }
-    return true;
-}
-
-bool CWsRoxieQueryEx::onGVCAjaxGraph(IEspContext &context, IEspGVCAjaxGraphRequest &req, IEspGVCAjaxGraphResponse &resp)
-{
-    resp.setCluster(req.getCluster());
-    resp.setName(req.getName());
-    resp.setGraphName(req.getGraphName());
-    resp.setGraphType("roxiequery");
-    return true;
-}
-bool CWsRoxieQueryEx::onShowGVCGraph(IEspContext &context, IEspShowGVCGraphRequest &req, IEspShowGVCGraphResponse &resp)
-    {
-        const char *queryName = req.getQueryId();
-        if (!queryName || !*queryName)
-            throw MakeStringException(0, "Missing Roxie query name!");
-
-        const char* cluster = req.getCluster();
-
-        int port;
-        StringBuffer netAddress;
-        SocketEndpoint ep;
-        getClusterConfig(ROXIE_CLUSTER, cluster, ROXIE_FARMERPROCESS1, netAddress, port);
-        ep.set(netAddress.str(), port);
-
-        StringArray graphNames;
-        enumerateGraphs(queryName, ep, graphNames);
-
-        char graphName[256];
-        if (req.getGraphName() && *req.getGraphName())
-        {
-            strcpy(graphName, req.getGraphName());
-        }
-        else if (graphNames.length() > 0)
-        {
-            StringBuffer graphName0 = graphNames.item(0);
-            strcpy(graphName, graphName0.str());
-        }
-        else
-        {
-            throw MakeStringException(0, "Graph not found!");
-        }
-
-        Owned<IPropertyTree> pXgmmlGraph = getXgmmlGraph(queryName, ep, graphName);
-
-        StringBuffer xml;
-        toXML(pXgmmlGraph, xml);
-
-        if (xml.length() > 0)
-        {
-            StringBuffer str;
-            encodeUtf8XML(xml.str(), str, 0);
-
-            StringBuffer xml1;
-            xml1.append("<Control>");
-            xml1.append("<Endpoint>");
-            xml1.append("<Query id=\"Gordon.Extractor.0\">");
-            xml1.appendf("<Graph id=\"%s\">", graphName);
-            xml1.append("<xgmml>");
-            xml1.append(str);
-            xml1.append("</xgmml>");
-            xml1.append("</Graph>");
-            xml1.append("</Query>");
-            xml1.append("</Endpoint>");
-            xml1.append("</Control>");
-
-            resp.setTheGraph(xml1);
-        }
-
-        if (graphName && *graphName)
-            resp.setGraphName( graphName );
-        resp.setQueryId( queryName );
-        resp.setGraphNames( graphNames );
-        return true;
-    }
-
-void CWsRoxieQueryEx::enumerateGraphs(const char *queryName, SocketEndpoint &ep, StringArray& graphNames)
-{
-
-    try
-    {
-
-        Owned<IRoxieCommunicationClient> roxieClient = createRoxieCommunicationClient(ep, ROXIEMANAGER_TIMEOUT);
-        Owned<IPropertyTree> result = roxieClient->retrieveQueryStats(queryName, "listGraphNames", NULL, false);
-        IPropertyTree* rootTree = result->queryPropTree("Endpoint/Query");
-
-        if (rootTree)
-        {
-            Owned<IPropertyTreeIterator> graphit = rootTree->getElements("Graph");
-            ForEach(*graphit)
-            {
-                const char* graphName = graphit->query().queryProp("@id");
-                graphNames.append( graphName );
-            }
-        }
-    }
-    catch (IException *e)
-    {
-        StringBuffer errmsg;
-        ERRLOG("Exception when enumerating graphs for %s: %s", queryName, e->errorMessage(errmsg).str());
-        throw e;
-    }
-    catch(...)
-    {
-        ERRLOG("Unknown exception when enumerating graphs for %s", queryName);
-        throw MakeStringException(-1, "Unknown exception while enumerating graphs for %s", queryName);
-    }
-}
-
-IPropertyTree* CWsRoxieQueryEx::getXgmmlGraph(const char *queryName, SocketEndpoint &ep, const char* graphName)
-{
-
-    try
-    {
-        Owned<IRoxieCommunicationClient> roxieClient = createRoxieCommunicationClient(ep, ROXIEMANAGER_TIMEOUT);
-        Owned<IPropertyTree> result = roxieClient->retrieveQueryStats(queryName, "selectGraph", graphName, true);
-
-        StringBuffer xpath;
-        xpath   << "Endpoint/Query/Graph[@id='" 
-                << graphName
-                << "']/xgmml/graph";
-        IPropertyTree* pXgmmlGraph = result->queryPropTree(xpath.str());
-        if (!pXgmmlGraph)
-            throw MakeStringException(-1, "Graph not found!");
-        return LINK( pXgmmlGraph );
-    }
-    catch (IException *e)
-    {
-        StringBuffer errmsg;
-        ERRLOG("Exception when fetching graph %s for %s: %s", graphName, queryName, e->errorMessage(errmsg).str());
-        throw e;
-    }
-    catch(...)
-    {
-        ERRLOG("Unknown exception when fetching graph %s for %s", graphName, queryName);
-        throw MakeStringException(-1, "Unknown exception while generating graph %s for %s", graphName, queryName);
-    }
-}
-
-bool CWsRoxieQueryEx::onRoxieQueryProcessGraph(IEspContext &context, IEspRoxieQueryProcessGraphRequest &req, IEspRoxieQueryProcessGraphResponse &resp)
-{
-    const char* cluster = req.getCluster();
-    const char* graphName = req.getGraphName();
-    const char *queryName = req.getQueryId();
-    if (!queryName || !*queryName)
-        throw MakeStringException(0, "Missing Roxie query name!");
-
-    try
-    {
-        int port;
-        StringBuffer netAddress;
-        SocketEndpoint ep;
-        getClusterConfig(ROXIE_CLUSTER, cluster, ROXIE_FARMERPROCESS1, netAddress, port);
-        ep.set(netAddress.str(), port);
-        Owned<IRoxieCommunicationClient> roxieClient = createRoxieCommunicationClient(ep, ROXIEMANAGER_TIMEOUT);
-
-        Owned<IPropertyTree> xgmml = getXgmmlGraph(queryName, ep, graphName);
-
-        StringBuffer x;
-
-        toXML(xgmml.get(), x);
-        resp.setTheGraph(x.str());
-    }
-    catch (IException *e)
-    {
-        StringBuffer errmsg;
-        ERRLOG("Exception when fetching graph stats %s for %s: %s", graphName, queryName, e->errorMessage(errmsg).str());
-        throw e;
-    }
-    catch(...)
-    {
-        ERRLOG("Unknown exception when fetching graph stats %s for %s", graphName, queryName);
-        throw MakeStringException(-1, "Unknown exception while generating graph %s for %s", graphName, queryName);
-    }
-    return true;
-}

+ 0 - 89
esp/services/ws_roxiequery/ws_roxiequeryservice.hpp

@@ -1,89 +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 _ESPWIZ_WsRoxieQuery_HPP__
-#define _ESPWIZ_WsRoxieQuery_HPP__
-
-#ifdef _WIN32
-    #define FILEVIEW_API __declspec(dllimport)
-#else
-    #define FILEVIEW_API
-#endif
-
-#include "fileview.hpp"
-#include "fvrelate.hpp"
-
-#include "roxiecommlibscm.hpp"
-#include "roxiemanagerscm.hpp"
-
-#include <list>
-#include "WUWrapper.hpp"
-
-#include "ws_roxiequery_esp.ipp"
-
-class CWsRoxieQuerySoapBindingEx : public CWsRoxieQuerySoapBinding
-{
-    StringBuffer m_portalURL;
-public:
-    CWsRoxieQuerySoapBindingEx(IPropertyTree *cfg, const char *name, const char *process, http_soap_log_level llevel=hsl_none) : CWsRoxieQuerySoapBinding(cfg, name, process, llevel)
-    {
-        StringBuffer xpath;
-        xpath.appendf("Software/EspProcess[@name='%s']/@portalurl", process);
-        const char* portalURL = cfg->queryProp(xpath.str());
-        if (portalURL && *portalURL)
-            m_portalURL.append(portalURL);
-    }
-
-    virtual void getNavigationData(IEspContext &context, IPropertyTree & data)
-    {
-    }
-};
-
-
-class CWsRoxieQueryEx : public CWsRoxieQuery
-{
-private:
-    Owned<IXslProcessor> m_xsl;
-    Mutex m_superfilemutex;
-
-    StringBuffer m_attsXSLT;
-    StringBuffer m_graphStatsXSLT;
-
-public:
-    IMPLEMENT_IINTERFACE;
-    virtual ~CWsRoxieQueryEx(){};
-    virtual void init(IPropertyTree *cfg, const char *process, const char *service);
-
-    bool onRoxieQuerySearch(IEspContext &context, IEspRoxieQuerySearchRequest & req, IEspRoxieQuerySearchResponse & resp);
-    bool onRoxieQueryList(IEspContext &context, IEspRoxieQueryListRequest &req, IEspRoxieQueryListResponse &resp);
-    bool onQueryDetails(IEspContext &context, IEspRoxieQueryDetailsRequest & req, IEspRoxieQueryDetailsResponse & resp);
-    bool onGVCAjaxGraph(IEspContext &context, IEspGVCAjaxGraphRequest &req, IEspGVCAjaxGraphResponse &resp);
-    bool onShowGVCGraph(IEspContext &context, IEspShowGVCGraphRequest &req, IEspShowGVCGraphResponse &resp);
-    bool onRoxieQueryProcessGraph(IEspContext &context, IEspRoxieQueryProcessGraphRequest &req, IEspRoxieQueryProcessGraphResponse &resp);
-
-private:
-    void addToQueryString(StringBuffer &queryString, const char *name, const char *value);
-    void addToQueryStringFromInt(StringBuffer &queryString, const char *name, int value);
-    void getClusterConfig(char const * clusterType, char const * clusterName, char const * processName, StringBuffer& netAddress, int& port);
-
-    bool getAllRoxieQueries(IEspContext &context, const char* cluster, const char* suspended, const char* sortBy, bool descending, __int64 displayEnd, IArrayOf<IEspRoxieQuery>& RoxieQueryList, __int64& totalFiles);
-    IPropertyTree* getXgmmlGraph(const char *queryName, SocketEndpoint &ep, const char* graphName);
-    void enumerateGraphs(const char *queryName, SocketEndpoint &ep, StringArray& graphNames);
-};
-
-#endif //_ESPWIZ_WsRoxieQuery_HPP__
-

+ 0 - 1
esp/services/ws_smc/CMakeLists.txt

@@ -96,7 +96,6 @@ target_link_libraries ( ws_smc
          ws_fs 
          ws_topology 
          schedulectrl 
-         roxiemanager 
          ws_workunits 
     )
 IF (USE_OPENLDAP)

+ 0 - 2
esp/services/ws_workunits/CMakeLists.txt

@@ -49,7 +49,6 @@ include_directories (
          ./../../platform
          ./../../../dali/dfu
          ./../../../dali/sasha
-         ./../../../common/roxiemanager
          ./../../../common/remote
          ./../../../system/jlib
          ./../../../common/environment
@@ -101,7 +100,6 @@ target_link_libraries ( ws_workunits
          SMCLib
          schedulectrl
          roxiecommlib
-         roxiemanager
          hql
          jhtree
          fileview2

+ 0 - 18
esp/services/ws_workunits/roxiequeryhandler.cpp

@@ -1,18 +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.
-############################################################################## */
-
-// no longer needed - code moved to roxiemanager

+ 0 - 18
esp/services/ws_workunits/roxiequeryhandler.hpp

@@ -1,18 +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.
-############################################################################## */
-
-// no longer needed - code moved to roxiemanager

+ 0 - 1
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -34,7 +34,6 @@
 #include "dllserver.hpp"
 #include "schedulectrl.hpp"
 #include "scheduleread.hpp"
-#include "roxiemanager.hpp"
 #include "dadfs.hpp"
 #include "dfuwu.hpp"
 #include "thorplugin.hpp"

+ 0 - 26
initfiles/componentfiles/configxml/@temp/esp_service_WsSMC.xsl

@@ -438,32 +438,6 @@ This is required by its binding with ESP service '<xsl:value-of select="$espServ
         </EspBinding>
     </xsl:template>
     
-    <!-- WS-ROXIEQUERY -->
-    <xsl:template match="EspService" mode="WsRoxieQuery">
-        <xsl:param name="bindingNode"/>
-        <xsl:param name="authNode"/>
-
-        <xsl:variable name="serviceType" select="'WsRoxieQuery'"/>
-        <xsl:variable name="serviceName" select="concat($serviceType, '_', @name, '_', $process)"/>
-        <xsl:variable name="bindName" select="concat($serviceType, '_', $bindingNode/@name, '_', $process)"/>
-        <xsl:variable name="bindType" select="'WsRoxieQuery'"/>
-        <xsl:variable name="servicePlugin">
-            <xsl:call-template name="defineServicePlugin">
-                <xsl:with-param name="plugin" select="'ws_roxiequery'"/>
-            </xsl:call-template>
-        </xsl:variable>
-
-
-        <EspService name="{$serviceName}" type="{$serviceType}" plugin="{$servicePlugin}"/>
-        <EspBinding name="{$bindName}" service="{$serviceName}" protocol="{$bindingNode/@protocol}" type="{$bindType}" plugin="{$servicePlugin}" netAddress="0.0.0.0" port="{$bindingNode/@port}">
-            <xsl:call-template name="bindAuthentication">
-                <xsl:with-param name="bindingNode" select="$bindingNode"/>
-                <xsl:with-param name="authMethod" select="$authNode/@method"/>
-                <xsl:with-param name="service" select="'ws_roxiequery'"/>
-            </xsl:call-template>
-        </EspBinding>
-    </xsl:template>
-
     <!-- ws_machine-->
     <xsl:template match="EspService" mode="ws_machine">
         <xsl:param name="bindingNode"/>

+ 0 - 4
initfiles/componentfiles/configxml/buildsetCC.xml.in

@@ -169,10 +169,6 @@
                           path="WsEclAccess"
                           resource="WsEclAccess"
                           service="ws_ecl"/>
-     <AuthenticateFeature description="Access to Roxie queries and files"
-                          path="RoxieQueryAccess"
-                          resource="RoxieQueryAccess"
-                          service="ws_roxiequery"/>
      <AuthenticateFeature description="Access to cluster topology"
                           path="ClusterTopologyAccess"
                           resource="ClusterTopologyAccess"