本文整理汇总了C++中MgCommand::GetWarningObject方法的典型用法代码示例。如果您正苦于以下问题:C++ MgCommand::GetWarningObject方法的具体用法?C++ MgCommand::GetWarningObject怎么用?C++ MgCommand::GetWarningObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MgCommand
的用法示例。
在下文中一共展示了MgCommand::GetWarningObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnumerateResourceDocuments
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerate the resource documents in the specified repository.
///
STRING MgProxyResourceService::EnumerateResourceDocuments(
MgStringCollection* resources, CREFSTRING type, INT32 properties)
{
STRING resourceList;
MgCommand cmd;
MG_TRY()
cmd.ExecuteCommand(
m_connProp, // Connection
MgCommand::knString, // Return type
MgResourceService::opIdEnumerateResourceDocuments, // Command code
3, // Number of arguments
Resource_Service, // Service ID
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knObject, resources, // Argument #1
MgCommand::knString, &type, // Argument #2
MgCommand::knInt32, properties, // Argument #3
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
resourceList = *(cmd.GetReturnValue().val.m_str);
delete cmd.GetReturnValue().val.m_str;
MG_CATCH_AND_THROW(L"MgProxyResourceService.EnumerateResourceDocuments")
return resourceList;
}
示例2: EnumerateResources
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerates the resources in the specified repository.
/// Resources of all types can be enumerated all at once, or only
/// resources of a given type.
///
MgByteReader* MgProxyResourceService::EnumerateResources(
MgResourceIdentifier* resource, INT32 depth, CREFSTRING type,
INT32 properties, CREFSTRING fromDate, CREFSTRING toDate, bool computeChildren)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp,
MgCommand::knObject,
MgResourceService::opIdEnumerateResources,
7,
Resource_Service,
BUILD_VERSION(1,0,0),
MgCommand::knObject, resource,
MgCommand::knInt32, depth,
MgCommand::knString, &type,
MgCommand::knInt32, properties,
MgCommand::knString, &fromDate,
MgCommand::knString, &toDate,
MgCommand::knInt8, (int)computeChildren,
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
示例3: EnumerateParentMapDefinitions
///////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerate all the parent Map Definition resources of the specified
/// resources.
///
MgSerializableCollection* MgProxyResourceService::EnumerateParentMapDefinitions(
MgSerializableCollection* resources)
{
MgCommand cmd;
MG_TRY()
assert(m_connProp != NULL);
cmd.ExecuteCommand(
m_connProp, // Connection
MgCommand::knObject, // Return type
MgResourceService::opIdEnumerateParentMapDefinitions, // Command code
1, // Number of arguments
Resource_Service, // Service ID
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knObject, resources, // Argument #1
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
MG_CATCH_AND_THROW(L"MgProxyResourceService.EnumerateParentMapDefinitions")
return (MgSerializableCollection*)cmd.GetReturnValue().val.m_obj;
}
示例4: GetResourceContents
///////////////////////////////////////////////////////////////////////////
/// \brief
/// Gets the contents of the specified resources.
///
MgStringCollection* MgProxyResourceService::GetResourceContents(MgStringCollection* resources,
MgStringCollection* preProcessTags)
{
Ptr<MgStringCollection> resourceContents;
MG_TRY()
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knObject, // Return type expected
MgResourceService::opIdGetResourceContents, // Command Code
2, // Count of arguments
Resource_Service, // Service Id
BUILD_VERSION(2,2,0), // Operation version
MgCommand::knObject, resources, // Argument#1
MgCommand::knObject, preProcessTags, // Argument#2
MgCommand::knNone); // End of argument
SetWarning(cmd.GetWarningObject());
resourceContents = (MgStringCollection*)cmd.GetReturnValue().val.m_obj;
// Decrypt the document if Substitution pre-processing is required.
if(preProcessTags != NULL && resourceContents != NULL && preProcessTags->GetCount() == resourceContents->GetCount())
{
for(INT32 i = 0; i < resourceContents->GetCount(); i ++)
{
STRING tag = preProcessTags->GetItem(i);
if (MgResourcePreProcessingType::Substitution == tag)
{
STRING cipherContent = resourceContents->GetItem(i);
string cipherText, plainText;
MgUtil::WideCharToMultiByte(cipherContent, cipherText);
MG_CRYPTOGRAPHY_TRY()
MgCryptographyUtil cryptoUtil;
cryptoUtil.DecryptString(cipherText, plainText);
MG_CRYPTOGRAPHY_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceContents")
STRING decryptedContent;
MgUtil::MultiByteToWideChar(plainText, decryptedContent);
resourceContents->SetItem(i, decryptedContent);
}
}
}
MG_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceContents")
return resourceContents.Detach();
}
示例5: GetResourceData
///////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Returns tagged data for the specified resource.
/// </summary>
/// <param name="resource">
/// Resource identifier describing the resource.
/// </param>
/// <param name="dataName">
/// Name for data. Either a resource-unique stream name for streams or a
/// resource-unique file name for file data.
/// </param>
/// <param name="preProcessTags">
/// Pre-processing to apply to resource data before returning. An empty
/// string indicate no pre-processing. See MgResourcePreProcessingType for
/// a list of supported pre-processing tags.
/// </param>
/// <returns>
/// MgByteReader containing the previously updated or added tagged data.
/// </returns>
/// EXCEPTIONS:
/// MgRepositoryNotOpenException
///
/// MgResourceDataNotFoundException
/// MgInvalidResourceTypeException
///
MgByteReader* MgProxyResourceService::GetResourceData(
MgResourceIdentifier* resource, CREFSTRING dataName,
CREFSTRING preProcessTags)
{
Ptr<MgByteReader> byteReader;
MG_TRY()
MgCommand cmd;
cmd.ExecuteCommand(m_connProp,
MgCommand::knObject,
MgResourceService::opIdGetResourceData,
3,
Resource_Service,
BUILD_VERSION(1,0,0),
MgCommand::knObject, resource,
MgCommand::knString, &dataName,
MgCommand::knString, &preProcessTags,
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
byteReader = (MgByteReader*)cmd.GetReturnValue().val.m_obj;
// Decrypt the document if Substitution pre-processing is required.
if (MgResourcePreProcessingType::Substitution == preProcessTags
&& byteReader != NULL)
{
STRING mimeType = byteReader->GetByteSource()->GetMimeType();
string cipherText, plainText;
byteReader->ToStringUtf8(cipherText);
MG_CRYPTOGRAPHY_TRY()
MgCryptographyUtil cryptoUtil;
cryptoUtil.DecryptString(cipherText, plainText);
MG_CRYPTOGRAPHY_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceData")
Ptr<MgByteSource> byteSource = new MgByteSource(
(BYTE_ARRAY_IN)plainText.c_str(), (INT32)plainText.length());
byteSource->SetMimeType(mimeType);
byteReader = byteSource->GetReader();
}
MG_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceData")
return byteReader.Detach();
}
示例6: TakeOffline
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Prevents the server from processing client operations. When offline, the
/// adminstrator can access the server via "Admin" operations without worrying
/// about Mg clients using the server.
/// </summary>
/// <returns>
/// Nothing
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
void MgServerAdmin::TakeOffline()
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knVoid, // Return type expected
MgServerAdminServiceOpId::TakeOffline, // Command Code
0, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
}
示例7: SetMaximumLogSize
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Specifies the maximum size in kilobytes for the log files. When the maximum
/// size is exceeded, the current log will be archived, and a new log will be created.
///
/// </summary>
/// <returns>
/// Nothing
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
void MgServerAdmin::SetMaximumLogSize(INT32 size)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knVoid, // Return type expected
MgServerAdminServiceOpId::SetMaximumLogSize, // Command Code
1, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knInt32, size, // Argument#1
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
}
示例8: DeletePackage
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Delete the specified package, if able.
/// </summary>
///
/// <param name="packageName">
/// The name of the package to be deleted. Available packages can be found by
/// using EnumeratePackages().
/// </param>
///
/// <returns>
/// Nothing.
/// </returns>
///
/// EXCEPTIONS:
/// MgInvalidArgumentException
/// MgFileIoException
/// MgFileNotFoundException
void MgServerAdmin::DeletePackage(CREFSTRING packageName)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knVoid, // Return type expected
MgServerAdminServiceOpId::DeletePackage,// Command Code
1, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knString, &packageName, // Argument #1
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
}
示例9: IsOnline
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the online status of the server.
/// </summary>
/// <returns>
/// True for online, False for offline.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
bool MgServerAdmin::IsOnline()
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knInt8, // Return type expected
MgServerAdminServiceOpId::IsOnline, // Command Code
0, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (bool)cmd.GetReturnValue().val.m_i8;
}
示例10: DeleteResource
//////////////////////////////////////////////////////////////////
/// <summary>
/// Deletes an existing resource
/// </summary>
/// <param name="resource">
/// Resource identifier describing the resource to delete
/// </param>
/// EXCEPTIONS:
/// MgInvalidResourceTypeException
void MgProxyResourceService::DeleteResource(MgResourceIdentifier* resource)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp,
MgCommand::knVoid,
MgResourceService::opIdDeleteResource,
1,
Resource_Service,
BUILD_VERSION(1,0,0),
MgCommand::knObject, resource,
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
}
示例11: RemoveConfigurationProperties
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Removes the configuration properties for the specified property section.
/// If the properties are not specified, then the entire section will be removed.
/// </summary>
/// <param name="propertySection">
/// The property section to set.
/// </param>
/// <param name="properties">
/// The collection of configuration properties associated with the specified property section that you want to remove.
/// </param>
/// <returns>
/// Nothing
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidPropertySectionException
/// MgPropertySectionNotAvailableException
/// MgPropertySectionReadOnlyException
/// MgInvalidPropertyException
void MgServerAdmin::RemoveConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knVoid, // Return type expected
MgServerAdminServiceOpId::RemoveConfigurationProperties, // Command Code
2, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knString, &propertySection, // Argument#1
MgCommand::knObject, properties, // Argument#2
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
}
示例12: SetDocument
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Sets the contents of the specified document.
/// </summary>
/// <param name="identifier">
/// The document to set.
/// </param>
/// <param name="data">
/// The data to set the document contents to.
/// </param>
/// <returns>
/// Nothing
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidArgumentException
/// MgNullReferenceException
/// MgOutOfMemoryException
void MgServerAdmin::SetDocument(CREFSTRING identifier, MgByteReader* data)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knVoid, // Return type expected
MgServerAdminServiceOpId::SetDocument, // Command Code
2, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knString, &identifier, // Argument#1
MgCommand::knObject, data, // Argument#2
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
}
示例13: EnumeratePackages
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Enumerates the packages available in the package directory.
/// </summary>
///
/// <returns>
/// An MgStringCollection containing a list of packages in the packages directory
/// </returns>
///
/// EXCEPTIONS:
/// MgOutOfMemoryException
/// MgFileNotFoundException
/// MgFileIoException
MgStringCollection* MgServerAdmin::EnumeratePackages()
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knObject, // Return type expected
MgServerAdminServiceOpId::EnumeratePackages, // Command Code
0, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (MgStringCollection*)cmd.GetReturnValue().val.m_obj;
}
示例14: GetPackageLog
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets current log of the specified package
/// </summary>
///
/// <param name="packageName">
/// The name of the package to get the status for. Available packages can be
/// found by using EnumeratePackages().
/// </param>
///
/// <returns>
/// An MgByteReader containing the contents of the package's log.
/// </returns>
///
/// EXCEPTIONS:
/// MgFileNotFoundException
/// MgFileIoException
/// MgInvalidArgumentException
/// MgOutOfMemoryException
MgByteReader* MgServerAdmin::GetPackageLog(CREFSTRING packageName)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knObject, // Return type expected
MgServerAdminServiceOpId::GetPackageLog, // Command Code
1, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knString, &packageName, // Argument #1
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
示例15: ClearLog
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Clears the specified log.
/// </summary>
/// <param name="log">
/// The log to be cleared. (AccessLog, AdminLog, AuthenticationLog, ErrorLog,
/// SessionLog, TraceLog)
/// </param>
/// <returns>
/// True if the log was successfully cleared, false otherwise.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidArgumentException
/// MgNullReferenceException
bool MgServerAdmin::ClearLog(CREFSTRING log)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knInt8, // Return type expected
MgServerAdminServiceOpId::ClearLog, // Command Code
1, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knString, &log, // Argument#1
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (bool)cmd.GetReturnValue().val.m_i8;
}