use of com.orientechnologies.orient.client.remote.OStorageRemote in project orientdb by orientechnologies.
the class ORemoteImportTest method testImport.
@Test
public void testImport() throws UnsupportedEncodingException {
ODatabaseDocumentInternal db = new ODatabaseDocumentTx("remote:localhost/" + ORemoteImportTest.class.getSimpleName());
db.open("admin", "admin");
try {
String content = "{\"records\": [{\"@type\": \"d\", \"@rid\": \"#9:0\",\"@version\": 1,\"@class\": \"V\"}]}";
OStorageRemote storage = (OStorageRemote) db.getStorage();
final StringBuffer buff = new StringBuffer();
storage.importDatabase("-merge=true", new ByteArrayInputStream(content.getBytes("UTF8")), "data.json", new OCommandOutputListener() {
@Override
public void onMessage(String iText) {
buff.append(iText);
}
});
assertTrue(buff.toString().contains("Database import completed"));
} finally {
db.close();
}
}
use of com.orientechnologies.orient.client.remote.OStorageRemote in project orientdb by orientechnologies.
the class OConsoleDatabaseApp method info.
@ConsoleCommand(aliases = { "status" }, description = "Display information about the database", onlineHelp = "Console-Command-Info")
public void info() {
if (currentDatabaseName != null) {
message("\nCurrent database: " + currentDatabaseName + " (url=" + currentDatabase.getURL() + ")");
final OStorage stg = currentDatabase.getStorage();
if (stg instanceof OStorageRemote) {
listServers();
}
listProperties();
listClusters(null);
listClasses();
listIndexes();
}
}
Aggregations