本文整理汇总了C++中IEspContext::queryPassword方法的典型用法代码示例。如果您正苦于以下问题:C++ IEspContext::queryPassword方法的具体用法?C++ IEspContext::queryPassword怎么用?C++ IEspContext::queryPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEspContext
的用法示例。
在下文中一共展示了IEspContext::queryPassword方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onAddPackage
bool CWsPackageProcessEx::onAddPackage(IEspContext &context, IEspAddPackageRequest &req, IEspAddPackageResponse &resp)
{
PackageMapUpdater updater;
updater.setFlag(PKGADD_MAP_CREATE);
updater.setFlag(PKGADD_MAP_ACTIVATE, req.getActivate());
updater.setFlag(PKGADD_MAP_REPLACE, req.getOverWrite());
updater.setFlag(PKGADD_ALLOW_FOREIGN, req.getAllowForeignFiles());
updater.setFlag(PKGADD_PRELOAD_ALL, req.getPreloadAllPackages());
updater.setPMID(req.getTarget(), req.getPackageMap(), req.getGlobalScope());
updater.setProcess(req.getProcess());
updater.setUser(context.queryUserId(), context.queryPassword());
updater.setDerivedDfsLocation(req.getDaliIp(), req.getSourceProcess());
unsigned updateFlags = 0;
if (req.getOverWrite())
updateFlags |= (DALI_UPDATEF_PACKAGEMAP | DALI_UPDATEF_REPLACE_FILE | DALI_UPDATEF_CLONE_FROM | DALI_UPDATEF_SUPERFILES);
if (req.getReplacePackageMap())
updateFlags |= DALI_UPDATEF_PACKAGEMAP;
if (req.getUpdateCloneFrom())
updateFlags |= DALI_UPDATEF_CLONE_FROM;
if (req.getUpdateSuperFiles())
updateFlags |= DALI_UPDATEF_SUPERFILES;
if (req.getAppendCluster())
updateFlags |= DALI_UPDATEF_APPEND_CLUSTER;
StringArray filesNotFound;
updater.create(req.getPackageMap(), req.getInfo(), updateFlags, filesNotFound);
resp.setFilesNotFound(filesNotFound);
resp.updateStatus().setCode(0);
resp.updateStatus().setDescription(StringBuffer("Successfully loaded ").append(req.getPackageMap()));
return true;
}
示例2: onAddPackage
bool CWsPackageProcessEx::onAddPackage(IEspContext &context, IEspAddPackageRequest &req, IEspAddPackageResponse &resp)
{
resp.updateStatus().setCode(0);
StringAttr target(req.getTarget());
StringAttr name(req.getPackageMap());
if (target.isEmpty())
throw MakeStringExceptionDirect(PKG_MISSING_PARAM, "Target cluster parameter required");
if (name.isEmpty())
throw MakeStringExceptionDirect(PKG_MISSING_PARAM, "PackageMap name parameter required");
DBGLOG("%s adding packagemap %s to target %s", context.queryUserId(), name.str(), target.str());
StringBuffer pmid;
if (!req.getGlobalScope())
pmid.append(target).append("::");
pmid.append(name.get());
bool activate = req.getActivate();
unsigned updateFlags = 0;
if (req.getOverWrite())
updateFlags |= (DALI_UPDATEF_PACKAGEMAP | DALI_UPDATEF_REPLACE_FILE | DALI_UPDATEF_CLONE_FROM | DALI_UPDATEF_SUPERFILES);
if (req.getReplacePackageMap())
updateFlags |= DALI_UPDATEF_PACKAGEMAP;
if (req.getUpdateCloneFrom())
updateFlags |= DALI_UPDATEF_CLONE_FROM;
if (req.getUpdateSuperFiles())
updateFlags |= DALI_UPDATEF_SUPERFILES;
if (req.getAppendCluster())
updateFlags |= DALI_UPDATEF_APPEND_CLUSTER;
StringAttr processName(req.getProcess());
Owned<IUserDescriptor> userdesc;
const char *user = context.queryUserId();
const char *password = context.queryPassword();
if (user && *user && *password && *password)
{
userdesc.setown(createUserDescriptor());
userdesc->set(user, password);
}
StringBuffer srcCluster;
StringBuffer daliip;
StringBuffer prefix;
splitDerivedDfsLocation(req.getDaliIp(), srcCluster, daliip, prefix, req.getSourceProcess(), req.getSourceProcess(), NULL, NULL);
StringBuffer pkgSetId;
buildPkgSetId(pkgSetId, processName.get());
StringArray filesNotFound;
addPackageMapInfo(updateFlags, req.getInfo(), filesNotFound, processName, target, pmid, pkgSetId, daliip, srcCluster, prefix, activate, userdesc, req.getAllowForeignFiles(), req.getPreloadAllPackages());
resp.setFilesNotFound(filesNotFound);
StringBuffer msg;
msg.append("Successfully loaded ").append(name.get());
resp.updateStatus().setDescription(msg.str());
return true;
}
示例3: onAddPackage
bool CWsPackageProcessEx::onAddPackage(IEspContext &context, IEspAddPackageRequest &req, IEspAddPackageResponse &resp)
{
resp.updateStatus().setCode(0);
StringAttr target(req.getTarget());
StringAttr name(req.getPackageMap());
if (target.isEmpty())
throw MakeStringExceptionDirect(PKG_MISSING_PARAM, "Target cluster parameter required");
if (name.isEmpty())
throw MakeStringExceptionDirect(PKG_MISSING_PARAM, "PackageMap name parameter required");
StringBuffer pmid;
if (!req.getGlobalScope())
pmid.append(target).append("::");
pmid.append(name.get());
bool activate = req.getActivate();
bool overWrite = req.getOverWrite();
StringAttr processName(req.getProcess());
Owned<IUserDescriptor> userdesc;
const char *user = context.queryUserId();
const char *password = context.queryPassword();
if (user && *user && *password && *password)
{
userdesc.setown(createUserDescriptor());
userdesc->set(user, password);
}
StringBuffer srcCluster;
StringBuffer daliip;
StringBuffer prefix;
splitDerivedDfsLocation(req.getDaliIp(), srcCluster, daliip, prefix, req.getSourceProcess(), req.getSourceProcess(), NULL, NULL);
StringBuffer pkgSetId;
buildPkgSetId(pkgSetId, processName.get());
StringArray filesNotFound;
addPackageMapInfo(req.getInfo(), filesNotFound, processName, target, pmid, pkgSetId, daliip, srcCluster, prefix, activate, overWrite, userdesc, req.getAllowForeignFiles(), req.getPreloadAllPackages());
resp.setFilesNotFound(filesNotFound);
StringBuffer msg;
msg.append("Successfully loaded ").append(name.get());
resp.updateStatus().setDescription(msg.str());
return true;
}
示例4: onRunEcl
bool CEclDirectEx::onRunEcl(IEspContext &context, IEspRunEclRequest & req, IEspRunEclResponse & resp)
{
if (!context.validateFeatureAccess(ECLDIRECT_ACCESS, SecAccess_Full, false))
throw MakeStringException(-1, "EclDirect access permission denied.");
StringBuffer user;
if (!context.getUserID(user).length())
user.append(req.getUserName());
Owned <IWorkUnitFactory> factory = getWorkUnitFactory(context.querySecManager(), context.queryUser());
Owned <IWorkUnit> workunit;
if (!user.length())
workunit.setown(factory->createWorkUnit(NULL, "ECL-Direct", ""));
else
{
workunit.setown(factory->createWorkUnit(NULL, "ECL-Direct", user.str()));
workunit->setUser(user.str());
}
Owned<IWUQuery> query = workunit->updateQuery();
query->setQueryText(req.getEclText());
query.clear();
const char* clustername = req.getCluster();
if (!clustername || !*clustername || strieq(clustername, "default"))
clustername = defaultCluster.str();
if (!clustername || !*clustername)
throw MakeStringException(-1, "No Cluster Specified");
if (!isValidCluster(clustername))
throw MakeStringException(-1, "Invalid TargetCluster %s Specified", clustername);
workunit->setClusterName(clustername);
if (req.getLimitResults())
workunit->setResultLimit(100);
const char* snapshot = req.getSnapshot();
if (snapshot && *snapshot)
workunit->setSnapshot(snapshot);
// Execute it
SCMStringBuffer wuid;
workunit->getWuid(wuid);
workunit->setAction(WUActionRun);
workunit->setState(WUStateSubmitted);
workunit.clear();
submitWorkUnit(wuid.str(), context.querySecManager(), context.queryUser());
if (waitForWorkUnitToComplete(wuid.str(), defaultWait))
{
Owned<IConstWorkUnit> cw = factory->openWorkUnit(wuid.str(), false);
SCMStringBuffer resultXML;
getFullWorkUnitResultsXML(context.queryUserId(), context.queryPassword(), cw.get(), resultXML);
resp.setResults(resultXML.str());
cw.clear();
if (deleteWorkunits)
deleteEclDirectWorkunit(factory, wuid.str());
}
else
{
// Don't delete these ones...
DBGLOG("WorkUnit %s timed out", wuid.str());
StringBuffer result;
result.appendf("<Exception><Source>ESP</Source><Message>Timed out waiting for job to complete: %s</Message></Exception>", wuid.str());
resp.setResults(result.str());
}
return true;
}
示例5: onGetInstantQuery
int CFileSpraySoapBindingEx::onGetInstantQuery(IEspContext &context, CHttpRequest* request, CHttpResponse* response, const char *service, const char *method)
{
bool permission = true;
bool bDownloadFile = false;
bool bProcess;
StringBuffer sourceLogicalFile;
StringBuffer methodbuf;
StringBuffer submethod;
StringBuffer xsltFileName(getCFD());
xsltFileName.append("smc_xslt/");
if (stricmp(method, "SprayFixedInput")==0)
{
if (!context.validateFeatureAccess(FILE_SPRAY_URL, SecAccess_Write, false))
permission = false;
bProcess = true;
xsltFileName.append("fs_sprayForm.xslt");
methodbuf.append("SprayFixed");
}
else if(stricmp(method, "SprayVariableInput")==0)
{
if (!context.validateFeatureAccess(FILE_SPRAY_URL, SecAccess_Write, false))
permission = false;
bProcess = true;
xsltFileName.append("fs_sprayForm.xslt");
methodbuf.append("SprayVariable");
request->getParameter("submethod", submethod);
}
else if (stricmp(method, "DesprayInput")==0)
{
if (!context.validateFeatureAccess(FILE_DESPRAY_URL, SecAccess_Write, false))
permission = false;
request->getParameter("sourceLogicalName", sourceLogicalFile);
xsltFileName.append("fs_desprayCopyForm.xslt");
methodbuf.append("Despray");
bProcess = true;
}
else if (stricmp(method, "CopyInput") == 0)
{
if (!context.validateFeatureAccess(FILE_SPRAY_URL, SecAccess_Write, false))
permission = false;
request->getParameter("sourceLogicalName", sourceLogicalFile);
xsltFileName.append("fs_desprayCopyForm.xslt");
methodbuf.append("Copy");
bProcess = true;
}
else if (stricmp(method, "RenameInput") == 0)
{
if (!context.validateFeatureAccess(FILE_SPRAY_URL, SecAccess_Write, false))
permission = false;
request->getParameter("sourceLogicalName", sourceLogicalFile);
xsltFileName.append("fs_renameForm.xslt");
methodbuf.append("Rename");
bProcess = true;
}
else if (stricmp(method, "DownloadFile") == 0)
{
if (!context.validateFeatureAccess(FILE_SPRAY_URL, SecAccess_Full, false))
permission = false;
downloadFile(context, request, response);
bDownloadFile = true;
bProcess = true;
}
else
bProcess = false;
if (bProcess)
{
if (bDownloadFile)
return 0;
StringBuffer xml;
Owned<IProperties> params(createProperties());
if (!permission)
{
params->setProp("@method", methodbuf.str());
xml.append("<Environment><ErrorMessage>Permission denied.</ErrorMessage></Environment>");
}
else
{
if(submethod.length() > 0)
params->setProp("@submethod", submethod.str());
params->setProp("@method", methodbuf.str());
if (*sourceLogicalFile.str())
{
params->setProp("@sourceLogicalName", sourceLogicalFile.str());
Owned<IUserDescriptor> userdesc;
StringBuffer username;
context.getUserID(username);
if(username.length() > 0)
{
const char* passwd = context.queryPassword();
//.........这里部分代码省略.........