use of com.orientechnologies.orient.server.config.OServerCommandConfiguration in project orientdb by orientechnologies.
the class OServerNetworkListener method createCommand.
@SuppressWarnings("unchecked")
public static OServerCommand createCommand(final OServer server, final OServerCommandConfiguration iCommand) {
try {
final Constructor<OServerCommand> c = (Constructor<OServerCommand>) Class.forName(iCommand.implementation).getConstructor(OServerCommandConfiguration.class);
final OServerCommand cmd = c.newInstance(new Object[] { iCommand });
cmd.configure(server);
return cmd;
} catch (Exception e) {
throw new IllegalArgumentException("Cannot create custom command invoking the constructor: " + iCommand.implementation + "(" + iCommand + ")", e);
}
}
use of com.orientechnologies.orient.server.config.OServerCommandConfiguration in project orientdb by orientechnologies.
the class ONetworkProtocolHttpAbstract method registerStatelessCommands.
protected void registerStatelessCommands(final OServerNetworkListener iListener) {
cmdManager = new OHttpNetworkCommandManager(server, null);
cmdManager.registerCommand(new OServerCommandGetConnect());
cmdManager.registerCommand(new OServerCommandGetDisconnect());
cmdManager.registerCommand(new OServerCommandGetClass());
cmdManager.registerCommand(new OServerCommandGetCluster());
cmdManager.registerCommand(new OServerCommandGetDatabase());
cmdManager.registerCommand(new OServerCommandGetDictionary());
cmdManager.registerCommand(new OServerCommandGetDocument());
cmdManager.registerCommand(new OServerCommandGetDocumentByClass());
cmdManager.registerCommand(new OServerCommandGetQuery());
cmdManager.registerCommand(new OServerCommandGetServer());
cmdManager.registerCommand(new OServerCommandGetConnections());
cmdManager.registerCommand(new OServerCommandGetStorageAllocation());
cmdManager.registerCommand(new OServerCommandGetFileDownload());
cmdManager.registerCommand(new OServerCommandGetIndex());
cmdManager.registerCommand(new OServerCommandGetListDatabases());
cmdManager.registerCommand(new OServerCommandIsEnterprise());
cmdManager.registerCommand(new OServerCommandGetExportDatabase());
cmdManager.registerCommand(new OServerCommandPatchDocument());
cmdManager.registerCommand(new OServerCommandPostBatch());
cmdManager.registerCommand(new OServerCommandPostClass());
cmdManager.registerCommand(new OServerCommandPostCommand());
cmdManager.registerCommand(new OServerCommandPostDatabase());
cmdManager.registerCommand(new OServerCommandPostInstallDatabase());
cmdManager.registerCommand(new OServerCommandPostDocument());
cmdManager.registerCommand(new OServerCommandPostImportRecords());
cmdManager.registerCommand(new OServerCommandPostProperty());
cmdManager.registerCommand(new OServerCommandPostConnection());
cmdManager.registerCommand(new OServerCommandPostServer());
cmdManager.registerCommand(new OServerCommandPostStudio());
cmdManager.registerCommand(new OServerCommandPutDocument());
cmdManager.registerCommand(new OServerCommandPutIndex());
cmdManager.registerCommand(new OServerCommandDeleteClass());
cmdManager.registerCommand(new OServerCommandDeleteDatabase());
cmdManager.registerCommand(new OServerCommandDeleteDocument());
cmdManager.registerCommand(new OServerCommandDeleteProperty());
cmdManager.registerCommand(new OServerCommandDeleteIndex());
cmdManager.registerCommand(new OServerCommandOptions());
cmdManager.registerCommand(new OServerCommandFunction());
cmdManager.registerCommand(new OServerCommandPostKillDbConnection());
cmdManager.registerCommand(new OServerCommandGetSupportedLanguages());
cmdManager.registerCommand(new OServerCommandPostAuthToken());
cmdManager.registerCommand(new OServerCommandGetSSO());
cmdManager.registerCommand(new OServerCommandGetPing());
for (OServerCommandConfiguration c : iListener.getStatefulCommands()) try {
cmdManager.registerCommand(OServerNetworkListener.createCommand(server, c));
} catch (Exception e) {
OLogManager.instance().error(this, "Error on creating stateful command '%s'", e, c.implementation);
}
for (OServerCommand c : iListener.getStatelessCommands()) cmdManager.registerCommand(c);
}
Aggregations