|
28 | 28 | import com.arangodb.entity.DefaultEntity; |
29 | 29 | import com.arangodb.entity.DocumentEntity; |
30 | 30 | import com.arangodb.entity.EntityFactory; |
| 31 | +import com.arangodb.entity.QueriesResultEntity; |
| 32 | +import com.arangodb.entity.QueryTrackingPropertiesEntity; |
31 | 33 | import com.arangodb.entity.ShortestPathEntity; |
32 | 34 | import com.arangodb.http.HttpManager; |
33 | 35 | import com.arangodb.http.HttpResponseEntity; |
@@ -150,8 +152,8 @@ public <V, E> ShortestPathEntity<V, E> getShortesPath( |
150 | 152 |
|
151 | 153 | String query = "for i in graph_shortest_path(@graphName, @startVertexExample, @endVertexExample, @options) return i"; |
152 | 154 |
|
153 | | - Map<String, Object> options = shortestPathOptions == null ? new MapBuilder().get() : shortestPathOptions |
154 | | - .toMap(); |
| 155 | + Map<String, Object> options = shortestPathOptions == null ? new MapBuilder().get() |
| 156 | + : shortestPathOptions.toMap(); |
155 | 157 |
|
156 | 158 | Map<String, Object> bindVars = new MapBuilder().put("graphName", graphName) |
157 | 159 | .put("startVertexExample", startVertexExample).put("endVertexExample", endVertexExample) |
@@ -214,4 +216,50 @@ public <T> CursorResultSet<T> executeQueryWithResultSet( |
214 | 216 |
|
215 | 217 | } |
216 | 218 |
|
| 219 | + @Override |
| 220 | + public QueryTrackingPropertiesEntity getQueryTrackingProperties(String database) throws ArangoException { |
| 221 | + |
| 222 | + HttpResponseEntity res = httpManager.doGet(createEndpointUrl(database, "/_api/query/properties"), null, null); |
| 223 | + |
| 224 | + return createEntity(res, QueryTrackingPropertiesEntity.class); |
| 225 | + } |
| 226 | + |
| 227 | + @Override |
| 228 | + public QueryTrackingPropertiesEntity setQueryTrackingProperties( |
| 229 | + String database, |
| 230 | + QueryTrackingPropertiesEntity properties) throws ArangoException { |
| 231 | + HttpResponseEntity res = httpManager.doPut(createEndpointUrl(database, "/_api/query/properties"), null, |
| 232 | + EntityFactory.toJsonString(properties)); |
| 233 | + |
| 234 | + return createEntity(res, QueryTrackingPropertiesEntity.class); |
| 235 | + } |
| 236 | + |
| 237 | + @Override |
| 238 | + public QueriesResultEntity getCurrentlyRunningQueries(String database) throws ArangoException { |
| 239 | + HttpResponseEntity res = httpManager.doGet(createEndpointUrl(database, "/_api/query/current"), null, null); |
| 240 | + |
| 241 | + return createEntity(res, QueriesResultEntity.class); |
| 242 | + } |
| 243 | + |
| 244 | + @Override |
| 245 | + public QueriesResultEntity getSlowQueries(String database) throws ArangoException { |
| 246 | + HttpResponseEntity res = httpManager.doGet(createEndpointUrl(database, "/_api/query/slow"), null, null); |
| 247 | + |
| 248 | + return createEntity(res, QueriesResultEntity.class); |
| 249 | + } |
| 250 | + |
| 251 | + @Override |
| 252 | + public DefaultEntity deleteSlowQueries(String database) throws ArangoException { |
| 253 | + HttpResponseEntity res = httpManager.doDelete(createEndpointUrl(database, "/_api/query/slow"), null, null); |
| 254 | + |
| 255 | + return createEntity(res, DefaultEntity.class); |
| 256 | + } |
| 257 | + |
| 258 | + @Override |
| 259 | + public DefaultEntity killQuery(String database, String id) throws ArangoException { |
| 260 | + HttpResponseEntity res = httpManager.doDelete(createEndpointUrl(database, "/_api/query", id), null, null); |
| 261 | + |
| 262 | + return createEntity(res, DefaultEntity.class); |
| 263 | + } |
| 264 | + |
217 | 265 | } |
0 commit comments