OW_NAMESPACE::OperationContext Class Reference

This class is used to store general information (the context) of a WBEM operation. More...

#include <OW_OperationContext.hpp>

Collaboration diagram for OW_NAMESPACE::OperationContext:

Collaboration graph
[legend]
List of all members.

Public Types

typedef IntrusiveReference<
Data
DataRef

Public Member Functions

 OperationContext ()
void setData (const String &key, const DataRef &data)
 Caller creats a subclass of Data and passes it in.
void removeData (const String &key)
 Remove the data identified by key.
DataRef getData (const String &key) const
 caller uses IntrusiveReference::cast_to<>() on the return value to attempt to recover the original type passed into storeData.
bool keyHasData (const String &key) const
 Test whether there is data for the key.
void setStringData (const String &key, const String &str)
 These are for convenience, and are implemented in terms of the first 2 functions.
String getStringData (const String &key) const
 
Exceptions:
ContextDataNotFoundException if key is not found

String getStringDataWithDefault (const String &key, const String &def=String()) const
UserInfo getUserInfo () const

Static Public Attributes

static const char *const USER_NAME = "USER_NAME"
static const char *const USER_PASSWD = "USER_PASSWD"
static const char *const HTTP_PATH = "HTTP_PATH"
static const char *const CURUSER_UIDKEY = "CURUSER_UIDKEY"
static const char *const BYPASS_LOCKERKEY = "BYPASS_LOCKER"
static const char *const SESSION_LANGUAGE_KEY = "SESSION_LANGUAGE_KEY"
static const char *const HTTP_ACCEPT_LANGUAGE_KEY = "HTTP_ACCEPT_LANGUAGE_KEY"
static const char *const CLIENT_IPADDR = "CLIENT_IPADDR"

Private Member Functions

 OperationContext (const OperationContext &)
OperationContextoperator= (const OperationContext &)

Private Attributes

SortedVectorMap< String, DataRefm_data

Classes

class  Data

Detailed Description

This class is used to store general information (the context) of a WBEM operation.

It works like an associative container, with a String key, and the data is an OperationContext::DataRef. The idea is for a client of this class to create a subclass of OperationContext::Data and then pass a smart pointer to it into setData(). Convenience functions (and a subclass) are provided to use a String for the Data.

Thread safety: None Copy Semantics: Non-copyable

Definition at line 65 of file OW_OperationContext.hpp.


Member Typedef Documentation

typedef IntrusiveReference<Data> OW_NAMESPACE::OperationContext::DataRef
 

Definition at line 75 of file OW_OperationContext.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::OperationContext::OperationContext  ) 
 

Definition at line 48 of file OW_OperationContext.cpp.

OW_NAMESPACE::OperationContext::OperationContext const OperationContext  )  [private]
 


Member Function Documentation

OperationContext::DataRef OW_NAMESPACE::OperationContext::getData const String key  )  const
 

caller uses IntrusiveReference::cast_to<>() on the return value to attempt to recover the original type passed into storeData.

Returns:
The same DataRef associated with key that was passed to setData(). A NULL DataRef if key is not valid.

Definition at line 88 of file OW_OperationContext.cpp.

References OW_NAMESPACE::SortedVectorMap< Key, T, Compare >::end(), OW_NAMESPACE::SortedVectorMap< Key, T, Compare >::find(), and m_data.

Referenced by OW_NAMESPACE::HTTPSvrConnection::getContentLanguage(), getStringData(), and getStringDataWithDefault().

String OW_NAMESPACE::OperationContext::getStringData const String key  )  const
 

Exceptions:
ContextDataNotFoundException if key is not found

Definition at line 123 of file OW_OperationContext.cpp.

References OW_NAMESPACE::String::c_str(), OW_NAMESPACE::IntrusiveReference< T >::cast_to(), getData(), and OW_THROW.

Referenced by getUserInfo().

String OW_NAMESPACE::OperationContext::getStringDataWithDefault const String key,
const String def = String()
const
 

Returns:
def if key is not found

Definition at line 136 of file OW_OperationContext.cpp.

References OW_NAMESPACE::IntrusiveReference< T >::cast_to(), and getData().

Referenced by OW_NAMESPACE::AccessMgr::checkAccess(), OW_NAMESPACE::BinaryRequestHandler::doProcess(), OW_NAMESPACE::AuthorizerManager::isOn(), and OW_NAMESPACE::logOperation().

UserInfo OW_NAMESPACE::OperationContext::getUserInfo  )  const
 

Definition at line 54 of file OW_OperationContext.cpp.

References getStringData(), and USER_NAME.

Referenced by OW_NAMESPACE::SimpleAuthorizer2::checkAccess(), and OW_NAMESPACE::AccessMgr::checkAccess().

