diff --git a/server/src/main/java/com/arcadedb/server/http/HttpServer.java b/server/src/main/java/com/arcadedb/server/http/HttpServer.java index 6c5e67fec..a0d5322ed 100644 --- a/server/src/main/java/com/arcadedb/server/http/HttpServer.java +++ b/server/src/main/java/com/arcadedb/server/http/HttpServer.java @@ -26,23 +26,15 @@ import com.arcadedb.server.ArcadeDBServer; import com.arcadedb.server.ServerException; import com.arcadedb.server.ServerPlugin; -import com.arcadedb.server.http.handler.DeleteDropUserHandler; import com.arcadedb.server.http.handler.GetDatabasesHandler; -import com.arcadedb.server.http.handler.GetDocumentHandler; import com.arcadedb.server.http.handler.GetDynamicContentHandler; import com.arcadedb.server.http.handler.GetExistsDatabaseHandler; import com.arcadedb.server.http.handler.GetQueryHandler; import com.arcadedb.server.http.handler.GetReadyHandler; import com.arcadedb.server.http.handler.GetServerHandler; import com.arcadedb.server.http.handler.PostBeginHandler; -import com.arcadedb.server.http.handler.PostCloseDatabaseHandler; import com.arcadedb.server.http.handler.PostCommandHandler; import com.arcadedb.server.http.handler.PostCommitHandler; -import com.arcadedb.server.http.handler.PostCreateDatabaseHandler; -import com.arcadedb.server.http.handler.PostCreateDocumentHandler; -import com.arcadedb.server.http.handler.PostCreateUserHandler; -import com.arcadedb.server.http.handler.PostDropDatabaseHandler; -import com.arcadedb.server.http.handler.PostOpenDatabaseHandler; import com.arcadedb.server.http.handler.PostQueryHandler; import com.arcadedb.server.http.handler.PostRollbackHandler; import com.arcadedb.server.http.handler.PostServerCommandHandler; @@ -131,21 +123,13 @@ public void startService() { routes.addPrefixPath("/api/v1",// basicRoutes// .post("/begin/{database}", new PostBeginHandler(this))// - .post("/close/{database}", new PostCloseDatabaseHandler(this))// DEPRECATED .post("/command/{database}", new PostCommandHandler(this))// .post("/commit/{database}", new PostCommitHandler(this))// - .post("/create/{database}", new PostCreateDatabaseHandler(this))// - .get("/databases", new GetDatabasesHandler(this))// DEPRECATED - .get("/document/{database}/{rid}", new GetDocumentHandler(this))// DEPRECATED - .post("/document/{database}", new PostCreateDocumentHandler(this))// DEPRECATED - .post("/drop/{database}", new PostDropDatabaseHandler(this))// DEPRECATED + .get("/databases", new GetDatabasesHandler(this))// .get("/exists/{database}", new GetExistsDatabaseHandler(this))// - .post("/open/{database}", new PostOpenDatabaseHandler(this))// DEPRECATED .get("/query/{database}/{language}/{command}", new GetQueryHandler(this))// .post("/query/{database}", new PostQueryHandler(this))// .post("/rollback/{database}", new PostRollbackHandler(this))// - .post("/user", new PostCreateUserHandler(this))// DEPRECATED - .delete("/user/{userName}", new DeleteDropUserHandler(this))// DEPRECATED .get("/server", new GetServerHandler(this))// .post("/server", new PostServerCommandHandler(this))// .get("/ready", new GetReadyHandler(this))// diff --git a/server/src/main/java/com/arcadedb/server/http/handler/GetDocumentHandler.java b/server/src/main/java/com/arcadedb/server/http/handler/GetDocumentHandler.java deleted file mode 100644 index e277dc6e7..000000000 --- a/server/src/main/java/com/arcadedb/server/http/handler/GetDocumentHandler.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-FileCopyrightText: 2021-present Arcade Data Ltd (info@arcadedata.com) - * SPDX-License-Identifier: Apache-2.0 - */ -package com.arcadedb.server.http.handler; - -import com.arcadedb.database.Database; -import com.arcadedb.database.Document; -import com.arcadedb.database.RID; -import com.arcadedb.server.http.HttpServer; -import com.arcadedb.server.security.ServerSecurityUser; -import io.undertow.server.HttpServerExchange; - -import java.util.*; - -/** - * Deprecated. Use the query language instead. To retrieve a document by record id, use SQL `SELECT FROM ` statement. Example: `SELECT FROM #10:33`. - * - * @Deprecated - */ -@Deprecated -public class GetDocumentHandler extends DatabaseAbstractHandler { - public GetDocumentHandler(final HttpServer httpServer) { - super(httpServer); - } - - @Override - public ExecutionResponse execute(final HttpServerExchange exchange, final ServerSecurityUser user, final Database database) { - final Deque rid = exchange.getQueryParameters().get("rid"); - if (rid == null || rid.isEmpty()) - return new ExecutionResponse(400, "{ \"error\" : \"Record id is null\"}"); - - httpServer.getServer().getServerMetrics().meter("http.get-record").hit(); - - final String[] ridParts = rid.getFirst().split(":"); - - final Document record = (Document) database.lookupByRID(new RID(database, Integer.parseInt(ridParts[0]), Long.parseLong(ridParts[1])), true); - - final String response = "{ \"result\" : " + httpServer.getJsonSerializer().serializeDocument(record).toString() + "}"; - - return new ExecutionResponse(200, response); - } - - @Override - protected boolean requiresTransaction() { - return false; - } -} diff --git a/server/src/main/java/com/arcadedb/server/http/handler/PostCloseDatabaseHandler.java b/server/src/main/java/com/arcadedb/server/http/handler/PostCloseDatabaseHandler.java deleted file mode 100644 index fb7e952f7..000000000 --- a/server/src/main/java/com/arcadedb/server/http/handler/PostCloseDatabaseHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-FileCopyrightText: 2021-present Arcade Data Ltd (info@arcadedata.com) - * SPDX-License-Identifier: Apache-2.0 - */ -package com.arcadedb.server.http.handler; - -import com.arcadedb.database.Database; -import com.arcadedb.database.DatabaseInternal; -import com.arcadedb.server.http.HttpServer; -import com.arcadedb.server.security.ServerSecurityUser; -import io.undertow.server.HttpServerExchange; - -/** - * Closes a database on the server. This command is useful in case of restore or to simply free resources. - * - * @author Luca Garulli (l.garulli@arcadedata.com) - * @Deprecated Use the generic @see PostServerCommandHandler - */ -@Deprecated -public class PostCloseDatabaseHandler extends DatabaseAbstractHandler { - public PostCloseDatabaseHandler(final HttpServer httpServer) { - super(httpServer); - } - - @Override - public ExecutionResponse execute(final HttpServerExchange exchange, final ServerSecurityUser user, final Database database) { - checkRootUser(user); - - ((DatabaseInternal) database).getEmbedded().close(); - - httpServer.getServer().getServerMetrics().meter("http.close-database").hit(); - - httpServer.getServer().removeDatabase(database.getName()); - - return new ExecutionResponse(200, "{ \"result\" : \"ok\"}"); - } - - @Override - protected boolean requiresTransaction() { - return false; - } -} diff --git a/server/src/main/java/com/arcadedb/server/http/handler/PostCreateDatabaseHandler.java b/server/src/main/java/com/arcadedb/server/http/handler/PostCreateDatabaseHandler.java deleted file mode 100644 index 5de811831..000000000 --- a/server/src/main/java/com/arcadedb/server/http/handler/PostCreateDatabaseHandler.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-FileCopyrightText: 2021-present Arcade Data Ltd (info@arcadedata.com) - * SPDX-License-Identifier: Apache-2.0 - */ -package com.arcadedb.server.http.handler; - -import com.arcadedb.GlobalConfiguration; -import com.arcadedb.database.DatabaseInternal; -import com.arcadedb.engine.ComponentFile; -import com.arcadedb.network.binary.ServerIsNotTheLeaderException; -import com.arcadedb.server.ArcadeDBServer; -import com.arcadedb.server.ha.ReplicatedDatabase; -import com.arcadedb.server.http.HttpServer; -import com.arcadedb.server.security.ServerSecurityUser; -import io.undertow.server.HttpServerExchange; - -import java.util.*; - -/** - * Creates a new database on a server. - * - * @author Luca Garulli (l.garulli@arcadedata.com) - * @Deprecated Use the generic @see PostServerCommandHandler - */ -@Deprecated -public class PostCreateDatabaseHandler extends AbstractHandler { - public PostCreateDatabaseHandler(final HttpServer httpServer) { - super(httpServer); - } - - @Override - public ExecutionResponse execute(final HttpServerExchange exchange, final ServerSecurityUser user) { - checkRootUser(user); - - final Deque databaseNamePar = exchange.getQueryParameters().get("database"); - String databaseName = databaseNamePar.isEmpty() ? null : databaseNamePar.getFirst().trim(); - if (databaseName.isEmpty()) - databaseName = null; - - if (databaseName == null) - return new ExecutionResponse(400, "{ \"error\" : \"Database parameter is null\"}"); - - final ArcadeDBServer server = httpServer.getServer(); - if (!server.getHA().isLeader()) - // NOT THE LEADER - throw new ServerIsNotTheLeaderException("Creation of database can be executed only on the leader server", server.getHA().getLeaderName()); - - server.getServerMetrics().meter("http.create-database").hit(); - - final DatabaseInternal db = server.createDatabase(databaseName, ComponentFile.MODE.READ_WRITE); - - if (server.getConfiguration().getValueAsBoolean(GlobalConfiguration.HA_ENABLED)) { - final ReplicatedDatabase replicatedDatabase = (ReplicatedDatabase) db.getEmbedded(); - replicatedDatabase.createInReplicas(); - } - - return new ExecutionResponse(200, "{ \"result\" : \"ok\"}"); - } -} diff --git a/server/src/main/java/com/arcadedb/server/http/handler/PostCreateDocumentHandler.java b/server/src/main/java/com/arcadedb/server/http/handler/PostCreateDocumentHandler.java deleted file mode 100644 index 7a73464cc..000000000 --- a/server/src/main/java/com/arcadedb/server/http/handler/PostCreateDocumentHandler.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-FileCopyrightText: 2021-present Arcade Data Ltd (info@arcadedata.com) - * SPDX-License-Identifier: Apache-2.0 - */ -package com.arcadedb.server.http.handler; - -import com.arcadedb.database.Database; -import com.arcadedb.database.MutableDocument; -import com.arcadedb.graph.MutableEdge; -import com.arcadedb.schema.DocumentType; -import com.arcadedb.schema.EdgeType; -import com.arcadedb.schema.VertexType; -import com.arcadedb.serializer.json.JSONObject; -import com.arcadedb.server.http.HttpServer; -import com.arcadedb.server.security.ServerSecurityUser; -import io.undertow.server.HttpServerExchange; - -import java.io.*; - -/** - * Deprecated. Use the query language instead. To create a new document you can use the SQL INSERT statement. Example: `INSERT INTO Account SET name = 'Elon'`. - * - * @Deprecated - */ -@Deprecated -public class PostCreateDocumentHandler extends DatabaseAbstractHandler { - public PostCreateDocumentHandler(final HttpServer httpServer) { - super(httpServer); - } - - @Override - protected boolean mustExecuteOnWorkerThread() { - return true; - } - - @Override - public ExecutionResponse execute(final HttpServerExchange exchange, final ServerSecurityUser user, final Database database) throws IOException { - final String payload = parseRequestPayload(exchange); - - final JSONObject json = new JSONObject(payload); - - final String typeName = (String) json.remove("@type"); - if (typeName == null) - return new ExecutionResponse(400, "{ \"error\" : \"@type attribute not found in the record payload\"}"); - - httpServer.getServer().getServerMetrics().meter("http.create-record").hit(); - - final DocumentType type = database.getSchema().getType(typeName); - - final MutableDocument document; - if (type instanceof VertexType) - document = database.newVertex(typeName); - else if (type instanceof EdgeType) - document = new MutableEdge(database, (EdgeType) type, null); - else - document = database.newDocument(typeName); - - document.fromJSON(json); - document.save(); - - return new ExecutionResponse(200, "{ \"result\" : \"" + document.getIdentity() + "\"}"); - } -} diff --git a/server/src/main/java/com/arcadedb/server/http/handler/PostCreateUserHandler.java b/server/src/main/java/com/arcadedb/server/http/handler/PostCreateUserHandler.java deleted file mode 100644 index ae0516845..000000000 --- a/server/src/main/java/com/arcadedb/server/http/handler/PostCreateUserHandler.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-FileCopyrightText: 2021-present Arcade Data Ltd (info@arcadedata.com) - * SPDX-License-Identifier: Apache-2.0 - */ -package com.arcadedb.server.http.handler; - -import com.arcadedb.serializer.json.JSONObject; -import com.arcadedb.server.http.HttpServer; -import com.arcadedb.server.security.ServerSecurityException; -import com.arcadedb.server.security.ServerSecurityUser; -import io.undertow.server.HttpServerExchange; - -/** - * Creates a new server user. - * - * @author Luca Garulli (l.garulli@arcadedata.com) - * @Deprecated Use the generic @see PostServerCommandHandler - */ -@Deprecated -public class PostCreateUserHandler extends AbstractHandler { - public PostCreateUserHandler(final HttpServer httpServer) { - super(httpServer); - } - - @Override - protected boolean mustExecuteOnWorkerThread() { - return true; - } - - @Override - public ExecutionResponse execute(final HttpServerExchange exchange, final ServerSecurityUser user) { - checkRootUser(user); - - final String payload = parseRequestPayload(exchange); - if (payload == null || payload.isEmpty()) - return new ExecutionResponse(400, "{ \"error\" : \"Payload requested\"}"); - - final JSONObject json = new JSONObject(payload); - - if (!json.has("name")) - return new ExecutionResponse(400, "{ \"error\" : \"User name is null\"}"); - - final String userPassword = json.getString("password"); - if (userPassword.length() < 4) - throw new ServerSecurityException("User password must be 5 minimum characters"); - if (userPassword.length() > 256) - throw new ServerSecurityException("User password cannot be longer than 256 characters"); - - json.put("password", httpServer.getServer().getSecurity().encodePassword(userPassword)); - - httpServer.getServer().getServerMetrics().meter("http.create-user").hit(); - - httpServer.getServer().getSecurity().createUser(json); - - return new ExecutionResponse(204, ""); - } -} diff --git a/server/src/main/java/com/arcadedb/server/http/handler/PostDropDatabaseHandler.java b/server/src/main/java/com/arcadedb/server/http/handler/PostDropDatabaseHandler.java deleted file mode 100644 index 6fd9b16c9..000000000 --- a/server/src/main/java/com/arcadedb/server/http/handler/PostDropDatabaseHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-FileCopyrightText: 2021-present Arcade Data Ltd (info@arcadedata.com) - * SPDX-License-Identifier: Apache-2.0 - */ -package com.arcadedb.server.http.handler; - -import com.arcadedb.database.Database; -import com.arcadedb.database.DatabaseInternal; -import com.arcadedb.server.http.HttpServer; -import com.arcadedb.server.security.ServerSecurityUser; -import io.undertow.server.HttpServerExchange; - -/** - * Drops a database. - * - * @author Luca Garulli (l.garulli@arcadedata.com) - * @Deprecated Use the generic @see PostServerCommandHandler - */ -@Deprecated -public class PostDropDatabaseHandler extends DatabaseAbstractHandler { - public PostDropDatabaseHandler(final HttpServer httpServer) { - super(httpServer); - } - - @Override - public ExecutionResponse execute(final HttpServerExchange exchange, final ServerSecurityUser user, final Database database) { - checkRootUser(user); - - ((DatabaseInternal) database).getEmbedded().drop(); - - httpServer.getServer().getServerMetrics().meter("http.drop-database").hit(); - - httpServer.getServer().removeDatabase(database.getName()); - - return new ExecutionResponse(200, "{ \"result\" : \"ok\"}"); - } - - @Override - protected boolean requiresTransaction() { - return false; - } -} diff --git a/server/src/main/java/com/arcadedb/server/http/handler/PostOpenDatabaseHandler.java b/server/src/main/java/com/arcadedb/server/http/handler/PostOpenDatabaseHandler.java deleted file mode 100644 index 88ccfcf12..000000000 --- a/server/src/main/java/com/arcadedb/server/http/handler/PostOpenDatabaseHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-FileCopyrightText: 2021-present Arcade Data Ltd (info@arcadedata.com) - * SPDX-License-Identifier: Apache-2.0 - */ -package com.arcadedb.server.http.handler; - -import com.arcadedb.database.Database; -import com.arcadedb.server.http.HttpServer; -import com.arcadedb.server.security.ServerSecurityUser; -import io.undertow.server.HttpServerExchange; - -import java.util.*; - -/** - * Opens a database on the server. This command is useful when a database has been closed for a restore. - * - * @Deprecated Use the generic @see PostServerCommandHandler - */ -@Deprecated -public class PostOpenDatabaseHandler extends DatabaseAbstractHandler { - public PostOpenDatabaseHandler(final HttpServer httpServer) { - super(httpServer); - } - - @Override - public ExecutionResponse execute(final HttpServerExchange exchange, final ServerSecurityUser user, final Database database) { - checkRootUser(user); - - httpServer.getServer().getServerMetrics().meter("http.open-database").hit(); - - final Deque databaseName = exchange.getQueryParameters().get("database"); - - httpServer.getServer().getDatabase(databaseName.getFirst()); - - return new ExecutionResponse(200, "{ \"result\" : \"ok\"}"); - } - - @Override - protected boolean requiresTransaction() { - return false; - } - - @Override - protected boolean requiresDatabase() { - return false; - } -} diff --git a/server/src/main/java/com/arcadedb/server/http/handler/PostServerCommandHandler.java b/server/src/main/java/com/arcadedb/server/http/handler/PostServerCommandHandler.java index 0c2387849..70941da05 100644 --- a/server/src/main/java/com/arcadedb/server/http/handler/PostServerCommandHandler.java +++ b/server/src/main/java/com/arcadedb/server/http/handler/PostServerCommandHandler.java @@ -78,6 +78,8 @@ public ExecutionResponse execute(final HttpServerExchange exchange, final Server if (command == null) return new ExecutionResponse(400, "{ \"error\" : \"Server command is null\"}"); + final JSONObject response = createResult(user, null).put("result","ok"); + final String command_lc = command.toLowerCase(); if (command_lc.equals(LIST_DATABASES)) @@ -109,7 +111,7 @@ else if (command_lc.startsWith(SET_DATABASE_SETTING)) else if (command_lc.startsWith(SET_SERVER_SETTING)) setServerSetting(command.substring(SET_SERVER_SETTING.length()).trim()); else if (command_lc.startsWith(GET_SERVER_EVENTS)) - return getServerEvents(command.substring(GET_SERVER_EVENTS.length()).trim()); + response.put("result",getServerEvents(command.substring(GET_SERVER_EVENTS.length()).trim())); else if (command_lc.startsWith(ALIGN_DATABASE)) alignDatabase(command.substring(ALIGN_DATABASE.length()).trim()); else { @@ -117,7 +119,7 @@ else if (command_lc.startsWith(ALIGN_DATABASE)) return new ExecutionResponse(400, "{ \"error\" : \"Server command not valid\"}"); } - return new ExecutionResponse(200, "{ \"result\" : \"ok\"}"); + return new ExecutionResponse(200, response.toString()); } private ExecutionResponse listDatabases(final ServerSecurityUser user) { @@ -130,7 +132,9 @@ private ExecutionResponse listDatabases(final ServerSecurityUser user) { if (!allowedDatabases.contains("*")) installedDatabases.retainAll(allowedDatabases); - return new ExecutionResponse(200, "{ \"result\" : " + new JSONArray(installedDatabases) + "}"); + final JSONObject response = createResult(user, null).put("result",new JSONArray(installedDatabases)); + + return new ExecutionResponse(200,response.toString()); } private void shutdownServer(final String serverName) throws IOException { @@ -270,14 +274,14 @@ private void setServerSetting(final String pair) { httpServer.getServer().getConfiguration().setValue(keyValue[0], keyValue[1]); } - private ExecutionResponse getServerEvents(final String fileName) { + private String getServerEvents(final String fileName) { final ArcadeDBServer server = httpServer.getServer(); server.getServerMetrics().meter("http.get-server-events").hit(); final JSONArray events = fileName.isEmpty() ? server.getEventLog().getCurrentEvents() : server.getEventLog().getEvents(fileName); final JSONArray files = server.getEventLog().getFiles(); - return new ExecutionResponse(200, "{ \"result\" : { \"events\": " + events + ", \"files\": " + files + " } }"); + return "{ \"events\": " + events + ", \"files\": " + files + " }"; } private void alignDatabase(final String databaseName) {