Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyserbyte committed May 24, 2018
1 parent 84f6218 commit 8aa13c7
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ public static void execute(String driver, String jurl, String username, String p
String chosenMapper, String xmlPath, String nameResolver, String outputLevel, List<String> includedTables,
List<String> excludedTables, String configurationPath, OPluginMessageHandler messageHandler) throws OTeleporterIOException {

SetScriptOTeleporterContext(outDbUrl);

// trying to load the configuration starting from the input configurationPath
ODocument migrationConfigDoc = null;
String jsonMigrationConfig = null;
Expand Down Expand Up @@ -481,6 +483,32 @@ public static ODocument execute(String driver, String jurl, String username, Str
includedTables, excludedTables, null, messageHandler, null);
}

public static void SetScriptOTeleporterContext(String outDbUrl) {
/**
* Urls handling
*/

String serverInitUrl;

if(outDbUrl.contains("embedded") || outDbUrl.contains("plocal")) {
outDbUrl = outDbUrl.replace("plocal","embedded");
serverInitUrl = outDbUrl.substring(0, outDbUrl.lastIndexOf('/') + 1);
}

else if(outDbUrl.contains("remote")) {
serverInitUrl = outDbUrl.substring(0, outDbUrl.lastIndexOf('/') + 1);
}
else {
// memory protocol
serverInitUrl = outDbUrl;
}

OTeleporterContext.newInstance(serverInitUrl);

OTeleporterContext.getInstance().setMessageHandler(messageHandler);

}

@Override
public String getName() {
return "teleporter";
Expand Down

0 comments on commit 8aa13c7

Please sign in to comment.