本文整理汇总了C++中CIMNamespaceName类的典型用法代码示例。如果您正苦于以下问题:C++ CIMNamespaceName类的具体用法?C++ CIMNamespaceName怎么用?C++ CIMNamespaceName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CIMNamespaceName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _generateFullNamespaceName
void _generateFullNamespaceName(
Array<CIMNamespaceName>& namespaceNames,
CIMNamespaceName& parentNamespaceName,
CIMNamespaceName& childNamespaceName,
Boolean isRelativeName,
CIMNamespaceName& fullNamespaceName)
{
// If isRelativeName is true, then the parentNamespace
// MUST exist
//
if (isRelativeName)
{
if (!Contains(namespaceNames, parentNamespaceName))
{
//l10n
//throw CIMObjectNotFoundException("Parent namespace does not exist: "
//+ parentNamespaceName.getString());
throw CIMObjectNotFoundException(MessageLoaderParms(
"ControlProviders.NamespaceProvider.NamespaceProvider.PARENT_NAMESPACE_DOES_NOT_EXIST",
"Parent namespace does not exist: $0",
parentNamespaceName.getString()));
}
// Create full namespace name by prepending parentNamespaceName
fullNamespaceName = CIMNamespaceName (parentNamespaceName.getString()
+ "/" + childNamespaceName.getString());
}
else
{
fullNamespaceName = parentNamespaceName;
}
}
示例2: _isChild
Boolean _isChild(
CIMNamespaceName& parentNamespaceName,
CIMNamespaceName& namespaceName)
{
String parent = parentNamespaceName.getString();
String child = namespaceName.getString();
//
// If length of namespace name is shorter than or equal to the
// length of parent namespace name, cannot be a child
//
if (child.size () <= parent.size ())
{
return false;
}
//
// Compare prefix substring of namespace name with parent namespace name
//
else if (String::equalNoCase (child.subString (0, parent.size ()), parent))
{
return true;
}
return false;
}
示例3: _scmoClassCache_GetClass
SCMOClass ProviderAgent::_scmoClassCache_GetClass(
const CIMNamespaceName& nameSpace,
const CIMName& className)
{
PEG_METHOD_ENTER(TRC_PROVIDERAGENT,
"ProviderAgent::_scmoClassCache_GetClass");
// create message
ProvAgtGetScmoClassRequestMessage* message =
new ProvAgtGetScmoClassRequestMessage(
XmlWriter::getNextMessageId(),
nameSpace,
className,
QueueIdStack());
// Send the request for the SCMOClass to the server
_providerAgent->_writeResponse(message);
delete message;
// Wait for semaphore signaled by _readAndProcessRequest()
if (!_scmoClassDelivered.time_wait(
PEGASUS_DEFAULT_CLIENT_TIMEOUT_MILLISECONDS))
{
PEG_TRACE((TRC_DISCARDED_DATA, Tracer::LEVEL1,
"Timed-out waiting for SCMOClass for "
"Name Space Name '%s' Class Name '%s'",
(const char*)nameSpace.getString().getCString(),
(const char*)className.getString().getCString()));
PEG_METHOD_EXIT();
return SCMOClass("","");
}
if ( 0 == _transferSCMOClass)
{
PEG_TRACE((TRC_DISCARDED_DATA, Tracer::LEVEL1,
"No SCMOClass received for Name Space Name '%s' Class Name '%s'",
(const char*)nameSpace.getString().getCString(),
(const char*)className.getString().getCString()));
PEG_METHOD_EXIT();
return SCMOClass("","");
}
// Create a local copy.
SCMOClass ret = SCMOClass(*_transferSCMOClass);
// Delete the transferred instance.
delete _transferSCMOClass;
_transferSCMOClass = 0;
PEG_METHOD_EXIT();
return ret;
}
示例4: CompareClasses
void CompareClasses(
CIMRepository& r1,
CIMRepository& r2,
const CIMNamespaceName& namespaceName)
{
Array<CIMName> classNames1 = r1.enumerateClassNames(namespaceName);
Array<CIMName> classNames2 = r2.enumerateClassNames(namespaceName);
BubbleSort(classNames1);
BubbleSort(classNames2);
PEGASUS_TEST_ASSERT(classNames1 == classNames2);
for (Uint32 i = 0; i < classNames1.size(); i++)
{
CIMClass class1 = r1.getClass(namespaceName, classNames1[i]);
CIMClass class2 = r2.getClass(namespaceName, classNames2[i]);
if (verbose)
{
cout << "testing class " << namespaceName.getString() << "/";
cout << classNames1[i].getString() << "..." << endl;
}
if (!class1.identical(class2))
{
PutClass("file1", class1);
PutClass("file2", class2);
cout << "=========================================================";
cout << "=========================================================";
cout << endl;
cout << "ERROR: not identical! - ";
cout << "ERROR FOUND testing class: " << namespaceName.getString();
cout << "/";
cout << classNames1[i].getString();
cout << " .... differences follow:" << endl << endl;
if (system("diff file1 file2") == -1)
{
cout << "Error: system(\"diff file1 file2\") failed." << endl;
}
if (verbose)
{
XmlWriter::printClassElement(class1, cout);
XmlWriter::printClassElement(class2, cout);
}
failures++;
}
}
}
示例5: CIMObjectPath
void AuditLogger::logUpdateInstanceOperation(
const char* cimMethodName,
AuditEvent eventType,
const String& userName,
const String& ipAddr,
const CIMNamespaceName& nameSpace,
const CIMObjectPath& instanceName,
const String& moduleName,
const String& providerName,
CIMStatusCode statusCode)
{
// check if SMF is gathering this type of records.
if (_smf.isRecording(CIM_OPERATION) ||
(! _isInternalWriterUsed) )
{
String cimInstanceName =
CIMObjectPath("", CIMNamespaceName(), instanceName.getClassName(),
instanceName.getKeyBindings()).toString();
_writeCIMOperationRecord(
INSTANCE_OPERATION, userName, statusCode,
ipAddr, cimMethodName, cimInstanceName,
nameSpace.getString(), providerName, moduleName );
}
}
示例6: CompareQualifiers
PEGASUS_NAMESPACE_END
void CompareQualifiers(
CIMRepository& r1,
CIMRepository& r2,
const CIMNamespaceName& namespaceName)
{
Array<CIMQualifierDecl> quals1 = r1.enumerateQualifiers(namespaceName);
Array<CIMQualifierDecl> quals2 = r2.enumerateQualifiers(namespaceName);
PEGASUS_TEST_ASSERT(quals1.size() == quals2.size());
BubbleSort(quals1);
BubbleSort(quals2);
for (Uint32 i = 0; i < quals2.size(); i++)
{
if (verbose)
{
cout << "testing qualifier " << namespaceName.getString() << "/";
cout << quals1[i].getName().getString() << "/ against /";
cout << quals2[i].getName().getString() << "/" << endl;
}
PEGASUS_TEST_ASSERT(quals1[i].identical(quals2[i]));
}
}
示例7: _getKeyValue
void _getKeyValue (
const CIMObjectPath& instanceName,
CIMNamespaceName& childNamespaceName,
Boolean& isRelativeName)
{
Array<CIMKeyBinding> kbArray = instanceName.getKeyBindings();
if ((kbArray.size() == 1) &&
(kbArray[0].getName() == NAMESPACE_PROPERTYNAME))
{
String childNamespaceString = kbArray[0].getValue();
if (childNamespaceString != String::EMPTY)
{
childNamespaceName = childNamespaceString;
}
isRelativeName = !(childNamespaceName.isNull());
}
else
{
//l10n
//throw CIMInvalidParameterException("Invalid key property: ");
throw CIMInvalidParameterException(MessageLoaderParms(
"ControlProviders.NamespaceProvider.NamespaceProvider.INVALID_KEY_PROPERTY",
"Invalid key property: "));
}
}
示例8: removeAuthorization
void AuthorizationHandler::removeAuthorization(
const String& userName,
const CIMNamespaceName& nameSpace)
{
PEG_METHOD_ENTER(
TRC_AUTHORIZATION, "AuthorizationHandler::removeAuthorization()");
//
// Remove the specified authorization
//
if (!_authTable.remove(userName + nameSpace.getString()))
{
PEG_METHOD_EXIT();
throw AuthorizationEntryNotFound(userName, nameSpace.getString());
}
PEG_METHOD_EXIT();
}
示例9: _scmoClassCache_GetClass
SCMOClass CIMServer::_scmoClassCache_GetClass(
const CIMNamespaceName& nameSpace,
const CIMName& className)
{
CIMClass cc;
PEG_METHOD_ENTER(TRC_SERVER, "CIMServer::_scmoClassCache_GetClass()");
try
{
cc = _cimserver->_repository->getClass(
nameSpace,
className,
false, // localOnly
true, // includeQualifiers
true, // includeClassOrigin
CIMPropertyList());
}
catch (Exception& e)
{
PEG_TRACE((TRC_DISCARDED_DATA, Tracer::LEVEL2,
"The class '%s' in the name space '%s' was not found. "
"The repository throws the following exception: %s",
(const char*)className.getString().getCString(),
(const char*)nameSpace.getString().getCString(),
(const char*)e.getMessage().getCString()));
// Return a empty class.
PEG_METHOD_EXIT();
return SCMOClass("","");
}
if (cc.isUninitialized())
{
// The requested class was not found !
// Return a empty class.
PEG_METHOD_EXIT();
return SCMOClass("","");
}
PEG_METHOD_EXIT();
return SCMOClass(cc,(const char*)nameSpace.getString().getCString());
}
示例10: _getRoutingKey
inline String DynamicRoutingTable::_getRoutingKey(
const CIMName& className,
const CIMNamespaceName& namespaceName) const
{
//ATTN: We don't support wild class names.
PEGASUS_ASSERT(!className.isNull());
String key(namespaceName.getString());
key.append(Char16(':'));
key.append(className.getString());
return key;
}
示例11: PEG_METHOD_ENTER
//
// 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;
}
示例12: getAuthorization
String AuthorizationHandler::getAuthorization(
const String& userName,
const CIMNamespaceName& nameSpace)
{
PEG_METHOD_ENTER(
TRC_AUTHORIZATION, "AuthorizationHandler::getAuthorization()");
String auth;
//
// Get authorization for the specified userName and nameSpace
//
if (!_authTable.lookup(userName + nameSpace.getString(), auth))
{
PEG_METHOD_EXIT();
throw AuthorizationEntryNotFound(userName, nameSpace.getString());
}
PEG_METHOD_EXIT();
return auth;
}
示例13: setAuthorization
void AuthorizationHandler::setAuthorization(
const String& userName,
const CIMNamespaceName& nameSpace,
const String& auth)
{
PEG_METHOD_ENTER(
TRC_AUTHORIZATION, "AuthorizationHandler::setAuthorization()");
//
// Remove auth if it already exists
//
_authTable.remove(userName + nameSpace.getString());
//
// Insert the specified authorization
//
if (!_authTable.insert(userName + nameSpace.getString(), auth))
{
PEG_METHOD_EXIT();
throw AuthorizationCacheError();
}
PEG_METHOD_EXIT();
}
示例14: logUpdateQualifierOperation
void AuditLogger::logUpdateQualifierOperation(
const char* cimMethodName,
AuditEvent eventType,
const String& userName,
const String& ipAddr,
const CIMNamespaceName& nameSpace,
const CIMName& className,
CIMStatusCode statusCode)
{
// check if SMF is gathering this type of records.
if (_smf.isRecording(CIM_OPERATION) ||
(! _isInternalWriterUsed) )
{
_writeCIMOperationRecord(
QUALIFER_OPERATION, userName, statusCode,
ipAddr, cimMethodName, className.getString(),
nameSpace.getString(), String::EMPTY, String::EMPTY );
}
}
示例15: CompareQualifiers
void CompareQualifiers(
CIMRepository& r1,
CIMRepository& r2,
const CIMNamespaceName& namespaceName)
{
Array<CIMQualifierDecl> quals1 = r1.enumerateQualifiers(namespaceName);
Array<CIMQualifierDecl> quals2 = r2.enumerateQualifiers(namespaceName);
assert(quals1.size() == quals2.size());
for (size_t i = 0; i < quals2.size(); i++)
{
if (verbose)
{
cout << "testing qualifier " << namespaceName.getString() << "/";
cout << quals2[i].getName().getString() << "..." << endl;
}
assert(quals1[i].identical(quals2[i]));
}
}