bool OW_NAMESPACE::OperationContext::keyHasData const String key  )  const
 

Test whether there is data for the key.

Parameters:
key The key to test.
Returns:
true if there is data for the key.

Definition at line 100 of file OW_OperationContext.cpp.

References OW_NAMESPACE::SortedVectorMap< Key, T, Compare >::count(), and m_data.

Referenced by OW_NAMESPACE::CIMRepository::beginOperation(), and OW_NAMESPACE::CIMRepository::endOperation().

OperationContext& OW_NAMESPACE::OperationContext::operator= const OperationContext  )  [private]
 

void OW_NAMESPACE::OperationContext::removeData const String key  ) 
 

Remove the data identified by key.

It is not an error if key has not already been added to the context with setData().

Parameters:
key Identifies the data to remove.

Definition at line 81 of file OW_OperationContext.cpp.

References OW_NAMESPACE::SortedVectorMap< Key, T, Compare >::erase(), and m_data.

Referenced by OW_NAMESPACE::AuthorizerManager::turnOn().

void OW_NAMESPACE::OperationContext::setData const String key,
const DataRef data
 

Caller creats a subclass of Data and passes it in.

Parameters:
key 

Definition at line 74 of file OW_OperationContext.cpp.

References m_data.

void OW_NAMESPACE::OperationContext::setStringData const String key,
const String str
 

These are for convenience, and are implemented in terms of the first 2 functions.

Definition at line 116 of file OW_OperationContext.cpp.

References m_data.

Referenced by OW_NAMESPACE::NonAuthenticatingAuthenticator::doAuthenticate(), OW_NAMESPACE::HTTPSvrConnection::processHeaders(), OW_NAMESPACE::HTTPSvrConnection::run(), and OW_NAMESPACE::AuthorizerManager::turnOff().


Member Data Documentation

const char *const OW_NAMESPACE::OperationContext::BYPASS_LOCKERKEY = "BYPASS_LOCKER" [static]
 

Definition at line 128 of file OW_OperationContext.hpp.

Referenced by OW_NAMESPACE::CIMRepository::beginOperation(), and OW_NAMESPACE::CIMRepository::endOperation().

const char *const OW_NAMESPACE::OperationContext::CLIENT_IPADDR = "CLIENT_IPADDR" [static]
 

Definition at line 131 of file OW_OperationContext.hpp.

Referenced by OW_NAMESPACE::HTTPSvrConnection::run().

const char *const OW_NAMESPACE::OperationContext::CURUSER_UIDKEY = "CURUSER_UIDKEY" [static]
 

Definition at line 127 of file OW_OperationContext.hpp.

const char *const OW_NAMESPACE::OperationContext::HTTP_ACCEPT_LANGUAGE_KEY = "HTTP_ACCEPT_LANGUAGE_KEY" [static]
 

Definition at line 130 of file OW_OperationContext.hpp.

const char *const OW_NAMESPACE::OperationContext::HTTP_PATH = "HTTP_PATH" [static]
 

Definition at line 126 of file OW_OperationContext.hpp.

Referenced by OW_NAMESPACE::HTTPSvrConnection::run().

SortedVectorMap<String, DataRef> OW_NAMESPACE::OperationContext::m_data [private]
 

Definition at line 144 of file OW_OperationContext.hpp.

Referenced by getData(), keyHasData(), removeData(), setData(), and setStringData().

const char *const OW_NAMESPACE::OperationContext::SESSION_LANGUAGE_KEY = "SESSION_LANGUAGE_KEY" [static]
 

Definition at line 129 of file OW_OperationContext.hpp.

Referenced by OW_NAMESPACE::HTTPSvrConnection::getContentLanguage().

const char *const OW_NAMESPACE::OperationContext::USER_NAME = "USER_NAME" [static]
 

Definition at line 124 of file OW_OperationContext.hpp.

Referenced by OW_NAMESPACE::NonAuthenticatingAuthenticator::doAuthenticate(), OW_NAMESPACE::BinaryRequestHandler::doProcess(), OW_NAMESPACE::RemoteProviderUtils::getRemoteClientCIMOMHandle(), getUserInfo(), OW_NAMESPACE::logOperation(), and OW_NAMESPACE::HTTPSvrConnection::processHeaders().

const char *const OW_NAMESPACE::OperationContext::USER_PASSWD = "USER_PASSWD" [static]
 

Definition at line 125 of file OW_OperationContext.hpp.

Referenced by OW_NAMESPACE::NonAuthenticatingAuthenticator::doAuthenticate().


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:14:08 2006 for openwbem by  doxygen 1.4.6