123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- import java.io.IOException;
- import com.ibm.bi.platform.modeling.sdk.examples.SchemaImportHelper;
- import com.ibm.bi.platform.modeling.sdk.examples.internal.ModelingHelper;
- import com.ibm.bi.platform.modeling.sdk.examples.internal.UnexpectedHTTPResponseException;
- public class LoadMetadataExample {
-
- public static void main(String[] args) {
- if (args.length < 6) {
- System.err.println("Wrong number of arguments:" + args.length);
- System.err.println(
- "Correct arguments: origin fileWithCredentials datasourceId connectionId signonId fileWithschemaImportDefintion");
- System.err.println("origin - ca server url origin, e.g. http://localhost:9300/");
- System.err.println("fileWithCredentials - login credentials relative file path");
- System.err.println("datasourceId - datasource store id");
- System.err.println("connectionId - datasource connection store id");
- System.err.println("signonId - signon object store id");
- System.err.println("fileWithschemaImportDefintion - relative to the current directory file path to import options");
- return;
- }
-
- try {
- String origin = args[0], credentials = ModelingHelper.stringFromFile(args[1]), datasourceId = args[2],
- connectionId = args[3], signonId = args[4], importOptions = ModelingHelper.stringFromFile(args[5]);
-
- SchemaImportHelper helper = new SchemaImportHelper(origin);
- helper.authenticate(credentials);
- helper.runLoadMetadataExample(datasourceId, connectionId, signonId, importOptions);
- } catch (UnexpectedHTTPResponseException e) {
- try {
- System.out.println("Response :" + ModelingHelper.httpEntityToString(e.getResponse().getEntity()));
- } catch (IOException io) {
- }
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
|