protected void replicationDatabase() throws IOException {
setDataCommandInfo("Replication command");
final ODocument request = new ODocument(channel.readBytes());
final ODistributedServerManager dManager = server.getDistributedManager();
if (dManager == null)
throw new OConfigurationException("No distributed manager configured");
final String operation = request.field("operation");
ODocument response = null;
if (operation.equals("start")) {
checkServerAccess("server.replication.start");
} else if (operation.equals("stop")) {
checkServerAccess("server.replication.stop");
} else if (operation.equals("config")) {
checkServerAccess("server.replication.config");
response = new ODocument().fromJSON(dManager.getDatabaseConfiguration((String) request.field("db")).serialize()
.toJSON("prettyPrint"));
}
sendResponse(response);