use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.
the class TestBatchRemoteResultSet method before.
@Before
public void before() throws ClassNotFoundException, MalformedObjectNameException, InstanceAlreadyExistsException, NotCompliantMBeanException, MBeanRegistrationException, InvocationTargetException, NoSuchMethodException, InstantiationException, IOException, IllegalAccessException {
server = new OServer(false);
server.startup(OrientGraphRemoteTest.class.getResourceAsStream("/embedded-server-config-single-run.xml"));
server.activate();
OServerAdmin admin = new OServerAdmin("remote:localhost:3064");
admin.connect("root", "root");
admin.createDatabase(OrientGraphRemoteTest.class.getSimpleName(), "graph", "memory");
admin.close();
}
use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.
the class TestDirtyTrackingTreeRidBagRemote method before.
@Before
public void before() throws ClassNotFoundException, MalformedObjectNameException, InstanceAlreadyExistsException, NotCompliantMBeanException, MBeanRegistrationException, InvocationTargetException, NoSuchMethodException, InstantiationException, IOException, IllegalAccessException {
server = new OServer(false);
server.startup(OrientGraphRemoteTest.class.getResourceAsStream("/embedded-server-config-single-run.xml"));
server.activate();
OServerAdmin admin = new OServerAdmin("remote:localhost:3064");
admin.connect("root", "root");
admin.createDatabase(TestDirtyTrackingTreeRidBagRemote.class.getSimpleName(), "graph", "memory");
admin.close();
}
use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.
the class OrientGraphMultithreadRemoteTest method startEmbeddedServer.
@BeforeClass
public static void startEmbeddedServer() throws Exception {
final String buildDirectory = System.getProperty("buildDirectory", ".");
serverHome = buildDirectory + "/" + OrientGraphMultithreadRemoteTest.class.getSimpleName();
File file = new File(serverHome);
deleteDirectory(file);
file = new File(serverHome);
Assert.assertTrue(file.mkdir());
oldOrientDBHome = System.getProperty("ORIENTDB_HOME");
System.setProperty("ORIENTDB_HOME", serverHome);
server = new OServer(false);
server.startup(OrientGraphMultithreadRemoteTest.class.getResourceAsStream("/embedded-server-config.xml"));
server.activate();
}
use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.
the class OrientGraphNoTxRemoteTest method startEmbeddedServer.
@BeforeClass
public static void startEmbeddedServer() throws Exception {
final String buildDirectory = System.getProperty("buildDirectory", ".");
serverHome = buildDirectory + "/" + OrientGraphNoTxRemoteTest.class.getSimpleName();
File file = new File(serverHome);
deleteDirectory(file);
file = new File(serverHome);
Assert.assertTrue(file.mkdir());
oldOrientDBHome = System.getProperty("ORIENTDB_HOME");
System.setProperty("ORIENTDB_HOME", serverHome);
server = new OServer(false);
server.startup(OrientGraphRemoteTest.class.getResourceAsStream("/embedded-server-config.xml"));
server.activate();
}
use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.
the class OCommandExecutorSQLHARemoveServer method execute.
/**
* Execute the command.
*/
public Object execute(final Map<Object, Object> iArgs) {
final ODatabaseDocumentInternal database = getDatabase();
database.checkSecurity(ORule.ResourceGeneric.SERVER, "remove", ORole.PERMISSION_EXECUTE);
final String dbUrl = database.getURL();
final String path = dbUrl.substring(dbUrl.indexOf(":") + 1);
final OServer serverInstance = OServer.getInstanceByPath(path);
final OHazelcastPlugin dManager = (OHazelcastPlugin) serverInstance.getDistributedManager();
if (dManager == null || !dManager.isEnabled())
throw new OCommandExecutionException("OrientDB is not started in distributed mode");
final String databaseName = database.getName();
return dManager.removeNodeFromConfiguration(parsedStatement.serverName.getStringValue(), databaseName, false, true);
}
Aggregations