use of com.google.api.services.datastream.v1alpha1.model.OracleSchema in project DataflowTemplates by GoogleCloudPlatform.
the class DataStreamClient method discoverOracleTableSchema.
/**
* Return a {@link OracleTable} object with schema and PK information.
*
* @param streamName A fully qualified Stream name (ie. projects/my-project/stream/my-stream)
* @param schemaName The name of the schema for the table being discovered.
* @param tableName The name of the table to discover.
* @param sourceConnProfile The SourceConfig connection profile to be discovered.
*/
public OracleTable discoverOracleTableSchema(String streamName, String schemaName, String tableName, SourceConfig sourceConnProfile) throws IOException {
DataStream.Projects.Locations.ConnectionProfiles.Discover discoverConnProfile = getDiscoverTableRequest(streamName, schemaName, tableName, sourceConnProfile);
OracleRdbms tableResponse = discoverConnProfile.execute().getOracleRdbms();
OracleSchema schema = tableResponse.getOracleSchemas().get(0);
OracleTable table = schema.getOracleTables().get(0);
return table;
}
use of com.google.api.services.datastream.v1alpha1.model.OracleSchema in project DataflowTemplates by GoogleCloudPlatform.
the class DataStreamClient method buildOracleRdbmsForTable.
private OracleRdbms buildOracleRdbmsForTable(String schemaName, String tableName) {
List<OracleTable> oracleTables = new ArrayList<OracleTable>();
oracleTables.add(new OracleTable().setTableName(tableName));
List<OracleSchema> oracleSchemas = new ArrayList<OracleSchema>();
oracleSchemas.add(new OracleSchema().setSchemaName(schemaName).setOracleTables(oracleTables));
OracleRdbms rdbms = new OracleRdbms().setOracleSchemas(oracleSchemas);
return rdbms;
}
Aggregations