Public Member Functions | Protected Member Functions | List of all members
GSmtp::AdminServer Class Reference

A server class which implements the emailrelay administration interface. More...

#include <gadminserver.h>

Inheritance diagram for GSmtp::AdminServer:
GNet::MultiServer

Public Member Functions

 AdminServer (MessageStore &store, const GSmtp::Client::Config &client_config, const GAuth::Secrets &client_secrets, const GNet::MultiServer::AddressList &listening_addresses, bool allow_remote, const GNet::Address &local_address, const std::string &remote_address, unsigned int connection_timeout, const G::StringMap &extra_commands, bool with_terminate)
 Constructor. More...
 
virtual ~AdminServer ()
 Destructor. More...
 
void report () const
 Generates helpful diagnostics. More...
 
MessageStorestore ()
 Returns a reference to the message store, as passed in to the constructor. More...
 
const GAuth::Secretssecrets () const
 Returns a reference to the secrets object, as passed in to the constructor. More...
 
GSmtp::Client::Config clientConfig () const
 Returns the client configuration. More...
 
unsigned int connectionTimeout () const
 Returns the connection timeout, as passed in to the constructor. More...
 
void notify (const std::string &s0, const std::string &s1, const std::string &s2)
 Called when something happens which the admin user might be interested in. More...
 
void unregister (AdminServerPeer *)
 Called from the AdminServerPeer destructor. More...
 
- Public Member Functions inherited from GNet::MultiServer
 MultiServer (const AddressList &address_list, bool use_connection_lookup)
 Constructor. More...
 
 MultiServer ()
 Default constructor. Initialise with init(). More...
 
void init (const AddressList &address_list)
 Initilisation after default construction. More...
 
virtual ~MultiServer ()
 Destructor. More...
 
std::pair< bool, AddressfirstAddress () const
 Returns the first listening address. More...
 

Protected Member Functions

virtual GNet::ServerPeernewPeer (GNet::Server::PeerInfo)
 Final override from GNet::MultiServer. More...
 
- Protected Member Functions inherited from GNet::MultiServer
void serverCleanup ()
 Should be called from all derived classes' destructors so that peer objects can use their Server objects safely during their own destruction. More...
 
void serverReport (const std::string &server_type) const
 Writes to the system log a summary of the underlying server objects and their addresses. More...
 

Additional Inherited Members

- Public Types inherited from GNet::MultiServer
typedef std::list< AddressAddressList
 
typedef Server::PeerInfo PeerInfo
 
- Static Public Member Functions inherited from GNet::MultiServer
static bool canBind (const AddressList &listening_address_list, bool do_throw)
 Checks that the specified addresses can be bound. More...
 
static AddressList addressList (const Address &)
 A trivial convenience fuction that returns the given addresses as a single-element list. More...
 
static AddressList addressList (const AddressList &, unsigned int port)
 Returns the given list of addresses with the port set correctly. More...
 
static AddressList addressList (const G::Strings &, unsigned int port)
 A convenience function that returns a list of listening addresses given a list of listening interfaces and a port number. More...
 

Detailed Description

A server class which implements the emailrelay administration interface.

Definition at line 112 of file gadminserver.h.

Constructor & Destructor Documentation

GSmtp::AdminServer::AdminServer ( MessageStore store,
const GSmtp::Client::Config client_config,
const GAuth::Secrets client_secrets,
const GNet::MultiServer::AddressList listening_addresses,
bool  allow_remote,
const GNet::Address local_address,
const std::string &  remote_address,
unsigned int  connection_timeout,
const G::StringMap extra_commands,
bool  with_terminate 
)

Constructor.

The 'store' and 'client-secrets' references are kept.

Definition at line 299 of file gadminserver.cpp.

GSmtp::AdminServer::~AdminServer ( )
virtual

Destructor.

Definition at line 316 of file gadminserver.cpp.

Member Function Documentation

GSmtp::Client::Config GSmtp::AdminServer::clientConfig ( ) const

Returns the client configuration.

Definition at line 382 of file gadminserver.cpp.

unsigned int GSmtp::AdminServer::connectionTimeout ( ) const

Returns the connection timeout, as passed in to the constructor.

Definition at line 377 of file gadminserver.cpp.

GNet::ServerPeer * GSmtp::AdminServer::newPeer ( GNet::Server::PeerInfo  peer_info)
protectedvirtual

Final override from GNet::MultiServer.

Implements GNet::MultiServer.

Definition at line 322 of file gadminserver.cpp.

References G_WARNING, GNet::Local::isLocal(), and GNet::Server::PeerInfo::m_address.

void GSmtp::AdminServer::notify ( const std::string &  s0,
const std::string &  s1,
const std::string &  s2 
)

Called when something happens which the admin user might be interested in.

Definition at line 350 of file gadminserver.cpp.

References G_DEBUG.

Referenced by Main::Admin::notify().

void GSmtp::AdminServer::report ( ) const

Generates helpful diagnostics.

Definition at line 345 of file gadminserver.cpp.

Referenced by Main::Admin::report().

const GAuth::Secrets & GSmtp::AdminServer::secrets ( ) const

Returns a reference to the secrets object, as passed in to the constructor.

Note that this is a "client-side" secrets file, used to authenticate ourselves with a remote server.

Definition at line 372 of file gadminserver.cpp.

GSmtp::MessageStore & GSmtp::AdminServer::store ( )

Returns a reference to the message store, as passed in to the constructor.

Definition at line 367 of file gadminserver.cpp.

void GSmtp::AdminServer::unregister ( AdminServerPeer peer)

Called from the AdminServerPeer destructor.

Definition at line 359 of file gadminserver.cpp.

References G_DEBUG.


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