4
* Copyright (C) 2008 10gen Inc.
6
* This program is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU Affero General Public License, version 3,
8
* as published by the Free Software Foundation.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
//#include "security.h"
23
#include "../util/net/hostandport.h"
27
class AuthenticationInfo;
30
* this is the base class for Client and ClientInfo
31
* Client is for mongod
32
* ClientInfo is for mongos
33
* They should converge slowly
34
* The idea is this has the basic api so that not all code has to be duplicated
36
class ClientBasic : boost::noncopyable {
38
virtual ~ClientBasic(){}
39
virtual const AuthenticationInfo * getAuthenticationInfo() const = 0;
40
virtual AuthenticationInfo * getAuthenticationInfo() = 0;
42
virtual bool hasRemote() const = 0;
43
virtual HostAndPort getRemote() const = 0;
45
static ClientBasic* getCurrent();
46
static bool hasCurrent();