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_store & | get_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... | |
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.
|
explicit |
Constructor.
profiledb | An absolute path specifying the location of the profile database. If not specified (or "" is specified) the default location will be used (~/.openchange.profiles.ldb). |
debug | Whether to output debug information to stdout |
|
inline |
Uninitialize and clean up the MAPI session.
|
inline |
The underlying mapi_session.
Exposing this is temporary. Maybe be removed when we sort it out
|
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.
|
inline |
Obtain a reference to the message_store associated with this session.
|
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.
profile_name | The name of the profile to use to login with. If not specified (or "" is specified), then the default profile will be used. |
password | The password to use to login with. It is possible to omit this if the password is stored in the profile database. |
![]() ![]() ![]() |
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |