本文整理汇总了C++中CIMNamespaceName::equal方法的典型用法代码示例。如果您正苦于以下问题:C++ CIMNamespaceName::equal方法的具体用法?C++ CIMNamespaceName::equal怎么用?C++ CIMNamespaceName::equal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIMNamespaceName
的用法示例。
在下文中一共展示了CIMNamespaceName::equal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: verifyNamespace
//
// Check if a given namespace exists
//
Boolean AuthorizationHandler::verifyNamespace(
const CIMNamespaceName& nameSpace)
{
PEG_METHOD_ENTER(
TRC_AUTHORIZATION, "AuthorizationHandler::verifyNamespace()");
try
{
//
// call enumerateNameSpaces to get all the namespaces
// in the repository
//
Array<CIMNamespaceName> namespaceNames =
_repository->enumerateNameSpaces();
//
// check for the given namespace
//
Uint32 size = namespaceNames.size();
for (Uint32 i = 0; i < size; i++)
{
if (nameSpace.equal (namespaceNames[i]))
{
PEG_METHOD_EXIT();
return true;
}
}
}
catch (Exception& e)
{
PEG_METHOD_EXIT();
throw InvalidNamespace(nameSpace.getString() + e.getMessage());
}
PEG_METHOD_EXIT();
return false;
}
示例2: deleteInstance
void NamespaceProvider::deleteInstance(
const OperationContext & context,
const CIMObjectPath & instanceName,
ResponseHandler & handler)
{
PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "NamespaceProvider::deleteInstance");
CIMNamespaceName childNamespaceName;
CIMNamespaceName deleteNamespaceName;
Boolean isRelativeName;
// Verify that the className = __namespace
if (!instanceName.getClassName().equal(NAMESPACE_CLASSNAME))
{
PEG_METHOD_EXIT();
//l10n
//throw CIMNotSupportedException(instanceName.getClassName().getString()
//+ " not supported by Namespace Provider");
throw CIMNotSupportedException(MessageLoaderParms(
"ControlProviders.NamespaceProvider.NamespaceProvider.NOT_SUPPORTED_BY_NAMESPACEPROVIDER",
"$0 not supported by Namespace Provider",
instanceName.getClassName().getString()));
}
//ATTN-DME-P3-20020522: ADD AUTHORIZATION CHECK TO __NAMESPACE PROVIDER
String userName;
try
{
IdentityContainer container = context.get(IdentityContainer::NAME);
userName = container.getUserName();
}
catch (...)
{
userName = String::EMPTY;
}
_getKeyValue(instanceName, childNamespaceName, isRelativeName);
CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();
PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
"childNamespaceName = " + childNamespaceName.getString() +
(isRelativeName?String("true"):String("false")) +
", parentNamespaceName = " + parentNamespaceName.getString());
// begin processing the request
handler.processing();
try
{
Array<CIMNamespaceName> namespaceNames;
namespaceNames = _repository->enumerateNameSpaces();
_generateFullNamespaceName(namespaceNames, parentNamespaceName,
childNamespaceName, isRelativeName,
deleteNamespaceName);
if (deleteNamespaceName.equal (ROOTNS))
{
//l10n
//throw CIMNotSupportedException("root namespace may be deleted.");
throw CIMNotSupportedException(MessageLoaderParms(
"ControlProviders.NamespaceProvider.NamespaceProvider.ROOT_NAMESPACE_CANNOT_BE_DELETED",
"root namespace may be deleted."));
}
_repository->deleteNameSpace(deleteNamespaceName);
PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
"Namespace = " + deleteNamespaceName.getString() +
" successfully deleted.");
}
catch(const CIMException&)
{
PEG_METHOD_EXIT();
throw;
}
catch(const Exception&)
{
PEG_METHOD_EXIT();
throw;
}
// complete processing the request
handler.complete();
PEG_METHOD_EXIT();
return ;
}