version 1.17, 2003/04/16 00:17:14
|
version 1.27, 2005/01/06 16:16:30
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2004//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// The Open Group, Tivoli Systems |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) | // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// Carol Ann Krug Graves, Hewlett-Packard Company | // Carol Ann Krug Graves, Hewlett-Packard Company |
// (carolann_graves@hp.com) | // (carolann_graves@hp.com) |
|
// Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com) |
|
// Terry Martin, Hewlett-Packard Company (terry.martin@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include "OperationContext.h" | #include "OperationContext.h" |
#include "ArrayInternal.h" | #include "ArrayInternal.h" |
|
#include <Pegasus/Common/MessageLoader.h> //l10n |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
} | } |
} | } |
| |
throw Exception("object not found"); |
//l10n |
} |
MessageLoaderParms parms("Common.OperationContext.OBJECT_NOT_FOUND", |
|
"object not found"); |
#ifndef PEGASUS_REMOVE_DEPRECATED |
throw Exception(parms); |
const OperationContext::Container & OperationContext::get(const Uint32 key) const |
//throw Exception("object not found"); |
{ |
|
for(Uint32 i = 0, n = _rep->containers.size(); i < n; i++) |
|
{ |
|
if(key == _rep->containers[i]->getKey()) |
|
{ |
|
Container * p = _rep->containers[i]; |
|
|
|
return(*p); |
|
} |
|
} | } |
| |
throw Exception("object not found"); |
|
} |
|
#endif |
|
|
|
void OperationContext::set(const OperationContext::Container & container) | void OperationContext::set(const OperationContext::Container & container) |
{ | { |
for(Uint32 i = 0, n = _rep->containers.size(); i < n; i++) | for(Uint32 i = 0, n = _rep->containers.size(); i < n; i++) |
|
|
} | } |
} | } |
| |
throw Exception("object not found"); |
//l10n |
|
MessageLoaderParms parms("Common.OperationContext.OBJECT_NOT_FOUND", |
|
"object not found"); |
|
throw Exception(parms); |
|
//throw Exception("object not found"); |
} | } |
| |
void OperationContext::insert(const OperationContext::Container & container) | void OperationContext::insert(const OperationContext::Container & container) |
|
|
{ | { |
if(container.getName() == _rep->containers[i]->getName()) | if(container.getName() == _rep->containers[i]->getName()) |
{ | { |
throw Exception("object already exists."); |
//l10n |
|
MessageLoaderParms parms("Common.OperationContext.OBJECT_ALREADY_EXISTS", |
|
"object already exists."); |
|
throw Exception(parms); |
|
//throw Exception("object already exists."); |
} | } |
} | } |
| |
|
|
} | } |
} | } |
| |
throw Exception("object not found"); |
//l10n |
|
MessageLoaderParms parms("Common.OperationContext.OBJECT_NOT_FOUND", |
|
"object not found"); |
|
throw Exception(parms); |
|
//throw Exception("object not found"); |
} | } |
| |
#ifndef PEGASUS_REMOVE_DEPRECATED |
|
void OperationContext::remove(const Uint32 key) |
|
{ |
|
for(Uint32 i = 0, n = _rep->containers.size(); i < n; i++) |
|
{ |
|
if(key == _rep->containers[i]->getKey()) |
|
{ |
|
delete _rep->containers[i]; |
|
_rep->containers.remove(i); |
|
|
|
return; |
|
} |
|
} |
|
|
|
throw Exception("object not found"); |
|
} |
|
#endif |
|
| |
// | // |
// OperationContext::Container | // OperationContext::Container |
// | // |
| |
#ifndef PEGASUS_REMOVE_DEPRECATED |
|
OperationContext::Container::Container(const Uint32 key) : _key(key) |
|
{ |
|
} |
|
#endif |
|
|
|
OperationContext::Container::~Container(void) | OperationContext::Container::~Container(void) |
{ | { |
} | } |
| |
#ifndef PEGASUS_REMOVE_DEPRECATED |
|
const Uint32 & OperationContext::Container::getKey(void) const |
|
{ |
|
return(_key); |
|
} |
|
#endif |
|
| |
// | // |
// IdentityContainer | // IdentityContainer |
|
|
const String IdentityContainer::NAME = "IdentityContainer"; | const String IdentityContainer::NAME = "IdentityContainer"; |
| |
IdentityContainer::IdentityContainer(const OperationContext::Container & container) | IdentityContainer::IdentityContainer(const OperationContext::Container & container) |
#ifndef PEGASUS_REMOVE_DEPRECATED |
|
: OperationContext::Container(container.getKey()) |
|
#endif |
|
{ | { |
const IdentityContainer * p = dynamic_cast<const IdentityContainer *>(&container); | const IdentityContainer * p = dynamic_cast<const IdentityContainer *>(&container); |
| |
|
|
} | } |
| |
IdentityContainer::IdentityContainer(const String & userName) | IdentityContainer::IdentityContainer(const String & userName) |
#ifndef PEGASUS_REMOVE_DEPRECATED |
|
: OperationContext::Container(CONTEXT_IDENTITY) |
|
#endif |
|
{ | { |
_rep = new IdentityContainerRep(); | _rep = new IdentityContainerRep(); |
_rep->userName = userName; | _rep->userName = userName; |
|
|
return(_rep->userName); | return(_rep->userName); |
} | } |
| |
|
// Unimplemented, hidden constructor not intended for actual use |
|
IdentityContainer::IdentityContainer() |
|
{ |
|
} |
|
|
// | // |
// SubscriptionInstanceContainer | // SubscriptionInstanceContainer |
// | // |
|
|
return(_rep->subscriptionInstance); | return(_rep->subscriptionInstance); |
} | } |
| |
|
// Unimplemented, hidden constructor not intended for actual use |
|
SubscriptionInstanceContainer::SubscriptionInstanceContainer() |
|
{ |
|
} |
| |
// | // |
// SubscriptionInstanceNamesContainer | // SubscriptionInstanceNamesContainer |
|
|
return(_rep->subscriptionInstanceNames); | return(_rep->subscriptionInstanceNames); |
} | } |
| |
|
// Unimplemented, hidden constructor not intended for actual use |
|
SubscriptionInstanceNamesContainer::SubscriptionInstanceNamesContainer() |
|
{ |
|
} |
|
|
// | // |
// SubscriptionFilterConditionContainer | // SubscriptionFilterConditionContainer |
// | // |
|
|
return(_rep->queryLanguage); | return(_rep->queryLanguage); |
} | } |
| |
|
// Unimplemented, hidden constructor not intended for actual use |
|
SubscriptionFilterConditionContainer::SubscriptionFilterConditionContainer() |
|
{ |
|
} |
|
|
|
// |
|
// SubscriptionFilterQueryContainer |
|
// |
|
|
|
class SubscriptionFilterQueryContainerRep |
|
{ |
|
public: |
|
String filterQuery; |
|
String queryLanguage; |
|
CIMNamespaceName sourceNameSpace; |
|
}; |
|
|
|
const String SubscriptionFilterQueryContainer::NAME = |
|
"SubscriptionFilterQueryContainer"; |
|
|
|
SubscriptionFilterQueryContainer::SubscriptionFilterQueryContainer |
|
(const OperationContext::Container & container) |
|
{ |
|
const SubscriptionFilterQueryContainer * p = |
|
dynamic_cast<const SubscriptionFilterQueryContainer *>(&container); |
|
|
|
if(p == 0) |
|
{ |
|
throw DynamicCastFailedException(); |
|
} |
|
|
|
_rep = new SubscriptionFilterQueryContainerRep(); |
|
_rep->filterQuery = p->_rep->filterQuery; |
|
_rep->queryLanguage = p->_rep->queryLanguage; |
|
_rep->sourceNameSpace = p->_rep->sourceNameSpace; |
|
} |
|
|
|
SubscriptionFilterQueryContainer::SubscriptionFilterQueryContainer |
|
(const SubscriptionFilterQueryContainer & container) |
|
{ |
|
_rep = new SubscriptionFilterQueryContainerRep(); |
|
_rep->filterQuery = container._rep->filterQuery; |
|
_rep->queryLanguage = container._rep->queryLanguage; |
|
_rep->sourceNameSpace = container._rep->sourceNameSpace; |
|
} |
|
|
|
SubscriptionFilterQueryContainer::SubscriptionFilterQueryContainer( |
|
const String & filterQuery, |
|
const String & queryLanguage, |
|
const CIMNamespaceName & sourceNameSpace) |
|
{ |
|
_rep = new SubscriptionFilterQueryContainerRep(); |
|
_rep->filterQuery = filterQuery; |
|
_rep->queryLanguage = queryLanguage; |
|
_rep->sourceNameSpace = sourceNameSpace; |
|
} |
|
|
|
SubscriptionFilterQueryContainer::~SubscriptionFilterQueryContainer |
|
(void) |
|
{ |
|
delete _rep; |
|
} |
|
SubscriptionFilterQueryContainer & |
|
SubscriptionFilterQueryContainer::operator=( |
|
const SubscriptionFilterQueryContainer & container) |
|
{ |
|
if (this == &container) |
|
{ |
|
return (*this); |
|
} |
|
|
|
_rep->filterQuery = container._rep->filterQuery; |
|
_rep->queryLanguage = container._rep->queryLanguage; |
|
_rep->sourceNameSpace = container._rep->sourceNameSpace; |
|
|
|
return (*this); |
|
} |
|
|
|
String SubscriptionFilterQueryContainer::getName(void) const |
|
{ |
|
return(NAME); |
|
} |
|
|
|
OperationContext::Container * SubscriptionFilterQueryContainer::clone(void) const |
|
{ |
|
return(new SubscriptionFilterQueryContainer(_rep->filterQuery, |
|
_rep->queryLanguage, |
|
_rep->sourceNameSpace)); |
|
} |
|
|
|
void SubscriptionFilterQueryContainer::destroy(void) |
|
{ |
|
delete this; |
|
} |
|
|
|
String SubscriptionFilterQueryContainer::getFilterQuery(void) const |
|
{ |
|
return(_rep->filterQuery); |
|
} |
|
|
|
String SubscriptionFilterQueryContainer::getQueryLanguage(void) const |
|
{ |
|
return(_rep->queryLanguage); |
|
} |
|
|
|
CIMNamespaceName SubscriptionFilterQueryContainer::getSourceNameSpace(void) const |
|
{ |
|
return(_rep->sourceNameSpace); |
|
} |
|
|
|
// Unimplemented, hidden constructor not intended for actual use |
|
SubscriptionFilterQueryContainer::SubscriptionFilterQueryContainer() |
|
{ |
|
} |
|
|
|
// |
|
// TimeoutContainer |
|
// |
| |
const String TimeoutContainer::NAME = "TimeoutContainer"; | const String TimeoutContainer::NAME = "TimeoutContainer"; |
| |
|
|
} | } |
| |
| |
|
// l10n start |
|
|
|
// |
|
// AcceptLanguageListContainer |
|
// |
|
|
|
class AcceptLanguageListContainerRep |
|
{ |
|
public: |
|
AcceptLanguages languages; |
|
}; |
|
|
|
const String AcceptLanguageListContainer::NAME = |
|
"AcceptLanguageListContainer"; |
|
|
|
AcceptLanguageListContainer::AcceptLanguageListContainer |
|
(const OperationContext::Container & container) |
|
{ |
|
const AcceptLanguageListContainer * p = |
|
dynamic_cast<const AcceptLanguageListContainer *>(&container); |
|
|
|
if(p == 0) |
|
{ |
|
throw DynamicCastFailedException(); |
|
} |
|
|
|
_rep = new AcceptLanguageListContainerRep(); |
|
_rep->languages = p->_rep->languages; |
|
} |
|
|
|
AcceptLanguageListContainer::AcceptLanguageListContainer |
|
(const AcceptLanguageListContainer & container) |
|
{ |
|
_rep = new AcceptLanguageListContainerRep(); |
|
_rep->languages = container._rep->languages; |
|
} |
|
|
|
AcceptLanguageListContainer::AcceptLanguageListContainer |
|
(const AcceptLanguages & languages) |
|
{ |
|
_rep = new AcceptLanguageListContainerRep(); |
|
_rep->languages = languages; |
|
} |
|
|
|
AcceptLanguageListContainer::~AcceptLanguageListContainer(void) |
|
{ |
|
delete _rep; |
|
} |
|
|
|
AcceptLanguageListContainer & AcceptLanguageListContainer::operator=( |
|
const AcceptLanguageListContainer & container) |
|
{ |
|
if (this == &container) |
|
{ |
|
return (*this); |
|
} |
|
|
|
_rep->languages = container._rep->languages; |
|
|
|
return (*this); |
|
} |
|
|
|
String AcceptLanguageListContainer::getName(void) const |
|
{ |
|
return(NAME); |
|
} |
|
|
|
OperationContext::Container * AcceptLanguageListContainer::clone(void) const |
|
{ |
|
return(new AcceptLanguageListContainer(_rep->languages)); |
|
} |
|
|
|
void AcceptLanguageListContainer::destroy(void) |
|
{ |
|
delete this; |
|
} |
|
|
|
AcceptLanguages AcceptLanguageListContainer::getLanguages(void) const |
|
{ |
|
return(_rep->languages); |
|
} |
|
|
|
// Unimplemented, hidden constructor not intended for actual use |
|
AcceptLanguageListContainer::AcceptLanguageListContainer() |
|
{ |
|
} |
|
|
|
// |
|
// SubscriptionLanguageListContainer |
|
// |
|
|
|
class SubscriptionLanguageListContainerRep |
|
{ |
|
public: |
|
AcceptLanguages languages; |
|
}; |
|
|
|
const String SubscriptionLanguageListContainer::NAME = |
|
"SubscriptionLanguageListContainer"; |
|
|
|
SubscriptionLanguageListContainer::SubscriptionLanguageListContainer |
|
(const OperationContext::Container & container) |
|
{ |
|
const SubscriptionLanguageListContainer * p = |
|
dynamic_cast<const SubscriptionLanguageListContainer *>(&container); |
|
|
|
if(p == 0) |
|
{ |
|
throw DynamicCastFailedException(); |
|
} |
|
|
|
_rep = new SubscriptionLanguageListContainerRep(); |
|
_rep->languages = p->_rep->languages; |
|
} |
|
|
|
SubscriptionLanguageListContainer::SubscriptionLanguageListContainer |
|
(const SubscriptionLanguageListContainer & container) |
|
{ |
|
_rep = new SubscriptionLanguageListContainerRep(); |
|
_rep->languages = container._rep->languages; |
|
} |
|
|
|
SubscriptionLanguageListContainer::SubscriptionLanguageListContainer |
|
(const AcceptLanguages & languages) |
|
{ |
|
_rep = new SubscriptionLanguageListContainerRep(); |
|
_rep->languages = languages; |
|
} |
|
|
|
SubscriptionLanguageListContainer::~SubscriptionLanguageListContainer(void) |
|
{ |
|
delete _rep; |
|
} |
|
|
|
SubscriptionLanguageListContainer & SubscriptionLanguageListContainer::operator=( |
|
const SubscriptionLanguageListContainer & container) |
|
{ |
|
if (this == &container) |
|
{ |
|
return (*this); |
|
} |
|
|
|
_rep->languages = container._rep->languages; |
|
|
|
return (*this); |
|
} |
|
|
|
String SubscriptionLanguageListContainer::getName(void) const |
|
{ |
|
return(NAME); |
|
} |
|
|
|
OperationContext::Container * SubscriptionLanguageListContainer::clone(void) const |
|
{ |
|
return(new SubscriptionLanguageListContainer(_rep->languages)); |
|
} |
|
|
|
void SubscriptionLanguageListContainer::destroy(void) |
|
{ |
|
delete this; |
|
} |
|
|
|
AcceptLanguages SubscriptionLanguageListContainer::getLanguages(void) const |
|
{ |
|
return(_rep->languages); |
|
} |
|
|
|
// Unimplemented, hidden constructor not intended for actual use |
|
SubscriptionLanguageListContainer::SubscriptionLanguageListContainer() |
|
{ |
|
} |
|
|
|
// |
|
// ContentLanguageListContainer |
|
// |
|
|
|
class ContentLanguageListContainerRep |
|
{ |
|
public: |
|
ContentLanguages languages; |
|
}; |
|
|
|
const String ContentLanguageListContainer::NAME = |
|
"ContentLanguageListContainer"; |
|
|
|
ContentLanguageListContainer::ContentLanguageListContainer |
|
(const OperationContext::Container & container) |
|
{ |
|
const ContentLanguageListContainer * p = |
|
dynamic_cast<const ContentLanguageListContainer *>(&container); |
|
|
|
if(p == 0) |
|
{ |
|
throw DynamicCastFailedException(); |
|
} |
|
|
|
_rep = new ContentLanguageListContainerRep(); |
|
_rep->languages = p->_rep->languages; |
|
} |
|
|
|
ContentLanguageListContainer::ContentLanguageListContainer |
|
(const ContentLanguageListContainer & container) |
|
{ |
|
_rep = new ContentLanguageListContainerRep(); |
|
_rep->languages = container._rep->languages; |
|
} |
|
|
|
ContentLanguageListContainer::ContentLanguageListContainer |
|
(const ContentLanguages & languages) |
|
{ |
|
_rep = new ContentLanguageListContainerRep(); |
|
_rep->languages = languages; |
|
} |
|
|
|
ContentLanguageListContainer::~ContentLanguageListContainer(void) |
|
{ |
|
delete _rep; |
|
} |
|
|
|
ContentLanguageListContainer & ContentLanguageListContainer::operator=( |
|
const ContentLanguageListContainer & container) |
|
{ |
|
if (this == &container) |
|
{ |
|
return (*this); |
|
} |
|
|
|
_rep->languages = container._rep->languages; |
|
|
|
return (*this); |
|
} |
|
|
|
String ContentLanguageListContainer::getName(void) const |
|
{ |
|
return(NAME); |
|
} |
|
|
|
OperationContext::Container * ContentLanguageListContainer::clone(void) const |
|
{ |
|
return(new ContentLanguageListContainer(_rep->languages)); |
|
} |
|
|
|
void ContentLanguageListContainer::destroy(void) |
|
{ |
|
delete this; |
|
} |
|
|
|
ContentLanguages ContentLanguageListContainer::getLanguages(void) const |
|
{ |
|
return(_rep->languages); |
|
} |
|
|
|
// Unimplemented, hidden constructor not intended for actual use |
|
ContentLanguageListContainer::ContentLanguageListContainer() |
|
{ |
|
} |
|
|
|
// l10n end |
|
|
|
// |
|
// SnmpTrapOidContainer |
|
// |
|
|
|
class SnmpTrapOidContainerRep |
|
{ |
|
public: |
|
String snmpTrapOid; |
|
}; |
|
|
|
const String SnmpTrapOidContainer::NAME = |
|
"SnmpTrapOidContainer"; |
|
|
|
SnmpTrapOidContainer::SnmpTrapOidContainer |
|
(const OperationContext::Container & container) |
|
{ |
|
const SnmpTrapOidContainer * p = |
|
dynamic_cast<const SnmpTrapOidContainer *>(&container); |
|
|
|
if(p == 0) |
|
{ |
|
throw DynamicCastFailedException(); |
|
} |
|
|
|
_rep = new SnmpTrapOidContainerRep(); |
|
_rep->snmpTrapOid = p->_rep->snmpTrapOid; |
|
} |
|
|
|
SnmpTrapOidContainer::SnmpTrapOidContainer |
|
(const SnmpTrapOidContainer & container) |
|
{ |
|
_rep = new SnmpTrapOidContainerRep(); |
|
_rep->snmpTrapOid = container._rep->snmpTrapOid; |
|
} |
| |
|
SnmpTrapOidContainer::SnmpTrapOidContainer |
|
(const String & snmpTrapOid) |
|
{ |
|
_rep = new SnmpTrapOidContainerRep(); |
|
_rep->snmpTrapOid = snmpTrapOid; |
|
} |
|
|
|
SnmpTrapOidContainer::~SnmpTrapOidContainer(void) |
|
{ |
|
delete _rep; |
|
} |
|
|
|
SnmpTrapOidContainer & SnmpTrapOidContainer::operator=( |
|
const SnmpTrapOidContainer & container) |
|
{ |
|
if (this == &container) |
|
{ |
|
return (*this); |
|
} |
| |
|
_rep->snmpTrapOid = container._rep->snmpTrapOid; |
|
|
|
return (*this); |
|
} |
|
|
|
String SnmpTrapOidContainer::getName(void) const |
|
{ |
|
return(NAME); |
|
} |
|
|
|
OperationContext::Container * SnmpTrapOidContainer::clone(void) const |
|
{ |
|
return(new SnmpTrapOidContainer(_rep->snmpTrapOid)); |
|
} |
|
|
|
void SnmpTrapOidContainer::destroy(void) |
|
{ |
|
delete this; |
|
} |
|
|
|
String SnmpTrapOidContainer::getSnmpTrapOid(void) const |
|
{ |
|
return(_rep->snmpTrapOid); |
|
} |
|
|
|
// Unimplemented, hidden constructor not intended for actual use |
|
SnmpTrapOidContainer::SnmpTrapOidContainer() |
|
{ |
|
} |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |