// Licensed to the Software Freedom Conservancy (SFC) under one1// or more contributor license agreements. See the NOTICE file2// distributed with this work for additional information3// regarding copyright ownership. The SFC licenses this file4// to you under the Apache License, Version 2.0 (the "License");5// you may not use this file except in compliance with the License.6// You may obtain a copy of the License at7//8// http://www.apache.org/licenses/LICENSE-2.09//10// Unless required by applicable law or agreed to in writing, software11// distributed under the License is distributed on an "AS IS" BASIS,12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13// See the License for the specific language governing permissions and14// limitations under the License.1516// Defines a command for use in the JSON Wire Protocol. The protocol is17// defined at http://code.google.com/p/selenium/wiki/JsonWireProtocol.1819#ifndef WEBDRIVER_SERVER_COMMAND_H_20#define WEBDRIVER_SERVER_COMMAND_H_2122#include <map>23#include <string>24#include "json.h"2526namespace webdriver {2728typedef std::map<std::string, Json::Value> ParametersMap;2930class Command {31public:32Command(void);33virtual ~Command(void);34std::string Serialize(void);35void Deserialize(const std::string& json);36void Copy(const Command& source);37void Reset(void);3839std::string command_type(void) const { return this->command_type_; }40bool is_valid_parameters(void) const { return this->is_valid_parameters_; }41ParametersMap command_parameters(void) const {42return this->command_parameters_;43}4445private:46// The type of command this represents.47std::string command_type_;48// Session ID for this command.49std::string session_id_;50// Flag indicating that parameters were valid.51bool is_valid_parameters_;52// Command parameters passed as JSON in the body of the request.53ParametersMap command_parameters_;5455DISALLOW_COPY_AND_ASSIGN(Command);56};5758} // namespace webdriver5960#endif // WEBDRIVER_SERVER_COMMAND_H_616263