version 1.193, 2005/12/15 18:55:17
|
version 1.194, 2005/12/19 21:51:42
|
|
|
#include <Pegasus/Common/PegasusVersion.h> | #include <Pegasus/Common/PegasusVersion.h> |
#include <Pegasus/Common/AcceptLanguages.h> // l10n | #include <Pegasus/Common/AcceptLanguages.h> // l10n |
#include <Pegasus/Common/ContentLanguages.h> // l10n | #include <Pegasus/Common/ContentLanguages.h> // l10n |
|
#include <Pegasus/Common/LanguageParser.h> |
#include <Pegasus/Common/OperationContextInternal.h> | #include <Pegasus/Common/OperationContextInternal.h> |
// l10n | // l10n |
#include <Pegasus/Common/MessageLoader.h> | #include <Pegasus/Common/MessageLoader.h> |
|
|
| |
//l10n start | //l10n start |
// Get the language tags that were saved with the subscription instance | // Get the language tags that were saved with the subscription instance |
String acceptLangs = String::EMPTY; |
AcceptLanguages acceptLangs; |
Uint32 propIndex = instance.findProperty | Uint32 propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.getProperty(propIndex).getValue().get(acceptLangs); |
String acceptLangsString; |
|
instance.getProperty(propIndex).getValue().get(acceptLangsString); |
|
if (acceptLangsString.size()) |
|
{ |
|
acceptLangs = LanguageParser::parseAcceptLanguageHeader( |
|
acceptLangsString); |
} | } |
String contentLangs = String::EMPTY; |
} |
|
ContentLanguages contentLangs; |
propIndex = instance.findProperty | propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.getProperty(propIndex).getValue().get(contentLangs); |
String contentLangsString; |
|
instance.getProperty(propIndex).getValue().get(contentLangsString); |
|
if (contentLangsString.size()) |
|
{ |
|
contentLangs = LanguageParser::parseContentLanguageHeader( |
|
contentLangsString); |
|
} |
} | } |
// l10n end | // l10n end |
| |
|
|
(indicationProviders, sourceNameSpace, | (indicationProviders, sourceNameSpace, |
propertyList, condition, query, queryLanguage, | propertyList, condition, query, queryLanguage, |
activeSubscriptions [i], | activeSubscriptions [i], |
AcceptLanguages(acceptLangs), // l10n |
acceptLangs, |
ContentLanguages(contentLangs), // 110n |
contentLangs, |
creator); | creator); |
| |
if (acceptedProviders.size () == 0) | if (acceptedProviders.size () == 0) |
|
|
| |
CIMException cimException; | CIMException cimException; |
CIMInstance instance; | CIMInstance instance; |
String contentLangs = String::EMPTY; // l10n |
String contentLangsString; |
| |
try | try |
{ | { |
|
|
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
// Get the content languages to be sent in the Content-Language header | // Get the content languages to be sent in the Content-Language header |
instance.getProperty(propIndex).getValue().get(contentLangs); |
instance.getProperty(propIndex).getValue().get(contentLangsString); |
instance.removeProperty (propIndex); | instance.removeProperty (propIndex); |
} | } |
// l10n end | // l10n end |
|
|
exception.getMessage()); | exception.getMessage()); |
} | } |
| |
// l10n |
|
// Note: setting Content-Language in the response to the contentLanguage |
|
// in the repository. |
|
CIMGetInstanceResponseMessage * response = dynamic_cast | CIMGetInstanceResponseMessage * response = dynamic_cast |
<CIMGetInstanceResponseMessage *> (request->buildResponse ()); | <CIMGetInstanceResponseMessage *> (request->buildResponse ()); |
response->cimException = cimException; | response->cimException = cimException; |
response->operationContext.set(ContentLanguageListContainer |
if (contentLangsString.size()) |
(ContentLanguages(contentLangs))); |
{ |
|
// Note: setting Content-Language in the response to the |
|
// contentLanguage in the repository. |
|
response->operationContext.set(ContentLanguageListContainer( |
|
LanguageParser::parseContentLanguageHeader(contentLangsString))); |
|
} |
response->cimInstance = instance; | response->cimInstance = instance; |
_enqueueResponse (request, response); | _enqueueResponse (request, response); |
| |
|
|
exception.getMessage()); | exception.getMessage()); |
} | } |
| |
// l10n |
|
// Note: setting Content-Language in the response to the aggregated |
|
// contentLanguage from the instances in the repository. |
|
CIMEnumerateInstancesResponseMessage * response = dynamic_cast | CIMEnumerateInstancesResponseMessage * response = dynamic_cast |
<CIMEnumerateInstancesResponseMessage *> (request->buildResponse ()); | <CIMEnumerateInstancesResponseMessage *> (request->buildResponse ()); |
response->cimException = cimException; | response->cimException = cimException; |
response->operationContext.set(ContentLanguageListContainer |
if (aggregatedLangs.size()) |
(ContentLanguages(aggregatedLangs))); |
{ |
|
// Note: setting Content-Language in the response to the aggregated |
|
// contentLanguage from the instances in the repository. |
|
response->operationContext.set(ContentLanguageListContainer( |
|
LanguageParser::parseContentLanguageHeader(aggregatedLangs))); |
|
} |
response->cimNamedInstances = returnedInstances; | response->cimNamedInstances = returnedInstances; |
_enqueueResponse (request, response); | _enqueueResponse (request, response); |
| |
|
|
(AcceptLanguageListContainer::NAME)).getLanguages(); | (AcceptLanguageListContainer::NAME)).getLanguages(); |
modifiedInstance.addProperty (CIMProperty | modifiedInstance.addProperty (CIMProperty |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS, | (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS, |
acceptLangs.toString())); |
LanguageParser::buildAcceptLanguageHeader(acceptLangs))); |
| |
ContentLanguages contentLangs = | ContentLanguages contentLangs = |
((ContentLanguageListContainer)request->operationContext.get | ((ContentLanguageListContainer)request->operationContext.get |
(ContentLanguageListContainer::NAME)).getLanguages(); | (ContentLanguageListContainer::NAME)).getLanguages(); |
modifiedInstance.addProperty (CIMProperty | modifiedInstance.addProperty (CIMProperty |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS, | (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS, |
contentLangs.toString())); |
LanguageParser::buildContentLanguageHeader(contentLangs))); |
| |
Array <CIMName> properties = propertyList.getPropertyNameArray (); | Array <CIMName> properties = propertyList.getPropertyNameArray (); |
properties.append (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); | properties.append (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
|
|
(PEGASUS_PROPERTYNAME_INDSUB_CREATOR)).getValue ().toString (); | (PEGASUS_PROPERTYNAME_INDSUB_CREATOR)).getValue ().toString (); |
| |
// l10n start | // l10n start |
String acceptLangs = String::EMPTY; |
AcceptLanguages acceptLangs; |
Uint32 propIndex = instance.findProperty | Uint32 propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.getProperty(propIndex).getValue().get(acceptLangs); |
String acceptLangsString; |
|
instance.getProperty(propIndex).getValue().get( |
|
acceptLangsString); |
|
if (acceptLangsString.size()) |
|
{ |
|
acceptLangs = LanguageParser::parseAcceptLanguageHeader( |
|
acceptLangsString); |
} | } |
String contentLangs = String::EMPTY; |
} |
|
ContentLanguages contentLangs; |
propIndex = instance.findProperty | propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.getProperty(propIndex).getValue().get(contentLangs); |
String contentLangsString; |
|
instance.getProperty(propIndex).getValue().get( |
|
contentLangsString); |
|
if (contentLangsString.size()) |
|
{ |
|
contentLangs = LanguageParser::parseContentLanguageHeader( |
|
contentLangsString); |
|
} |
} | } |
// l10n end | // l10n end |
| |
|
|
sourceNameSpace, | sourceNameSpace, |
requiredProperties, condition, query, queryLanguage, | requiredProperties, condition, query, queryLanguage, |
newSubscriptions [i], | newSubscriptions [i], |
AcceptLanguages(acceptLangs), |
acceptLangs, |
ContentLanguages(contentLangs), |
contentLangs, |
creator); | creator); |
} | } |
else | else |
|
|
(indicationProviders, | (indicationProviders, |
sourceNameSpace, requiredProperties, condition, | sourceNameSpace, requiredProperties, condition, |
query, queryLanguage, newSubscriptions [i], | query, queryLanguage, newSubscriptions [i], |
AcceptLanguages(acceptLangs), |
acceptLangs, |
ContentLanguages(contentLangs), |
contentLangs, |
creator); | creator); |
| |
if (acceptedProviders.size () > 0) | if (acceptedProviders.size () > 0) |
|
|
String creator = instance.getProperty (instance.findProperty | String creator = instance.getProperty (instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_CREATOR)).getValue ().toString (); | (PEGASUS_PROPERTYNAME_INDSUB_CREATOR)).getValue ().toString (); |
// l10n start | // l10n start |
String acceptLangs = String::EMPTY; |
AcceptLanguages acceptLangs; |
Uint32 propIndex = instance.findProperty | Uint32 propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.getProperty(propIndex).getValue().get(acceptLangs); |
String acceptLangsString; |
|
instance.getProperty(propIndex).getValue().get( |
|
acceptLangsString); |
|
if (acceptLangsString.size()) |
|
{ |
|
acceptLangs = LanguageParser::parseAcceptLanguageHeader( |
|
acceptLangsString); |
} | } |
String contentLangs = String::EMPTY; |
} |
|
ContentLanguages contentLangs; |
propIndex = instance.findProperty | propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.getProperty(propIndex).getValue().get(contentLangs); |
String contentLangsString; |
|
instance.getProperty(propIndex).getValue().get( |
|
contentLangsString); |
|
if (contentLangsString.size()) |
|
{ |
|
contentLangs = LanguageParser::parseContentLanguageHeader( |
|
contentLangsString); |
|
} |
} | } |
// l10n end | // l10n end |
| |
|
|
_sendWaitDeleteRequests (indicationProviders, | _sendWaitDeleteRequests (indicationProviders, |
sourceNameSpace, | sourceNameSpace, |
formerSubscriptions [i], | formerSubscriptions [i], |
AcceptLanguages(acceptLangs), |
acceptLangs, |
ContentLanguages(contentLangs), |
contentLangs, |
creator); | creator); |
| |
// | // |
|
|
requiredProperties, condition, | requiredProperties, condition, |
query, queryLanguage, | query, queryLanguage, |
formerSubscriptions [i], | formerSubscriptions [i], |
AcceptLanguages(acceptLangs), |
acceptLangs, |
ContentLanguages(contentLangs), |
contentLangs, |
creator); | creator); |
} | } |
else | else |
|
|
(PEGASUS_PROPERTYNAME_INDSUB_CREATOR)).getValue | (PEGASUS_PROPERTYNAME_INDSUB_CREATOR)).getValue |
().toString (); | ().toString (); |
| |
String acceptLangs = String::EMPTY; |
AcceptLanguages acceptLangs; |
Uint32 propIndex = instance.findProperty | Uint32 propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.getProperty (propIndex).getValue ().get |
String acceptLangsString; |
(acceptLangs); |
instance.getProperty(propIndex).getValue().get( |
|
acceptLangsString); |
|
if (acceptLangsString.size()) |
|
{ |
|
acceptLangs = LanguageParser::parseAcceptLanguageHeader( |
|
acceptLangsString); |
} | } |
String contentLangs = String::EMPTY; |
} |
|
ContentLanguages contentLangs; |
propIndex = instance.findProperty | propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.getProperty (propIndex).getValue ().get |
String contentLangsString; |
(contentLangs); |
instance.getProperty(propIndex).getValue().get( |
|
contentLangsString); |
|
if (contentLangsString.size()) |
|
{ |
|
contentLangs = LanguageParser::parseContentLanguageHeader( |
|
contentLangsString); |
|
} |
} | } |
| |
// | // |
|
|
(currentIndicationProviders, | (currentIndicationProviders, |
sourceNameSpace, requiredProperties, condition, | sourceNameSpace, requiredProperties, condition, |
query, queryLanguage, instance, | query, queryLanguage, instance, |
AcceptLanguages (acceptLangs), |
acceptLangs, |
ContentLanguages (contentLangs), |
contentLangs, |
creator); | creator); |
| |
if (acceptedProviders.size () > 0) | if (acceptedProviders.size () > 0) |
|
|
_getCreator (instance, creator); | _getCreator (instance, creator); |
| |
// l10n start | // l10n start |
String acceptLangs = String::EMPTY; |
AcceptLanguages acceptLangs; |
Uint32 propIndex = instance.findProperty | Uint32 propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.getProperty (propIndex).getValue ().get (acceptLangs); |
String acceptLangsString; |
|
instance.getProperty(propIndex).getValue().get( |
|
acceptLangsString); |
|
if (acceptLangsString.size()) |
|
{ |
|
acceptLangs = LanguageParser::parseAcceptLanguageHeader( |
|
acceptLangsString); |
} | } |
String contentLangs = String::EMPTY; |
} |
|
ContentLanguages contentLangs; |
propIndex = instance.findProperty | propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.getProperty (propIndex).getValue ().get (contentLangs); |
String contentLangsString; |
|
instance.getProperty(propIndex).getValue().get( |
|
contentLangsString); |
|
if (contentLangsString.size()) |
|
{ |
|
contentLangs = LanguageParser::parseContentLanguageHeader( |
|
contentLangsString); |
|
} |
} | } |
// l10n end | // l10n end |
| |
// l10n | // l10n |
_sendAsyncDeleteRequests (indicationProviders, sourceNamespaceName, | _sendAsyncDeleteRequests (indicationProviders, sourceNamespaceName, |
deletedSubscriptions [i], | deletedSubscriptions [i], |
AcceptLanguages (acceptLangs), |
acceptLangs, |
ContentLanguages (contentLangs), |
contentLangs, |
0, // no request | 0, // no request |
indicationSubclasses, | indicationSubclasses, |
creator); | creator); |
|
|
// Get the language tags that were saved with the subscription | // Get the language tags that were saved with the subscription |
// instance | // instance |
// | // |
String acceptLangs = String::EMPTY; |
AcceptLanguages acceptLangs; |
Uint32 propIndex = subscriptionInstance.findProperty | Uint32 propIndex = subscriptionInstance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
subscriptionInstance.getProperty (propIndex).getValue ().get |
String acceptLangsString; |
(acceptLangs); |
subscriptionInstance.getProperty(propIndex).getValue().get( |
|
acceptLangsString); |
|
if (acceptLangsString.size()) |
|
{ |
|
acceptLangs = LanguageParser::parseAcceptLanguageHeader( |
|
acceptLangsString); |
} | } |
String contentLangs = String::EMPTY; |
} |
|
ContentLanguages contentLangs; |
propIndex = subscriptionInstance.findProperty | propIndex = subscriptionInstance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
subscriptionInstance.getProperty (propIndex).getValue ().get |
String contentLangsString; |
(contentLangs); |
subscriptionInstance.getProperty(propIndex).getValue().get( |
|
contentLangsString); |
|
if (contentLangsString.size()) |
|
{ |
|
contentLangs = LanguageParser::parseContentLanguageHeader( |
|
contentLangsString); |
|
} |
} | } |
| |
// l10n | // l10n |
subscriptionInstance.setPath (subscription); | subscriptionInstance.setPath (subscription); |
_sendAsyncDeleteRequests (indicationProviders, | _sendAsyncDeleteRequests (indicationProviders, |
sourceNamespaceName, subscriptionInstance, | sourceNamespaceName, subscriptionInstance, |
AcceptLanguages(acceptLangs), |
acceptLangs, |
ContentLanguages(contentLangs), |
contentLangs, |
0, // no request | 0, // no request |
indicationSubclasses, | indicationSubclasses, |
creator); | creator); |