libmapipp::session Class Reference

This class represents a MAPI session with the Exchange Server. More...

#include <session.h>

Public Member Functions

mapi_session * get_mapi_session () throw ()
 The underlying mapi_session. More...
 
TALLOC_CTX * get_memory_ctx () throw ()
 Obtain a talloc memory context for this session. More...
 
message_storeget_message_store () throw ()
 Obtain a reference to the message_store associated with this session. More...
 
std::string get_profile_name () const
 The name of the profile that is in use. More...
 
void login (const std::string &profile_name="", const std::string &password="") throw (mapi_exception)
 Log-in to the Exchange Server. More...
 
 session (const std::string &profiledb="", const bool debug=false) throw (std::runtime_error, mapi_exception)
 Constructor. More...
 
 ~session ()
 Uninitialize and clean up the MAPI session. More...
 

Detailed Description

This class represents a MAPI session with the Exchange Server.

The session is best thought of as the connection by a single user to a single server. It is possible to have multiple sessions open at the same time.

A key concept in the session is that of a profile, and the profile database. The profile is a pre-established data set that specifies the server information (e.g. server name / IP address, and Exchange domain) and client information (e.g. the user name, preferred language, and optionally the users password). The profiles are stored in a local store (Samba LDB database) known as the profile store or profile database. One of the profiles in the profile database can be designated as the default profile (which is particularly useful given that most users may only have one). See the profile class documentation for more information.

The general concept is that you create a session object, log in to the session using a selected profile name, and then work with the message_store associated with that session. The message_store is only valid so long as the session is valid.

Examples:
attach_test.cpp, foldertree.cpp, messages.cpp, and test.cpp.

Constructor & Destructor Documentation

libmapipp::session::session ( const std::string &  profiledb = "",
const bool  debug = false 
)
throw (std::runtime_error,
mapi_exception
)
explicit

Constructor.

Parameters
profiledbAn absolute path specifying the location of the profile database. If not specified (or "" is specified) the default location will be used (~/.openchange.profiles.ldb).
debugWhether to output debug information to stdout
libmapipp::session::~session ( )
inline

Uninitialize and clean up the MAPI session.

Member Function Documentation

mapi_session* libmapipp::session::get_mapi_session ( )
throw (
)
inline

The underlying mapi_session.

Exposing this is temporary. Maybe be removed when we sort it out

TALLOC_CTX* libmapipp::session::get_memory_ctx ( )
throw (
)
inline

Obtain a talloc memory context for this session.

This pointer can be used for subsequent memory allocations, and these will be cleaned up when the session is terminated.

message_store& libmapipp::session::get_message_store ( )
throw (
)
inline

Obtain a reference to the message_store associated with this session.

Returns
The message_store associated with this session.
Examples:
attach_test.cpp, foldertree.cpp, messages.cpp, and test.cpp.
std::string libmapipp::session::get_profile_name ( ) const
inline

The name of the profile that is in use.

Calling this method only makes sense if login() has been called with this session object.

void libmapipp::session::login ( const std::string &  profile_name = "",
const std::string &  password = "" 
)
throw (mapi_exception
)

Log-in to the Exchange Server.

Parameters
profile_nameThe name of the profile to use to login with. If not specified (or "" is specified), then the default profile will be used.
passwordThe password to use to login with. It is possible to omit this if the password is stored in the profile database.
Examples:
attach_test.cpp, foldertree.cpp, messages.cpp, and test.cpp.

The documentation for this class was generated from the following file:

Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/