diff options
author | Spencer T Brody <spencer@10gen.com> | 2013-07-02 15:53:47 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2013-07-02 16:12:59 -0400 |
commit | 5741e9a35cfdbf7aa475f4a611f9b57c0c98134d (patch) | |
tree | c073edb88af8bcbb2bebf25a39cdad0b707288b9 /src/mongo/db/commands/shutdown.h | |
parent | ea7be9d5db2a3dde7c71ba21836dbb63180f438f (diff) | |
download | mongo-5741e9a35cfdbf7aa475f4a611f9b57c0c98134d.tar.gz |
Get authorization_manager.h out of commands.h to improve compile time by moving CmdShutdown to its own file
Diffstat (limited to 'src/mongo/db/commands/shutdown.h')
-rw-r--r-- | src/mongo/db/commands/shutdown.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/mongo/db/commands/shutdown.h b/src/mongo/db/commands/shutdown.h new file mode 100644 index 00000000000..a4b0cd8c069 --- /dev/null +++ b/src/mongo/db/commands/shutdown.h @@ -0,0 +1,54 @@ +/** +* Copyright (C) 2009 10gen Inc. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License, version 3, +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Affero General Public License for more details. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <string> +#include <vector> + +#include "mongo/db/auth/privilege.h" +#include "mongo/db/commands.h" +#include "mongo/db/jsobj.h" + +namespace mongo { + + class CmdShutdown : public Command { + public: + virtual bool requiresAuth() { return true; } + virtual bool adminOnly() const { return true; } + virtual bool localHostOnlyIfNoAuth(const BSONObj& cmdObj) { return true; } + virtual bool logTheOp() { + return false; + } + virtual bool slaveOk() const { + return true; + } + virtual void addRequiredPrivileges(const std::string& dbname, + const BSONObj& cmdObj, + std::vector<Privilege>* out); + virtual LockType locktype() const { return NONE; } + virtual void help( stringstream& help ) const; + CmdShutdown() : Command("shutdown") {} + bool run(const string& dbname, + BSONObj& cmdObj, + int options, + string& errmsg, + BSONObjBuilder& result, + bool fromRepl); + private: + bool shutdownHelper(); + }; + +} // namespace mongo + |